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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? zl5011xlan.c

?? Zalink50114----TDMoIP芯片驅(qū)動(dòng)源碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/*******************************************************************************
*
*  File name:              zl5011xLan.c
*
*  Version:                58
*
*  Author:                 MRC
*
*  Date created:           11/06/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*
*  This file contains the functions required to setup the Lan ports and
*  packet configuration
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     11/06/2002  MRC      Creation
*  2     14/06/2002  MRC      Added some packet fns
*  3     21/06/2002  MRC      Added more packet fns
*  4     28/06/2002  MRC      Added packet Rx functions
*  5     03/07/2002  MRC      Changed the protocol match structure names
*  6     09/07/2002  MRC      Added an enable to the Lan configure fn
*  7     12/07/2002  MRC      Added bodge RTP function for packet Tx headers
*  8     18/07/2002  MRC      Allow layer 4 and 5 header output MPID to be
*                             specified, rather than default to the context no.
*  9     22/07/2002  MRC      Removed temp fns
*  10    06/08/2002  MRC      Added packet Rx filtering fns
*  11    16/08/2002  MRC      Added control to allow the Tx RTP timestamp to be
*                             derived from the WAN interface.
*  12    02/09/2002  MRC      Allows the flow to be set for Rx contexts
*  13    04/09/2002  MRC      Changed the name of a structure entry from
*                             protocolLength16Bits to protocolTwoByteSeq
*  14    05/09/2002  MRC      Determine the Wan Tx switch bit during context
*                             changes
*  15    12/09/2002  MRC      Updated following review
*  16    13/09/2002  MRC      Added in PHY and stats functions
*  17    18/09/2002  MRC      Increased the number of granules for the Lan
*                             queues
*  18    02/10/2002  DJA      ZL5011X_TRACE messages fixed up
*  19    17/10/2002  MRC      Improved default packet size for lan configure
*  20    25/10/2002  MRC      Added parameter checking
*  21    30/10/2002  MRC      Fixed context check in Layer 4 and 5 header fn
*  22    31/10/2002  MRC      Added variants + minor fixes
*  23    04/11/2002  MRC      LanRxSetContextMatch allows the calling function
*                             to specify the mpid
*  24    07/11/2002  MRC      Added control for LanRxSetContextMatch to use the
*                             raw Rx packet length
*  25    19/11/2002  MRC      Fixed gotDevice checks
*  26    07/01/2003  MRC      Added zl5011xLanGetPacketStats function
*  27    22/05/2003  MRC      Added Lan port redirection functions
*  28    29/07/2003  APL      Added support for devices with no TDM interface
*                             Renamed global wanLimits structure to devLimits
*  29    30/07/2003  APL      Renamed packetToTdmMapping
*  30    30/07/2003  APL      Fixed problem identifying free header
*                             (from previous change)
*  31    04/08/2003  APL      Removed unused variable for some device variants
*  32    11/08/2003  MRC      Now allow port to be disabled by configure fn
*  33    26/08/2003  MRC      Added check for the Lan port
*  34    09/09/2003  MRC      Fixed a couple of context checks that were
*                             checking for modification rather than active
*  35    12/09/2003  APL      Minor change to a comment from audit follow up
*  36    06/11/2003  AMS      Update
*  37    10/11/2003  AMS      Update
*  38    06/01/2004  MRC      Reverted to revision 35
*  39    14/01/2004  APL      Minor function header update for LanTxPortRedirect
*  40    23/03/2004  APL      Corrected file version history
*  41    15/04/2004  APL      Improved comments in zl5011xLanRxFilter
*  42    05/05/2004  MRC      Revised the port combination rule
*  43    23/06/2004  APL      Corrected a comment so it matched the code
*  44    26/07/2004  MRC      Fixed some compiler warnings
*  45    29/07/2004  MRC      Fixed some compiler warnings
*  46    25/08/2004  MRC      Added PW functions
*  47    06/09/2004  APL      Map ports appropriately for different device variants
*  48    13/09/2004  APL      Delay enabling lan-to-lan context matches until context
*                                is updated.
*                             Extra variable added to zl5011xParamsS to avoid referencing
*                                low level PKI port numbers.
*                             Added port validity rule 4 to zl5011xLanConfigure.
*                             Lan-to-lan contexts restricted to only one header match.
*  49    14/09/2004  APL      Minor tidying following review
*  50    24/01/2005  APL      Mac type variable set correctly in zl5011xLanConfigure
*                             Allow special test mode build
*  51    04/02/2005  MRC      Added read counters call to Lan stats function
*  52    14/02/2005  APL      Ensure RTP stats are read from the current header.
*                             Corrected range check in zl5011xLanGetRtpStats.
*  53    28/02/2005  APL      Added additional debug (internal use only)
*  54    07/03/2005  APL      Fixed compiler warnings (internal code only)
*  55    06/05/2005  APL      Added function zl5011xLanGetTxSeqNum
*  56    17/05/2005  MRC      Update protocol type when deleting headers
*  57    05/07/2005  APL      zl5011xLanGetTxSeqNum now returns a sensible value
*                             when a context has just been created.
*  58    21/07/2005  MRC      Added functions to read/write a 32 bit value to the
*                             Packet Tx header and provided support for a packet
*                             discard Lan port
*
*******************************************************************************/

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

