亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? zl5011xpkcclassify.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*******************************************************************************
*
*  File name:              zl5011xPkcClassify.c
*
*  Version:                17
*
*  Author:                 MRC
*
*  Date created:           09/05/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*
*  This file contains all the functions that will control the classifier
*  part of the Pkc block. The classifier is used to determine the context of a
*  data flow and to match control packets for the host. When a match is made,
*  the match is checked to ensure that it is valid. The routing information etc.
*  is set to determine the destination for the packet.
*
*  The various stages in the PKC are as follows:
*
*  pre-processor  matches ethertype / MAC addresses for directing to the host.
*  pre-classifier matches the protocol type and extracts bytes from the header
*                 for use in the classification stage
*  classifier     matches the bytes extracted by the pre-classifier, to
*                 determine the context number for data transactions. Is also
*                 used to direct control packets related to a data path to the
*                 host.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     09/05/2002  MRC      Creation
*  2     13/05/2002  MRC      Update
*  3     15/05/2002  MRC      Used the flow type to determine RTP stats bit
*                             in the classifier, rather than an i/p field
*  4     21/05/2002  MRC      PKC Rams have to be written in reverse order.
*  5     13/06/2002  MRC      Uses the match define for both the mask and
*                             the match function
*  6     21/06/2002  MRC      Revamped the entry allocation fns
*  7     12/07/2002  MRC      Rationalised the 2 enums for CPU queues
*  8     22/07/2002  MRC      pkt length for host packets is now the Rx length
*  9     31/10/2002  MRC      Added variants + minor fixes
*  10    07/11/2002  MRC      Added control for SetContextMatch fn to use the
*                             raw Rx packet length
*  11    06/01/2003  MRC      Modified function zl5011xPkcProtocolConfigure
*  12    30/04/2003  JFE      Made change to take account of pkc pre-classify bug
*                             in errata 2.56
*  13    29/07/2003  APL      Enable RTP stats for PKT_PE_PKT flow
*  14    23/07/2004  MRC      Fixed some compiler warnings
*  15    26/08/2004  MRC      Reset PW interrupt when changing a match
*  16    21/01/2005  MRC      Added extra flow type
*  17    21/07/2005  MRC      Added function to check if an entry is used
*
*******************************************************************************/

/*****************   INCLUDE FILES                *****************************/

#include "zl5011x.h"
#include "zl5011xPkc.h"
#include "zl5011xPkcMap.h"
#include "zl5011xUtilLib.h"

/*****************   EXPORTED GLOBAL VARIABLES    *****************************/

/*****************   STATIC GLOBAL VARIABLES      *****************************/

/*******************************************************************************

 Function:
    zl5011xPkcClassifyConfigure

 Description:
    This function controls the behaviour for packets that are not matched in
    the classifier, or fail to verify following a successful match.
    They can be discarded or forwarded to the host using a specified queue.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   discard        ZL5011X_TRUE to discard non-matching packets,
                  ZL5011X_FALSE to forward to the host
   queueNum       queue number to use for packets forwarded to host
   verifyDiscard  ZL5011X_TRUE to discard packets failing verification,
                  ZL5011X_FALSE to forward to the host
   verifyQueueNum queue number to use for packets failing verification that
                  are to be forwarded to host

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

*******************************************************************************/

