亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
91蜜桃在线观看| 欧美色偷偷大香| 亚洲国产精品自拍| 欧美精品一区视频| 在线免费观看日本欧美| 国产最新精品精品你懂的| 亚洲国产综合人成综合网站| 欧美国产欧美综合| 欧美嫩在线观看| 91丨九色porny丨蝌蚪| 韩国女主播成人在线| 亚洲电影激情视频网站| 中文字幕在线不卡一区| 精品国产乱子伦一区| 欧美日韩一区二区在线观看视频| 国产成人av一区二区三区在线观看| 亚洲高清免费观看高清完整版在线观看| 久久久www免费人成精品| 欧美理论片在线| 色综合久久九月婷婷色综合| 国产成人精品一区二区三区网站观看 | 久久99久久99| 午夜精品成人在线| 亚洲综合在线免费观看| 17c精品麻豆一区二区免费| 久久久久久97三级| 国产亚洲成年网址在线观看| 精品国产成人在线影院 | 国产成人精品一区二区三区四区| 免费在线看一区| 日韩高清国产一区在线| 亚洲午夜精品网| 亚洲影院免费观看| 亚洲一区二区三区视频在线| 亚洲视频1区2区| 亚洲美女在线一区| 亚洲三级小视频| 亚洲欧洲无码一区二区三区| 亚洲国产高清在线观看视频| 国产精品无人区| 国产精品全国免费观看高清 | 日本一二三不卡| 国产欧美一区二区三区在线老狼| 久久日一线二线三线suv| 欧美大白屁股肥臀xxxxxx| 日韩精品一区二区三区视频| 欧美va亚洲va在线观看蝴蝶网| 精品久久久久久久人人人人传媒| 精品欧美黑人一区二区三区| 国产亚洲精品bt天堂精选| 中文一区二区在线观看| 日韩精品亚洲专区| 成人白浆超碰人人人人| 成人一区二区视频| 一本大道久久a久久综合婷婷| 国产精品亚洲综合一区在线观看| 日韩中文字幕亚洲一区二区va在线 | 色吊一区二区三区| 五月婷婷激情综合| 欧美视频中文字幕| 狠狠色丁香九九婷婷综合五月| 国产日韩欧美精品综合| 色素色在线综合| 久色婷婷小香蕉久久| 亚洲国产高清aⅴ视频| 欧美在线免费视屏| 黄色精品一二区| 一区二区三区欧美日| 日韩免费高清av| 日本福利一区二区| 国内不卡的二区三区中文字幕 | 亚洲视频 欧洲视频| 91精品国产综合久久香蕉麻豆| 久久99国内精品| 一二三四社区欧美黄| 久久久综合视频| 制服丝袜日韩国产| 色女孩综合影院| 国产精品69久久久久水密桃| 亚洲成av人片观看| 亚洲欧洲色图综合| 国产三级一区二区| 欧美精品亚洲二区| 91麻豆高清视频| 粉嫩绯色av一区二区在线观看| 五月婷婷综合网| 樱桃国产成人精品视频| 国产亚洲人成网站| 精品欧美久久久| 91精品婷婷国产综合久久竹菊| 99re热这里只有精品免费视频| 国产主播一区二区三区| 日韩二区三区在线观看| 亚洲一区二区三区影院| 国产精品国产馆在线真实露脸| 日韩欧美高清在线| 欧美视频三区在线播放| 99热这里都是精品| 国产成人av资源| 国产91丝袜在线18| 国产一区二区电影| 麻豆一区二区三| 美女久久久精品| 午夜精品久久久久| 日韩精品电影一区亚洲| 亚洲成人自拍偷拍| 亚洲va在线va天堂| 天堂在线一区二区| 亚洲成va人在线观看| 亚洲制服丝袜av| 亚洲最大成人网4388xx| 亚洲午夜精品在线| 香蕉加勒比综合久久| 午夜影视日本亚洲欧洲精品| 亚洲电影在线免费观看| 午夜精品在线视频一区| 亚洲成人精品一区| 视频在线观看国产精品| 日韩va亚洲va欧美va久久| 日韩福利视频导航| 韩国一区二区视频| 国产精品一二三| 91亚洲国产成人精品一区二三| 色噜噜狠狠成人网p站| 欧美视频一区二区三区在线观看| 欧美日韩视频一区二区| 欧美精品粉嫩高潮一区二区| 6080日韩午夜伦伦午夜伦| 日韩欧美亚洲国产另类| 日本一区二区三区dvd视频在线| 国产精品每日更新在线播放网址| 亚洲欧美中日韩| 亚洲第一久久影院| 久久国产精品一区二区| 国产成人精品www牛牛影视| 色综合久久久网| 欧美一卡二卡在线| 国产日韩av一区| 亚洲香蕉伊在人在线观| 精品一区二区国语对白| 成人精品在线视频观看| 欧美亚洲一区二区在线观看| 中文字幕中文字幕一区二区| 亚洲天堂免费看| 视频精品一区二区| 国产一区二区三区精品视频| 不卡的电影网站| 欧美三级电影精品| 精品少妇一区二区三区在线播放| 中文字幕精品一区二区三区精品 | 亚洲www啪成人一区二区麻豆| 免费成人av资源网| 99亚偷拍自图区亚洲| 欧美一区二区视频在线观看2020| 国产三级精品在线| 亚洲成人精品一区| 99精品视频中文字幕| 日韩视频在线你懂得| 综合久久一区二区三区| 久久精品久久综合| 色哟哟一区二区| 久久久精品日韩欧美| 亚洲午夜一二三区视频| 国产福利一区二区三区视频在线 | 午夜精品一区二区三区免费视频 | 亚洲欧美日韩精品久久久久| 日av在线不卡| 91蜜桃视频在线| 久久精品亚洲一区二区三区浴池| 亚洲自拍偷拍麻豆| 国产91色综合久久免费分享| 日韩欧美123| 五月激情综合色| 91免费看视频| 国产精品视频你懂的| 久久国产日韩欧美精品| 91麻豆精品国产91久久久| 亚洲天堂中文字幕| 不卡视频免费播放| 久久免费国产精品| 国产一区二区三区四区五区美女| 欧美高清性hdvideosex| 亚洲精品国久久99热| av不卡一区二区三区| 中文字幕欧美日韩一区| 激情综合五月天| 日韩久久免费av| 蜜臀精品一区二区三区在线观看 | 一本久久a久久精品亚洲| 国产清纯白嫩初高生在线观看91 | 久久综合久久综合亚洲| 日本 国产 欧美色综合| 精品污污网站免费看| 亚洲精品福利视频网站| 97久久精品人人爽人人爽蜜臀| 久久久夜色精品亚洲| 国产乱色国产精品免费视频| 久久蜜桃av一区二区天堂| 国产乱码精品一区二区三区忘忧草 | 欧美国产一区视频在线观看|