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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? zl5011xpkq.c

?? Zalink50114----TDMoIP芯片驅(qū)動(dòng)源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*******************************************************************************
*
*  File name:              zl5011xPkq.c
*
*  Version:                23
*
*  Author:                 LCW
*
*  Date created:           16/04/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*  This file contains all the functions that will initialise and control
*  the PKQ block.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     16/04/2002  LCW      Creation.
*  2     17/04/2002  LCW      Minor mods.
*  3     09/05/2002  LCW      Minor mods.
*  4     14/05/2002  LCW      Minor mods.
*  5     16/05/2002  LCW      Minor mods.
*  6     16/05/2002  LCW      Minor mods.
*  7     05/06/2002  MRC      Update
*  8     05/06/2002  MRC      Fixed a few ZL5011X_TRACE statements
*  9     19/05/2002  MRC      Uses defines from addrmap for number of entries
*                             in the context table
*  10    26/06/2002  LCW      Update
*  11    28/06/2002  LCW      Code review actions
*  12    26/07/2002  MRC      Changed queue weighting. Sum of weights no longer
*                             has to add to add to 64.
*  13    22/10/2002  MRC      zl5011xPkqSetMpidConnection now records port and
*                             queue settings in the device structure
*  14    31/10/2002  MRC      Added variants + minor fixes
*  15    29/01/2003  MRC      Added check for the total granule threshold param
*  16    22/05/2003  MRC      Changed size of arrays for Lan Tx port / queue
*  17    09/06/2003  DJA      Performed pre-audit actions
*  18    23/06/2004  APL      Corrected an array index into internal current
*                             state structure and removed duplicate write.
*                             Validated port parameter for zl5011xPkqConfigureQueue
*  19    29/07/2004  MRC      Fixed some compiler warnings
*  20    17/09/2004  MRC      Added check for the queue granule threshold
*  21    17/09/2004  MRC      Changed default for queue granule threshold
*  22    27/09/2004  MRC      Added function to return port / queue for an mpid
*  23    21/07/2005  MRC      Reduced default number of granules for discard port
*
*******************************************************************************/

/*****************   INCLUDE FILES   ******************************************/
#include "zl5011x.h"
#include "zl5011xPkqMap.h"
#include "zl5011xPkq.h"
#include "zl5011xUtilLib.h"
#include "zl5011xRdWr.h"