zlStatusE zl5011xPkcClassifyConfigure(zl5011xParamsS *zl5011xParams,
      zl5011xBooleanE discard, zl5011xQueueE queueNum,
      zl5011xBooleanE verifyDiscard, zl5011xQueueE verifyQueueNum)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T bits = 0;

   ZL5011X_TRACE(ZL5011X_PKC_FN_ID,
         "zl5011xPkcClassifyConfigure: drop %d, queue %d, verify: drop %d, queue %d",
         discard, queueNum, verifyDiscard, verifyQueueNum, 0, 0);

   status = ZL5011X_CHECK_BOOLEAN(discard);

   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_BOOLEAN(verifyDiscard);
   }

   if (status == ZL5011X_OK)
   {
      if (discard == ZL5011X_FALSE)
      {
         status = ZL5011X_CHECK_QUEUE_NUMBER(queueNum);

         /* if the packets are being directed to the CPU, then set the
            queue ID and leave the discard bit */
         if (status == ZL5011X_OK)
         {
            bits = queueNum << ZL5011X_PKC_CLASSIFY_NO_MATCH_QUEUE_BITS;
         }
      }
      else
      {
         /* if discarding the packets, then set the bit to enable this */
         bits = ZL5011X_1BIT_MASK << ZL5011X_PKC_CLASSIFY_NO_MATCH_DROP_BIT;
      }
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, ZL5011X_PKC_CLASSIFY_NO_MATCH, bits);
   }

   if (status == ZL5011X_OK)
   {
      if (verifyDiscard == ZL5011X_FALSE)
      {
         status = ZL5011X_CHECK_QUEUE_NUMBER(verifyQueueNum);

         /* if the packets are being directed to the CPU, then set the
            queue ID and leave the discard bit */
         if (status == ZL5011X_OK)
         {
            bits = verifyQueueNum << ZL5011X_PKC_VERIFY_NO_MATCH_QUEUE_BITS;
         }
      }
      else
      {
         /* if discarding the packets, then set the bit to enable this */
         bits = ZL5011X_1BIT_MASK << ZL5011X_PKC_VERIFY_NO_MATCH_DROP_BIT;
      }
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, ZL5011X_PKC_VERIFY_NO_MATCH, bits);
   }

   if (status == ZL5011X_OK)
   {
      /* store the discard and queue settings in the device structure */
      zl5011xParams->packetIf.packetRx.pkcClassifyDiscard = discard;
      zl5011xParams->packetIf.packetRx.pkcClassifyCpuQueue = queueNum;
      zl5011xParams->packetIf.packetRx.pkcVerifyDiscard = verifyDiscard;
      zl5011xParams->packetIf.packetRx.pkcVerifyCpuQueue = verifyQueueNum;
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xPkcClassifyCheckFreeEntry

 Description:
   This function is provided to allow the application to check whether a PKC
   classifier match is in use without actually reserving it for use.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   matchNum       the classifier match number to check

 Outputs:
   entryFree      ZL5011X_TRUE if the entry is unused

 Returns:
   zlStatusE

 Remarks:
   None

*******************************************************************************/

zlStatusE zl5011xPkcClassifyCheckFreeEntry(zl5011xParamsS *zl5011xParams,
      Uint32T matchNum, zl5011xBooleanE *entryFree)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_PKC_FN_ID,
         "zl5011xPkcClassifyCheckFreeEntry: match %d",
         matchNum, 0, 0, 0, 0, 0);

   *entryFree = ZL5011X_FALSE;

   /* check that a valid match number was specified */
   if (matchNum >= ZL5011X_PKC_NUM_CLASSIFY_ENTRIES)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }
   else
   {
      /* check whether the match is in use */
      if (zl5011xParams->packetIf.packetRx.pkcClassify[matchNum].classifyReserved == ZL5011X_FALSE)
      {
         *entryFree = ZL5011X_TRUE;
      }
   }

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_PKC_FN_ID,
            "zl5011xPkcClassifyCheckFreeEntry: match %d, avail %d",
            matchNum, *entryFree, 0, 0, 0, 0);
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xPkcClassifyGetFreeEntry

 Description:
   This function can reserve an entry in the classifier if a valid match
   number is provided, or will allocate one if possible.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   matchNum       the number of a free entry or ZL5011X_INVALID to allocate a
                  match number

 Outputs:
   matchNum       the number of a free entry if at input it was ZL5011X_INVALID

 Returns:
   zlStatusE

 Remarks:
   None

*******************************************************************************/

