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

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

?? zl5011xpkq.c

?? Zalink50114----TDMoIP芯片驅(qū)動(dòng)源碼
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/*******************************************************************************
*
*  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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美综合在线精品| 欧美性受xxxx黑人xyx| 成人精品鲁一区一区二区| jlzzjlzz亚洲日本少妇| 欧美色精品在线视频| 2欧美一区二区三区在线观看视频| 欧美激情一区二区三区不卡 | 久久99日本精品| 成人精品视频一区| 911国产精品| 国产亚洲福利社区一区| 亚洲国产综合91精品麻豆| 老鸭窝一区二区久久精品| 成人av网址在线| 91精品国产欧美一区二区18| 中文字幕精品综合| 日韩av网站在线观看| 成人app软件下载大全免费| 欧美日韩国产精选| 亚洲国产高清在线| 免费在线观看一区| 91免费精品国自产拍在线不卡| 日韩一区二区精品| 亚洲日本va在线观看| 国内欧美视频一区二区| 欧美无砖砖区免费| 国产精品国产三级国产aⅴ中文| 日本sm残虐另类| 色噜噜狠狠成人网p站| 久久亚洲精华国产精华液 | 色婷婷久久久综合中文字幕| 欧美成人官网二区| 一区二区三区不卡在线观看| 国产激情偷乱视频一区二区三区| 69堂精品视频| 亚洲欧美日韩国产手机在线 | 久久日韩粉嫩一区二区三区| 亚洲大片在线观看| 99精品视频一区二区三区| 精品精品国产高清a毛片牛牛| 一区二区三区不卡在线观看| 成人成人成人在线视频| 精品国精品国产| 日韩二区三区在线观看| 欧美性生活影院| 国产精品久久久久aaaa| 国产麻豆午夜三级精品| 日韩午夜激情视频| 午夜精品一区在线观看| 欧洲视频一区二区| 亚洲国产精品成人综合色在线婷婷| 久久精品国产第一区二区三区| 欧美日韩1234| 亚洲成在人线在线播放| 色狠狠色噜噜噜综合网| 国产精品国产三级国产aⅴ入口 | 国产精品福利一区二区三区| 国产一区欧美二区| 2021国产精品久久精品| 蜜桃视频免费观看一区| 91精品国产综合久久福利软件| 亚洲一区二区三区四区不卡| 91国产成人在线| 樱花影视一区二区| 91福利视频久久久久| 亚洲精品欧美专区| 91蜜桃视频在线| 亚洲精品成人天堂一二三| 91麻豆精品一区二区三区| 综合久久综合久久| 91小视频在线| 亚洲免费色视频| 欧美亚洲免费在线一区| 亚洲综合色在线| 欧美视频一区二区三区四区| 亚洲一区在线观看视频| 欧美在线小视频| 亚洲va欧美va天堂v国产综合| 欧美日韩亚洲综合| 性做久久久久久| 欧美一区二区久久| 激情文学综合插| 国产欧美一二三区| 91色综合久久久久婷婷| 亚洲小说春色综合另类电影| 欧美日韩一级片在线观看| 日本一道高清亚洲日美韩| 欧美va日韩va| 岛国精品一区二区| 亚洲欧美色图小说| 欧美日韩在线直播| 人禽交欧美网站| 国产偷国产偷精品高清尤物| 成人国产视频在线观看| 一区二区三区加勒比av| 9191久久久久久久久久久| 精品一区二区在线播放| 久久久精品tv| 一道本成人在线| 日本系列欧美系列| 天堂影院一区二区| 国产一区二区h| 亚洲狼人国产精品| 欧美一三区三区四区免费在线看| 国产一区亚洲一区| 中文字幕+乱码+中文字幕一区| 99久久99久久久精品齐齐| 午夜精品成人在线视频| 久久久久久久久久久久电影| 91小视频免费看| 奇米精品一区二区三区在线观看一| 久久青草欧美一区二区三区| 91麻豆自制传媒国产之光| 视频一区二区欧美| 国产欧美日韩综合精品一区二区| 在线视频亚洲一区| 国产一区二区免费视频| 亚洲精品中文在线观看| 精品日产卡一卡二卡麻豆| 99re热视频精品| 精品一区二区三区香蕉蜜桃| 最新日韩av在线| 日韩欧美激情在线| 99精品欧美一区| 久久黄色级2电影| 亚洲少妇30p| 久久免费午夜影院| 欧美日韩高清一区二区三区| 国产大陆亚洲精品国产| 亚洲成av人影院| 国产精品久久久久久久岛一牛影视| 在线观看91精品国产麻豆| 成人福利电影精品一区二区在线观看| 午夜影院在线观看欧美| 中文字幕一区免费在线观看| 51精品视频一区二区三区| 99精品久久只有精品| 国内外成人在线| 日韩中文字幕av电影| 亚洲青青青在线视频| 国产亚洲一区二区三区四区| 欧美精选在线播放| 色香蕉成人二区免费| 国产精品一区二区三区四区| 日韩专区一卡二卡| 一区二区高清免费观看影视大全| 国产亚洲一区字幕| 欧美变态tickle挠乳网站| 欧美色综合影院| 99riav一区二区三区| 国产aⅴ综合色| 激情综合色综合久久| 日韩黄色免费电影| 亚洲愉拍自拍另类高清精品| 国产精品污污网站在线观看| 日韩欧美一区在线| 欧美日韩综合在线| 91麻豆成人久久精品二区三区| 国产91对白在线观看九色| 美女免费视频一区二区| 亚洲va在线va天堂| 亚洲综合免费观看高清完整版| 亚洲欧洲一区二区三区| 国产欧美一二三区| 久久先锋影音av鲁色资源网| 欧美一二三区在线| 欧美一级精品大片| 欧美乱熟臀69xxxxxx| 欧美在线观看18| 91国偷自产一区二区开放时间| 91网站在线播放| 91麻豆自制传媒国产之光| gogogo免费视频观看亚洲一| 东方欧美亚洲色图在线| 国产福利精品导航| 国产成人夜色高潮福利影视| 国产伦理精品不卡| 国产激情精品久久久第一区二区 | 久久久九九九九| 久久久精品欧美丰满| 国产日本一区二区| 欧美激情中文字幕| 国产精品久久久一区麻豆最新章节| 国产精品私房写真福利视频| 国产婷婷精品av在线| 日本一区二区免费在线| 亚洲国产精品成人综合色在线婷婷| 国产精品毛片久久久久久久| 亚洲欧洲精品一区二区三区| 亚洲欧美日韩综合aⅴ视频| 亚洲精品成人少妇| 香蕉乱码成人久久天堂爱免费| 视频一区中文字幕| 伦理电影国产精品| 国产伦精一区二区三区| 成人午夜大片免费观看| 91亚洲永久精品| 欧美午夜在线观看| 欧美精品久久99| 精品国产一区a|