/*******************************************************************************
 Function:
    zl5011xPkqInit

 Description:
   Called at initialisation time. Enables packet dropping when the total granule
   usage threshold is exceeded. Initialises the MPID connection table.

 Inputs:
    zl5011xParams      Pointer to the structure for this device instance

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None
*******************************************************************************/
zlStatusE  zl5011xPkqInit(zl5011xParamsS *zl5011xParams)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T i,tempGranules;
   Uint8T portNumber;
   Uint8T queueNumber;

   ZL5011X_TRACE(ZL5011X_PKQ_FN_ID, "zl5011xPkqInit:", 0, 0, 0, 0, 0, 0);

   /* initialise the PKQ mode and total threshold limit for the queues */
   status = zl5011xPkqSetTotalThresholdMode(zl5011xParams,
         ZL5011X_PKQ_DEFAULT_PACKET_DROP_MODE);

   if (status == ZL5011X_OK)
   {
      status = zl5011xPkqSetTotalGranuleThreshold(zl5011xParams,
            ZL5011X_PKQ_DEFAULT_TOTAL_GRAN_THLD);
   }

   /* Set granule threshold for all queues */
   for (portNumber = 0; portNumber < ZL5011X_PKQ_NUMBER_OF_PORTS; portNumber++)
   {
      if (portNumber == zl5011xParams->devLimits.lanDiscardPort)
      {
         tempGranules = ZL5011X_PKQ_DEFAULT_DISCARD_GRAN_THLD;
      }
      else
      {
         tempGranules = ZL5011X_PKQ_DEFAULT_QUEUE_GRAN_THLD;
      }

      for (queueNumber = 0; queueNumber < ZL5011X_PKQ_QUEUES_PER_PORT; queueNumber++)
      {
         if (status != ZL5011X_OK)
         {
            break;
         }

         status = zl5011xPkqSetGranuleThreshold(zl5011xParams, portNumber,
               queueNumber, tempGranules);
      }
   }

   /* Enable packet dropping mode for all queues */
   for (portNumber = 0; portNumber < ZL5011X_PKQ_NUMBER_OF_PORTS; portNumber++)
   {
      for (queueNumber = 0; queueNumber < ZL5011X_PKQ_QUEUES_PER_PORT; queueNumber++)
      {
         if (status != ZL5011X_OK)
         {
            break;
         }
         status = zl5011xPkqSetThresholdMode(zl5011xParams, portNumber,
               queueNumber, ZL5011X_PKQ_DEFAULT_PACKET_DROP_MODE);
      }
   }

   /* initialise the queues to be strict priority */
   for (portNumber = 0; portNumber < ZL5011X_PKQ_NUMBER_OF_PORTS; portNumber++)
   {
      if (status != ZL5011X_OK)
      {
         break;
      }
      status = zl5011xPkqSetQueuePriority(zl5011xParams, portNumber, ZL5011X_WFQ_NONE);
   }

   /* setup the context table. The first entries are for MPID associated
      data flows, and the next 16 are for host flows (where there is one for
      each port and queue combination) */
   for (i = 0; i < ZL5011X_PKT_TX_NUM_CONTEXT_HEADERS; i++)
   {
      if (status != ZL5011X_OK)
      {
         break;
      }
      /* initialise data flows to use a default Lan port and queue */
      status = zl5011xPkqSetMpidConnection(zl5011xParams, i,
            ZL5011X_PKQ_DEFAULT_PORT, ZL5011X_PKQ_DEFAULT_QUEUE);
   }

   /* Add further MPIDs for use by host Tx */
   for (i = 0; i < ZL5011X_PKT_TX_NUM_HOST_HEADERS; i++)
   {
      if (status != ZL5011X_OK)
      {
         break;
      }
      queueNumber = (Uint8T)(i % ZL5011X_PKQ_QUEUES_PER_PORT);

      portNumber = (Uint8T)((i / ZL5011X_PKQ_QUEUES_PER_PORT) % ZL5011X_PKQ_NUMBER_OF_PORTS);

      status = zl5011xPkqSetMpidConnection(zl5011xParams,
            ZL5011X_PKT_TX_NUM_CONTEXT_HEADERS + i,
            portNumber, queueNumber);
   }

   return (status);
}

/*******************************************************************************
 Function:
    zl5011xPkqSetQueuePriority

 Description:
   Implements a quality of service feature by setting the queue priority for a
   particular port. A queue will be allocated strict priority or weighted fair
   queueing status.
   When queues are in strict priority mode the highest priority queue is emptied
   first.
   For WFQ, each queue has its own weight to determine the amount of bandwidth
   that will be allocated for its queue.

 Inputs:
   zl5011xParams       Pointer to the structure for this device instance
   portNumber         LAN port number
   priorityMode       Priority mode of port can take the following values:

 Outputs:
   None

 Returns:
  zlStatusE

 Remarks:
   None
*******************************************************************************/

zlStatusE  zl5011xPkqSetQueuePriority(zl5011xParamsS *zl5011xParams,
                                    Uint8T portNumber,
                                    zl5011xPacketQueuePriorityModeE priorityMode)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T queueWeighting = 0, mask = 0;

   ZL5011X_TRACE(ZL5011X_PKQ_FN_ID, "zl5011xPkqSetQueuePriority: Port %ld,Prioity Mode %ld",
         portNumber, priorityMode, 0, 0, 0, 0);

   /* Check priority mode is valid */
   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_WFQ(priorityMode);
   }

   if (status == ZL5011X_OK)
   {
      queueWeighting = priorityMode << (portNumber * ZL5011X_PKQ_NUMBER_OF_WFQ_BITS);
      mask = ZL5011X_2BIT_MASK << (portNumber * ZL5011X_PKQ_NUMBER_OF_WFQ_BITS);

      status = zl5011xReadModWrite(zl5011xParams, ZL5011X_PKQ_LMR, queueWeighting,
            mask);

     /* Record port priority mode in device structure */
      zl5011xParams -> pkq.priorityMode[portNumber] = priorityMode;
   }

   return (status);
}
/*******************************************************************************
 Function:
    zl5011xPkqSetWeighting

 Description:
   Sets weighting for queue

 Inputs:
   zl5011xParams       Pointer to the structure for this device instance
   portNumber         LAN port number
   queue0Weighting    Weighting of queue 0
   queue1Weighting    Weighting of queue 1
   queue2Weighting    Weighting of queue 2
   queue3Weighting    Weighting of queue 3

 Outputs:
   None

 Returns:
  zlStatusE

 Remarks:
   None
*******************************************************************************/