zlStatusE zl5011xPkcClassifyGetFreeEntry(zl5011xParamsS *zl5011xParams,
      Uint32T *matchNum)
{
   Uint32T loop;
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_PKC_FN_ID,
         "zl5011xPkcClassifyGetFreeEntry: match in %d",
         *matchNum, 0, 0, 0, 0, 0);

   /* if the match number was set to a special value of invalid,
      then one will be automatically found */
   if (*matchNum == (Uint32T)ZL5011X_INVALID)
   {
      for (loop = 0; loop < ZL5011X_PKC_NUM_CLASSIFY_ENTRIES; loop++)
      {
         if (zl5011xParams->packetIf.packetRx.pkcClassify[loop].classifyReserved == ZL5011X_FALSE)
            break;
      }

      if (loop >= ZL5011X_PKC_NUM_CLASSIFY_ENTRIES)
      {
         /* no free matches in the classifier, so return error */
         status = ZL5011X_NO_AVAIL_CLASSIFY_MATCH;
      }
      else
      {
         *matchNum = loop;
      }
   }
   else
   {
      /* if the number was specified, but was not valid, then throw an error */
      if (*matchNum >= ZL5011X_PKC_NUM_CLASSIFY_ENTRIES)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
      else
      {
         /* check that the match is not already in use */
         if (zl5011xParams->packetIf.packetRx.pkcClassify[*matchNum].classifyReserved == ZL5011X_TRUE)
         {
            status = ZL5011X_CLASSIFY_MATCH_IN_USE;
         }
      }
   }

   /* reserve the match if there has not been an error */
   if (status == ZL5011X_OK)
   {
      zl5011xParams->packetIf.packetRx.pkcClassify[*matchNum].classifyReserved = ZL5011X_TRUE;
      zl5011xParams->packetIf.packetRx.pkcClassify[*matchNum].classifyContext = (Uint32T)ZL5011X_INVALID_CONTEXT;

      ZL5011X_TRACE(ZL5011X_PKC_FN_ID,
            "zl5011xPkcClassifyGetFreeEntry: match out %d",
            *matchNum, 0, 0, 0, 0, 0);
   }

   return(status);
}

/*******************************************************************************

 Function:
    zl5011xPkcClassifyEnableEntry

 Description:
   Enables a classifier entry. The entry should be configured before it is
   enabled.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   matchNum       the number of the entry to enable

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

*******************************************************************************/