#include "zl5011xApi.h"
#include "zl5011xLan.h"
#include "zl5011xMisc.h"
#include "zl5011xPkcMap.h"
#include "zl5011xTdm.h"

/*****************   STATIC FUNCTION DECLARATIONS   ***************************/

/*****************   EXPORTED FUNCTION DEFINTIONS   ***************************/

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

 Function:
    zl5011xLanConfigureStructInit

 Description:
   Initialises structure used by zl5011xLanConfigure function.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   par            Pointer to the structure for configuration items.
                  See main function

 Returns:
   zlStatusE

 Remarks:
    None

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

zlStatusE zl5011xLanConfigureStructInit(zl5011xParamsS *zl5011xParams, zl5011xLanConfigureS *par)
{
   zlStatusE status = ZL5011X_OK;

   /* do some parameter checking */
   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

   /* main function code starts */

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_LAN_FN_ID,
            "zl5011xLanConfigureStructInit:",
            0, 0, 0, 0, 0, 0);

      par->portNum = (Uint8T)ZL5011X_INVALID;
      par->macType = ZL5011X_MAC_TYPE_MII;
      (void)memset(par->macAddress, 0, sizeof(par->macAddress));
      par->enable64BitMacStats = ZL5011X_FALSE;

      par->vlanEnabled = ZL5011X_FALSE;
      par->maxPktLength = (Uint32T)ZL5011X_INVALID;
      par->osExclusionEnable = ZL5011X_TRUE;

      /* the following settings are for internal use only and should NOT be modified */
      par->filterBroadcastPkts = ZL5011X_FALSE;
      par->filterMulticastPkts = ZL5011X_FALSE;
      par->filterNonMatchingUnicastPkts = ZL5011X_FALSE;
   }

   return status;
}

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

 Function:
   zl5011xLanConfigure

 Description:
   Used to configure a Lan port - setting MAC address and  packet filtering.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   par            Pointer to the structure for configuration items. See below:

 Structure inputs:
   portNum        which port to configure
   macType        how should the MAC be configure - MII, GMII, PCS
   macAddress     address of the MAC (macAddress[0] = high byte - 1st transmitted)
   maxPktLength   how long is the longest packet to receive - will default to
                  the maximum for the VLAN type unless specified
   vlanEnabled    set to ZL5011X_TRUE to enable VLAN tagged packets
   enable64BitMacStats  set to ZL5011X_TRUE to enable 64 bit MAC statistics
                        collection - only required for GMII (uses interrupts)
   osExclusionEnable ZL5011X_TRUE to enable OS exclusion

 Structure outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