zlStatusE  zl5011xPkqSetWeighting(zl5011xParamsS *zl5011xParams,
                              Uint8T portNumber,
                              Uint32T queue0Weighting,
                              Uint32T queue1Weighting,
                              Uint32T queue2Weighting,
                              Uint32T queue3Weighting)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T gpBuffer = 0, i, registerAddress;
   Uint32T queueWeights[ZL5011X_PKQ_NUM_QUEUES];

   ZL5011X_TRACE(ZL5011X_PKQ_FN_ID,
         "zl5011xPkqSetWeighting: Port %ld, Q0 %ld, Q1 %ld, Q2 %ld,  Q3 %ld",
         portNumber, queue0Weighting, queue1Weighting, queue2Weighting,
         queue3Weighting, 0);

   queueWeights[0] = queue0Weighting;
   queueWeights[1] = queue1Weighting;
   queueWeights[2] = queue2Weighting;
   queueWeights[3] = queue3Weighting;

   /* Mask out unused bits */
   for (i = 0; i < ZL5011X_PKQ_NUM_QUEUES; i++)
   {
      if (status != ZL5011X_OK)
      {
         break;
      }

      if (queueWeights[i] > ZL5011X_PKQ_MAX_QUEUE_WEIGHTING)
      {
         status = ZL5011X_PARAMETER_INVALID;
      }
   }

   if (status == ZL5011X_OK)
   {
      for (i = 0; i < ZL5011X_PKQ_QUEUES_PER_PORT; i++)
      {
         gpBuffer |= queueWeights[i] << (ZL5011X_PKQ_WFQ_SHIFT * i);
      }

      registerAddress = ZL5011X_PKQ_WTA + (portNumber * sizeof(Uint32T));
      status = zl5011xWrite(zl5011xParams, registerAddress, gpBuffer);

      /* Record queue weights in device structure */
      if (status == ZL5011X_OK)
      {
         for (i = 0; i < ZL5011X_PKQ_QUEUES_PER_PORT; i++)
         {
            zl5011xParams -> pkq.queueWeight[portNumber][i] = queueWeights[i];
         }
      }
   }

   return (status);
}

/*******************************************************************************
 Function:
    zl5011xPkqConfigureQueue

 Description:
   Sets threshold mode and size of thresholds.

 Inputs:
   zl5011xParams       Pointer to the structure for this device instance
   portNumber         LAN port number
   queueNumber        Queue number
   thresholdMode      Enables/disables the dropping of packets once granule
                      threshold has been reached.
   granuleThreshold   Granule threshold in queue

 Outputs:
   None

 Returns:
  zlStatusE

 Remarks:
   None
*******************************************************************************/
zlStatusE  zl5011xPkqConfigureQueue(zl5011xParamsS *zl5011xParams,
                                   Uint8T portNumber,
                                   Uint8T queueNumber,
                                   zl5011xBooleanE thresholdMode,
                                   Uint32T granuleThreshold)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_PKQ_FN_ID, "zl5011xPkqConfigureQueue: Port %ld, Queue %ld, Threshold Mode %ld, Granule Threshold %ld",
         portNumber, queueNumber, thresholdMode, granuleThreshold, 0, 0);

   if (status == ZL5011X_OK)
   {
      /* check queue number is in range */
      if (queueNumber >= ZL5011X_PKQ_NUM_QUEUES)
      {
         status= ZL5011X_PARAMETER_INVALID;
      }
   }

   if (status == ZL5011X_OK)
   {
      /* check port number is in range */
      if (portNumber >= ZL5011X_MAX_NUM_LAN_PORTS)
      {
         status= ZL5011X_PARAMETER_INVALID;
      }
   }

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

   if (status == ZL5011X_OK)
   {
      /* Set granule threshold */
      status = zl5011xPkqSetGranuleThreshold(zl5011xParams, portNumber,
            queueNumber, granuleThreshold);

      if (status == ZL5011X_OK)
      {
         /* Set threshold mode */
         status = zl5011xPkqSetThresholdMode(zl5011xParams, portNumber,
               queueNumber, thresholdMode);
      }
   }

   return (status);
}