zlStatusE zl5011xPkcClassifyEnableEntry(zl5011xParamsS *zl5011xParams,
      Uint32T matchNum)
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
波多野结衣在线一区| 2019国产精品| 日韩精品最新网址| 综合在线观看色| 麻豆国产一区二区| 欧美日韩国产美女| 中文字幕综合网| 国产成a人亚洲精品| 欧美日韩高清不卡| 亚洲精品国产一区二区三区四区在线 | 国产成人综合网| 7777女厕盗摄久久久| 亚洲精品国产a久久久久久| 成人黄页在线观看| 久久久国产一区二区三区四区小说 | 99精品欧美一区二区三区综合在线| 日韩视频国产视频| 亚洲国产欧美另类丝袜| heyzo一本久久综合| 久久麻豆一区二区| 久久97超碰国产精品超碰| 欧美精品三级日韩久久| 亚洲永久免费视频| 色悠悠亚洲一区二区| 亚洲欧美综合另类在线卡通| 成人动漫一区二区在线| 欧美激情在线一区二区三区| 国产麻豆精品久久一二三| 日韩精品一区二区三区中文精品| 日韩av不卡一区二区| 666欧美在线视频| 日本不卡1234视频| 日韩欧美一区在线观看| 久久成人久久爱| 久久只精品国产| 国产高清不卡一区| 国产精品免费视频观看| 91色乱码一区二区三区| 亚洲天堂免费在线观看视频| 91极品美女在线| 亚洲一区二区黄色| 欧美一级在线免费| 久久97超碰色| 国产欧美日韩卡一| 91视视频在线观看入口直接观看www | 成人免费黄色在线| 亚洲视频免费观看| 欧美性猛片xxxx免费看久爱| 石原莉奈一区二区三区在线观看| 91精品国产综合久久香蕉的特点 | 欧美自拍偷拍一区| 日韩精品国产欧美| 久久综合色播五月| 99久久综合精品| 亚洲国产你懂的| 日韩你懂的电影在线观看| 国产高清在线精品| 亚洲欧美区自拍先锋| 91精品国产综合久久蜜臀| 国产精品一区二区在线播放| 亚洲人精品一区| 日韩午夜精品视频| av亚洲产国偷v产偷v自拍| 亚洲国产日产av| 久久久一区二区| 91视视频在线观看入口直接观看www | 久久91精品国产91久久小草| 国产精品久久久久影院色老大| 在线影院国内精品| 国产精品系列在线播放| 亚洲午夜久久久久久久久电影网 | 欧美午夜不卡在线观看免费| 精品一区二区三区免费播放| 国产精品初高中害羞小美女文| 欧美日韩国产美女| 成人精品gif动图一区| 婷婷国产在线综合| 国产色91在线| 欧美日高清视频| 成人久久久精品乱码一区二区三区| 亚洲成人av免费| 欧美激情中文字幕| 日韩欧美一卡二卡| 欧美中文字幕亚洲一区二区va在线| 国产一区欧美日韩| 亚洲成av人片在线观看无码| 欧美国产日韩a欧美在线观看| 7777精品伊人久久久大香线蕉| 91在线视频在线| 国产一区二区三区免费看| 午夜久久电影网| 亚洲女同女同女同女同女同69| 久久亚洲一级片| 日韩一区二区三区av| 91国模大尺度私拍在线视频| 成人高清免费观看| 国产老妇另类xxxxx| 美国欧美日韩国产在线播放| 亚洲国产综合91精品麻豆| 亚洲图片另类小说| 成人欧美一区二区三区1314| 亚洲国产激情av| 国产人成一区二区三区影院| 精品成a人在线观看| 日韩亚洲欧美中文三级| 91精品国产一区二区| 欧美日韩国产美女| 欧美精品1区2区| 欧美日本在线视频| 欧美一区二区网站| 日韩一区二区三区电影在线观看| 欧美裸体一区二区三区| 欧美日韩黄色影视| 欧美一区二区三区喷汁尤物| 欧美精品在线视频| 91精品国产91久久综合桃花| 91精品黄色片免费大全| 日韩午夜av一区| 精品美女在线播放| 久久久99久久| 中文字幕国产一区| 国产精品久久久久aaaa| 亚洲同性同志一二三专区| 一区二区三区日韩在线观看| 亚洲午夜激情av| 日本aⅴ免费视频一区二区三区 | 日韩高清在线观看| 人人精品人人爱| 黄色资源网久久资源365| 激情成人综合网| 成人av午夜电影| 欧美日韩中字一区| 欧美一区二区精品在线| 精品国产乱码久久久久久蜜臀| 久久久美女艺术照精彩视频福利播放 | 亚洲一区二区成人在线观看| 日本aⅴ免费视频一区二区三区| 韩日av一区二区| 91麻豆免费观看| 欧美日韩免费电影| www激情久久| 亚洲欧美国产高清| 日本免费在线视频不卡一不卡二| 国产麻豆精品theporn| 白白色亚洲国产精品| 欧美三级韩国三级日本三斤| 26uuu国产日韩综合| 亚洲女厕所小便bbb| 精品一二三四区| 日本精品免费观看高清观看| 日韩午夜激情电影| 亚洲女性喷水在线观看一区| 麻豆免费看一区二区三区| 不卡的av在线播放| 日韩午夜激情免费电影| 中文字幕一区二区三| 久色婷婷小香蕉久久| 在线观看区一区二| 欧美激情中文字幕一区二区| 午夜电影网一区| av成人老司机| 亚洲精品一区二区三区在线观看| 亚洲乱码国产乱码精品精可以看| 精一区二区三区| 欧美日韩一级大片网址| 国产精品视频免费| 久久99精品久久久久久久久久久久| 91免费版在线| 国产欧美一区二区精品仙草咪| 亚洲成人www| 91九色最新地址| 国产精品不卡在线| 精品一区二区精品| 这里只有精品电影| 亚洲精品久久久蜜桃| 国产99一区视频免费| 欧美白人最猛性xxxxx69交| 亚洲高清免费在线| 91豆麻精品91久久久久久| 国产欧美视频一区二区三区| 日韩1区2区3区| 欧美日韩在线播放一区| 樱花影视一区二区| 99精品国产热久久91蜜凸| 国产日韩欧美精品综合| 激情综合网最新| 日韩视频一区二区在线观看| 午夜国产不卡在线观看视频| 欧美在线视频不卡| 一区二区三区在线看| 91看片淫黄大片一级在线观看| 国产日韩欧美a| 国产精品456露脸| 久久精品视频网| 国产一级精品在线| 欧美激情一区二区三区蜜桃视频 | 国产精品福利在线播放| 国产一区二区精品在线观看| 欧美成人精品福利| 久久91精品久久久久久秒播|