zlStatusE zl5011xLanConfigure(zl5011xParamsS *zl5011xParams, zl5011xLanConfigureS *par)
{
   zlStatusE status = ZL5011X_OK;
   Uint8T internalPortNum;
   Uint32T loop;
   Uint32T countMII = 0, countGMII = 0;
   zl5011xBooleanE gotDevice = ZL5011X_FALSE;

   /* do some parameter checking */
   status = ZL5011X_CHECK_POINTERS(zl5011xParams, par);

   if (status == ZL5011X_OK)
   {
      status = ZL5011X_CHECK_RUNNING(zl5011xParams);
   }

   if ((status == ZL5011X_OK) && (par->osExclusionEnable == ZL5011X_TRUE))
   {
      /* get access to the device */
      status = zl5011xGetDevice(zl5011xParams, ZL5011X_GET_DEVICE_TIMEOUT_MODE);

      if (status == ZL5011X_OK)
      {
         gotDevice = ZL5011X_TRUE;
      }
   }

   /* main function code starts */

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_LAN_FN_ID,
            "zl5011xLanConfigure:",
            0, 0, 0, 0, 0, 0);

      /* check that a valid port has been provided */
      if (par->portNum >= zl5011xParams->devLimits.lanNumLanPorts)
      {
         status = ZL5011X_INVALID_PORT;
      }
      else
      {
         /* Map requested port to real internal one */
         status = zl5011xPkiExternalPortToInternal(zl5011xParams, &internalPortNum, par->portNum);
      }
   }
   if (par->macType == ZL5011X_MAC_TYPE_DISABLED)
   {
      if (status == ZL5011X_OK)
      {
      /* the MAC port is being disabled */
         status = zl5011xPkiEnablePort(zl5011xParams, internalPortNum, ZL5011X_FALSE);

         zl5011xParams->lanPortInitialised[par->portNum] = ZL5011X_FALSE;  /* Array reference is the external port number */
         zl5011xParams->pki.lanPort[internalPortNum].macControl.macType = par->macType;
      }
   }
   else
   { /* MAC port is being enabled */
      if (status == ZL5011X_OK)
      {
         /* If port is to be set to GMII speed then check that the port is GMII capable */
         if (((par->macType == ZL5011X_MAC_TYPE_GMII) || (par->macType == ZL5011X_MAC_TYPE_PCS)) &&
               (par->portNum > zl5011xParams->devLimits.lanNumGbitLanPorts-1))
         {
            /* This port is not GMII capable */
            status = ZL5011X_INVALID_PORT_CONFIG;
         }
      }

      /* Has passed the basic validity tests. Now check for valid combinations.
         Count how many ports of each speed (100 or 1000) would be configured if
         the current configuration went ahead  */
      for (loop = 0; (loop < zl5011xParams->devLimits.lanNumLanPorts) && (status == ZL5011X_OK); loop++)
      {
         if (par->portNum == loop)  /* Include the proposed setting for the current port in the count */
         {
            if (par->macType == ZL5011X_MAC_TYPE_MII)
            {
               countMII++;
            }
            else
            {
               countGMII++;
            }
         }
         else
         {
            if (zl5011xParams->lanPortInitialised[loop] == ZL5011X_TRUE)
            {
               /* port is initialised, how has it been configured? */
               if (status == ZL5011X_OK)
               {
                  if (zl5011xParams->packetIf.lanMacType[loop] == ZL5011X_MAC_TYPE_MII)
                  {
                     countMII++;
                  }
                  else
                  {
                     countGMII++;
                  }
               }
            }
         }
      }

      {
         /* Check that the resulting port combination will be valid */
#ifdef _ZARLINK_TEST_DISABLE_LAN_RULE1
         /* Special build to allow port 2 and 3 to be used together for internal testing.
            Do NOT use this in normal use as the ports are designed for redundancy purposes
            only and are not intended to be used simultaneously in normal use. */
#else
         /* Rule 1: ports 2 & 3 cannot both be configured together */
         if ((status == ZL5011X_OK) &&
             (((par->portNum == 2) && (zl5011xParams->lanPortInitialised[3] == ZL5011X_TRUE)) ||
              ((par->portNum == 3) && (zl5011xParams->lanPortInitialised[2] == ZL5011X_TRUE))))
         {
            status = ZL5011X_INVALID_PORT_CONFIG;
         }
#endif
         /* Rule 2: If all ports are MII then the total maximum number of ports is three */
         if ((status == ZL5011X_OK) && (countGMII == 0) && (countMII > 3))
         {
            status = ZL5011X_INVALID_PORT_CONFIG;
         }
         /* Rule 3: For devices that support more than one GMII-capable port, if either port 0
            or port 1 is configured then the other can only be configured to be the same type.
            The following combinations would be allowed:
               Port 0   Port 1
               MII      MII         Permitted, both ports can be active
               GMII     GMII        Only one port can be active. Second port provides redundancy
               PCS      PCS         Only one port can be active. Second port provides redundancy */
         if ((status == ZL5011X_OK) && (zl5011xParams->devLimits.lanNumGbitLanPorts > 1))
         {
            if (((par->portNum == 0) && (zl5011xParams->lanPortInitialised[1] == ZL5011X_TRUE) &&
                 (par->macType != zl5011xParams->packetIf.lanMacType[1])) ||
                ((par->portNum == 1) && (zl5011xParams->lanPortInitialised[0] == ZL5011X_TRUE) &&
                 (par->macType != zl5011xParams->packetIf.lanMacType[0])))
            {
               status = ZL5011X_INVALID_PORT_CONFIG;
            }
         }
      }

      if (status == ZL5011X_OK)
      {
         if (par->maxPktLength == (Uint32T)ZL5011X_INVALID)
         {
            /* if the calling function has not set a packet length, then
               set the maximum for the VLAN type */

            if (par->vlanEnabled == ZL5011X_FALSE)
            {
               /* maximum packet length for a NON vlan packet is 1518 */
               par->maxPktLength = 1518;
            }
            else
            {
               /* maximum packet length for a vlan packet is 1518 + 4 = 1522 */
               par->maxPktLength = 1522;
            }
         }

         status = zl5011xPkiConfigure(zl5011xParams,
               internalPortNum,
               par->macAddress,
               par->maxPktLength,
               par->macType,
               par->filterBroadcastPkts,
               par->filterMulticastPkts,
               par->filterNonMatchingUnicastPkts,
               par->vlanEnabled,
               par->enable64BitMacStats);
      }

      /* if the port was configured correctly, enable it */
      if (status == ZL5011X_OK)
      {
         /* Store the type of mac configured */
         zl5011xParams->packetIf.lanMacType[par->portNum] = par->macType;

         status = zl5011xPkiEnablePort(zl5011xParams, internalPortNum, ZL5011X_TRUE);

         zl5011xParams->lanPortInitialised[par->portNum] = ZL5011X_TRUE;   /* Array reference is external port num */
      }
   }

   if (gotDevice == ZL5011X_TRUE)
   {
      if (status == ZL5011X_OK)

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日一区二区三区| 黑人巨大精品欧美黑白配亚洲| 欧美一卡2卡3卡4卡| 成人在线综合网| 日本不卡123| 亚洲自拍偷拍麻豆| 国产精品婷婷午夜在线观看| 欧美一级爆毛片| 欧美性猛交一区二区三区精品| 国产精品77777| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲乱码中文字幕综合| 国产午夜久久久久| 精品美女在线观看| 欧美精品第一页| 在线看不卡av| 91亚洲精品久久久蜜桃网站| 黄色成人免费在线| 免费高清成人在线| 污片在线观看一区二区| 亚洲男人电影天堂| 亚洲色图在线播放| 综合久久久久久| 国产精品色噜噜| 中文字幕精品一区二区精品绿巨人 | 激情综合五月天| 日日摸夜夜添夜夜添国产精品| 亚洲精品欧美二区三区中文字幕| 国产欧美一区二区精品婷婷 | 日韩精品一区二区三区中文不卡| 欧美日韩一区二区三区免费看| 99精品久久免费看蜜臀剧情介绍| 国产成人精品综合在线观看| 国产一区二区精品久久99| 久久精品国内一区二区三区| 蜜臀av性久久久久av蜜臀妖精| 日韩黄色免费网站| 日本不卡在线视频| 青青草精品视频| 日本成人在线电影网| 免费看欧美女人艹b| 麻豆国产精品视频| 激情五月播播久久久精品| 久久成人羞羞网站| 国模娜娜一区二区三区| 国产精品综合久久| 国v精品久久久网| 成人app在线| 91福利国产精品| 欧美福利一区二区| 日韩一二三四区| 久久久久9999亚洲精品| 中文乱码免费一区二区| 国产精品色呦呦| 一区二区三区电影在线播| 亚洲电影视频在线| 免费在线观看一区二区三区| 国产揄拍国内精品对白| av激情成人网| 欧美另类videos死尸| 日韩一级黄色大片| 国产日韩欧美一区二区三区乱码| 国产精品久久久久久久久久久免费看 | 久久精品国产色蜜蜜麻豆| 国产一区二区视频在线播放| 国产成人免费在线观看| 色综合夜色一区| 91精品国产综合久久精品性色| 精品成人私密视频| 亚洲欧美色综合| 免费国产亚洲视频| 99久久久无码国产精品| 欧美日韩精品免费观看视频| 久久伊人中文字幕| 亚洲色图欧洲色图| 久久国产日韩欧美精品| av激情成人网| 日韩欧美久久一区| 亚洲精品视频免费看| 免费在线一区观看| 色综合久久综合网97色综合| 欧美一区二区三区人| 中文字幕一区二区三区四区不卡| 亚洲成人激情综合网| 高清不卡一区二区| 91精品国产色综合久久不卡电影 | 成人av免费观看| 日韩视频在线一区二区| 亚洲欧美另类综合偷拍| 美洲天堂一区二卡三卡四卡视频 | 99久久99久久精品国产片果冻| 宅男在线国产精品| 亚洲日穴在线视频| 国产综合久久久久影院| 91黄色免费观看| 国产精品网曝门| 久久se精品一区精品二区| 欧洲在线/亚洲| 国产精品免费视频一区| 久久99热狠狠色一区二区| 一本色道久久综合精品竹菊| 26uuu国产一区二区三区| 亚洲第一在线综合网站| av激情成人网| 国产欧美一区二区精品久导航| 午夜一区二区三区视频| 91在线无精精品入口| 久久精品人人做人人爽人人| 免费人成在线不卡| 欧美日韩综合一区| 一区二区在线免费观看| 99综合电影在线视频| 久久噜噜亚洲综合| 久久国产免费看| 日韩一区二区中文字幕| 无吗不卡中文字幕| 欧美在线小视频| 亚洲视频一区在线| 成人不卡免费av| 欧美极品少妇xxxxⅹ高跟鞋| 狠狠色丁香久久婷婷综合_中| 欧美日韩成人激情| 亚洲第一福利一区| 欧美无人高清视频在线观看| 亚洲免费资源在线播放| 色婷婷亚洲精品| 亚洲人成人一区二区在线观看| 成人app下载| 亚洲欧美日韩中文播放 | 亚洲成人久久影院| 在线观看成人小视频| 亚洲综合另类小说| 欧美性生活久久| 亚洲成av人片一区二区三区| 欧美日韩成人在线| 男女视频一区二区| 精品成人a区在线观看| 国产一区二区三区四区五区入口 | 国产亚洲精品bt天堂精选| 精品在线一区二区三区| 精品不卡在线视频| 国产福利一区二区三区视频在线| 国产欧美日韩中文久久| 成人aaaa免费全部观看| 亚洲欧美一区二区三区久本道91 | 亚洲男人的天堂在线观看| eeuss鲁片一区二区三区在线看| 国产精品情趣视频| 91污在线观看| 午夜婷婷国产麻豆精品| 日韩一级在线观看| 国产一区二区三区香蕉| 国产精品电影一区二区| 91麻豆国产香蕉久久精品| 亚洲免费av网站| 91精品欧美福利在线观看| 国产在线国偷精品免费看| 国产精品免费人成网站| 欧美综合亚洲图片综合区| 日韩不卡手机在线v区| 久久日一线二线三线suv| 成人国产精品免费观看视频| 亚洲精品第1页| 宅男噜噜噜66一区二区66| 国产在线播放一区三区四| 国产精品免费久久久久| 欧美日韩精品一区二区天天拍小说 | 久久影院午夜论| 91麻豆高清视频| 蜜臂av日日欢夜夜爽一区| 国产精品入口麻豆原神| 欧美日韩国产乱码电影| 国内精品久久久久影院薰衣草| 国产精品日产欧美久久久久| 欧美伊人久久大香线蕉综合69| 激情综合五月婷婷| 亚洲综合偷拍欧美一区色| 欧美一级二级在线观看| 99久久综合国产精品| 日韩极品在线观看| 国产精品女上位| 这里只有精品视频在线观看| 成人高清伦理免费影院在线观看| 亚洲成人av中文| 国产精品三级在线观看| 制服丝袜亚洲网站| 99精品视频在线免费观看| 日本成人在线网站| 伊人性伊人情综合网| 国产夜色精品一区二区av| 欧美视频中文字幕| 成人少妇影院yyyy| 麻豆精品一区二区三区| 亚洲综合免费观看高清完整版在线 | 91蜜桃在线免费视频| 麻豆精品一二三| 亚洲成人免费电影| 亚洲手机成人高清视频| 国产亚洲美州欧州综合国| 91精品一区二区三区在线观看|