/*******************************************************************************
 Function:
    zl5011xPkqSetGranuleThreshold

 Description:
   Sets granule threshold for a queue.

 Inputs:
   zl5011xParams          Pointer to the structure for this device instance
   portNumber            LAN port number
   queueNumber           Queue number
   granuleThreshold      Granule threshold of a particular queue

 Outputs:
   None

 Returns:
  zlStatusE

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产aⅴ综合色| 国产成人免费av在线| 日本福利一区二区| 亚洲激情五月婷婷| 欧美在线播放高清精品| 亚洲一区二区三区四区在线| 一本大道综合伊人精品热热 | 理论片日本一区| 欧美成人vr18sexvr| 国产麻豆精品久久一二三| 国产欧美日韩在线视频| 色综合天天天天做夜夜夜夜做| 中文字幕一区日韩精品欧美| 欧美在线观看禁18| 波多野结衣欧美| 亚洲在线视频免费观看| 亚洲国产精品黑人久久久| 99视频有精品| 国产一区二区网址| 老司机精品视频一区二区三区| 亚洲精品成人悠悠色影视| 国产精品日产欧美久久久久| 色屁屁一区二区| 风间由美一区二区三区在线观看| 麻豆精品国产传媒mv男同| 国产精品色婷婷| 久久久久亚洲综合| 色婷婷国产精品综合在线观看| 国产毛片精品一区| 久久99久久精品欧美| 国产精品成人一区二区三区夜夜夜| 色8久久人人97超碰香蕉987| www.欧美.com| proumb性欧美在线观看| 岛国精品在线播放| 六月丁香婷婷色狠狠久久| 日韩在线播放一区二区| 中文字幕一区日韩精品欧美| 欧美激情一区二区在线| 久久精品网站免费观看| 91.成人天堂一区| 粉嫩aⅴ一区二区三区四区五区| 久久99国内精品| 国内不卡的二区三区中文字幕| 一区二区三区四区中文字幕| 国产色91在线| 亚洲欧洲性图库| 综合分类小说区另类春色亚洲小说欧美| 欧美成人a∨高清免费观看| 欧美不卡一区二区| 2023国产精品视频| 欧美高清视频在线高清观看mv色露露十八| 国产91露脸合集magnet| 波多野洁衣一区| 欧美午夜精品一区二区蜜桃 | 国产成人免费高清| 成人激情免费电影网址| 国产一区二区三区久久久 | 一区二区国产盗摄色噜噜| 亚洲影视在线观看| 日本成人在线不卡视频| 亚洲一二三区在线观看| 亚洲色图制服丝袜| 亚瑟在线精品视频| 亚洲制服欧美中文字幕中文字幕| 婷婷丁香激情综合| 亚洲成人你懂的| 裸体一区二区三区| 国产不卡视频一区| 在线精品国精品国产尤物884a| 欧美精品久久一区| 国产日产欧美精品一区二区三区| 亚洲乱码中文字幕| 男女视频一区二区| 麻豆国产精品777777在线| 国产一区不卡在线| 91电影在线观看| 日韩片之四级片| 欧美一区二区高清| 日韩一区二区三区精品视频 | 亚洲日本电影在线| 日本欧美肥老太交大片| 成人激情午夜影院| 欧美一区二区观看视频| 中文字幕日韩精品一区| 丝袜a∨在线一区二区三区不卡| 国产在线播放一区三区四| 色婷婷综合在线| 日韩精品一区二区三区三区免费| 日韩午夜在线观看视频| 中文字幕在线观看不卡| 久久精品国产一区二区三区免费看 | 3d动漫精品啪啪| 国产精品国产三级国产aⅴ中文| 日韩制服丝袜av| 一本色道**综合亚洲精品蜜桃冫| 欧美精品一区二区三区蜜臀| 国产亚洲欧美激情| 午夜欧美视频在线观看| av资源站一区| 26uuu国产在线精品一区二区| 亚洲在线一区二区三区| 成人动漫一区二区三区| 精品国产制服丝袜高跟| 亚洲丶国产丶欧美一区二区三区| 高清不卡一区二区在线| 欧美不卡在线视频| 日韩va欧美va亚洲va久久| 91黄色激情网站| 国产精品久久三| 国产精品91一区二区| 91电影在线观看| 中文字幕中文字幕在线一区 | 99久久精品免费观看| 91福利资源站| 国产精品剧情在线亚洲| 国内外成人在线| 精品欧美一区二区在线观看| 天堂精品中文字幕在线| 在线观看国产日韩| 亚洲黄色片在线观看| 91麻豆精品在线观看| 欧美一级一区二区| 亚洲国产成人av好男人在线观看| hitomi一区二区三区精品| 国产日韩精品视频一区| 国模套图日韩精品一区二区| 精品嫩草影院久久| 久久精品国产秦先生| 日韩欧美一二三四区| 奇米亚洲午夜久久精品| 在线综合亚洲欧美在线视频| 视频一区视频二区中文| 欧美乱妇15p| 日韩福利视频导航| 精品入口麻豆88视频| 国模冰冰炮一区二区| 国产色产综合色产在线视频| 丁香网亚洲国际| 国产精品美女久久福利网站| av不卡免费电影| 亚洲另类在线一区| 欧美在线一区二区| 图片区小说区国产精品视频 | 自拍偷自拍亚洲精品播放| 99视频在线精品| 亚洲午夜羞羞片| 日韩一区二区三区视频| 国产精品中文欧美| 手机精品视频在线观看| 一区二区三区欧美| 久久夜色精品国产欧美乱极品| 麻豆国产精品视频| 午夜伦欧美伦电影理论片| 精一区二区三区| 久久九九久精品国产免费直播| 国产成人午夜99999| 中文字幕中文字幕中文字幕亚洲无线| 97se亚洲国产综合自在线观| 亚洲综合久久av| 日韩午夜电影av| 成人永久aaa| 亚洲欧美另类图片小说| 日本女优在线视频一区二区| 2021中文字幕一区亚洲| 成人国产电影网| 亚洲va欧美va人人爽| 久久综合九色欧美综合狠狠| 成人影视亚洲图片在线| 一区二区三区 在线观看视频| 91精品国产91久久久久久一区二区 | 欧美国产一区二区在线观看| 91看片淫黄大片一级在线观看| 亚洲成人免费视| 欧美日韩一级大片网址| 豆国产96在线|亚洲| 国产激情视频一区二区三区欧美| 波多野结衣中文字幕一区| 97久久超碰精品国产| 色噜噜狠狠色综合欧洲selulu| 欧美色精品在线视频| 欧美视频在线一区二区三区 | 亚洲国产一二三| 色欧美88888久久久久久影院| 日韩精品国产精品| 中文字幕av一区二区三区免费看| 欧美亚洲尤物久久| 国产一区二区三区最好精华液| 亚洲精品日韩一| 久久精品一区二区三区不卡| 91精彩视频在线观看| 国产馆精品极品| 肉丝袜脚交视频一区二区| 国产精品女主播av| 欧美电视剧在线看免费| 欧美性猛片xxxx免费看久爱| 国产成人小视频| 国模一区二区三区白浆| 日韩二区三区在线观看| 亚洲欧美色综合|