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

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

?? zl5011xtdm.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*******************************************************************************
*
*  File name:              zl5011xTdm.c
*
*  Version:                96
*
*  Author:                 MRC
*
*  Date created:           03/05/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description:
*
*  This file contains the functions required to control the TDM interface.
*
*  The convention is that all directions are referenced relative to the
*  device. That is Rx is Wan Rx for the device and Tx is Wan Tx for the device.
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     03/05/2002  MRC      Creation
*  2     14/05/2002  MRC      Added more functions
*  3     15/05/2002  MRC      Added support for unframed mode
*  4     16/05/2002  MRC      Added more functions
*  5     17/05/2002  MRC      Added context delete functions
*  6     23/05/2002  MRC      Added PAC async functionality
*  7     23/05/2002  MRC      TIF changed Rx clock polarity, so changed defaults
*  8     28/05/2002  MRC      Mods following seminar
*  9     30/05/2002  MRC      Made function naming more consistent
*  10    30/05/2002  MRC      Changed the payload function, to take care of
*                             bit stuffing in frames
*  11    31/05/2002  MRC      Added harness defaults to init functions
*  12    06/06/2002  MRC      Changed default for async ref to ext primary ref
*  13    11/06/2002  MRC      Added harness setups to create context fns
*  14    12/06/2002  MRC      Added checks for context teardown in create fns
*  15    17/06/2002  MRC      Use number of streams from the structure rather
*                             than the max #define
*  16    19/06/2002  MRC      PAC DPLL changed
*  17    20/06/2002  MRC      Changed default DPLL mode to slave
*  18    28/06/2002  MRC      Added packet Rx header freeing to the delete
*                             context fn
*  19    09/07/2002  MRC      Added Wan Rx sample point control
*  20    12/07/2002  MRC      Rationalised the 2 enums for CPU queues
*  21    18/07/2002  MRC      Added Wan to CPU functions
*  22    19/07/2002  MRC      Added dynamic alloc for queues
*  23    22/07/2002  MRC      Tidied up structure initialisation fns
*  24    01/08/2002  MRC      Added queue slip fn and tidied
*  25    14/08/2002  MRC      Changed the way that unframed mode was being
*                             determined in a few fns
*  26    05/09/2002  MRC      Determine the Wan Tx switch bit during context
*                             changes
*  27    12/09/2002  MRC      Updated following review
*  28    13/09/2002  MRC      Added extra funcs
*  29    19/09/2002  MRC      Added extra dpll settings to wan configure fn
*  30    23/09/2002  MRC      Added RTP header copy during Wan Rx delete
*  31    02/10/2002  MRC      Fixed a couple of function names
*  32    03/10/2002  MRC      Clear the first frame field when updating the
*                             RTP Tx header during a delete
*  33    03/10/2002  MRC      added the RTP Tx header fix in another place
*  34    03/10/2002  MRC      Fixed a couple of traces using the worng FN_ID
*  35    16/10/2002  PJE      zl5011xWanConfigureAsync input clock pol inverted
*  36    17/10/2002  PJE      WanConfigureAsync input clock pol invd. properly
*  37    29/10/2002  MRC      Added parameter checking
*  38    31/10/2002  MRC      Added variants + minor fixes
*  39    04/11/2002  MRC      Added fix for context take parameter checks
*  40    04/11/2002  MRC      Changed context take parameter checks
*  41    07/11/2002  MRC      Added Lan Rx cleanup when deleting a Tx context
*                             from the INIT state
*  42    07/11/2002  MRC      Needed to clean up the packet to TDM mappings
*                             to allow the PKC matches to be deleted
*  43    19/11/2002  MRC      Fixed gotDevice checks
*  44    29/11/2002  MRC      Tx queue slip fn checks that queue is active.
*  45    09/12/2002  DJA      Header for function zl5011xWanSetAsyncRtpModeStructInit
*                             modified.
*  46    09/12/2002  DJA      Header for function zl5011xWanSetAsyncRtpMode
*                             fixed up.
*  47    13/12/2002  MRC      Added control to allow Wan Tx clock to be sourced
*                             externally in unframed mode
*  48    06/02/2003  MRC      Added DPLL output enable option for operation
*                             in sync master mode and inband PRS freq fn
*  49    17/02/2003  MRC      Added BER functions
*  50    25/03/2003  MRC      Added DPLL lock range control
*  51    03/04/2003  MRC      Changed default clock polarities for LIU mode
*  52    29/04/2003  MRC      Get and Set Tx freq can now be called in sync mode
*  53    27/05/2003  MRC      Run for TIF block now takes place in
*                             WanConfigureSync/WanConfigureAsync
*  54    11/06/2003  MRC      Added zl5011xWanRxGetPayloadLength fn and option
*                             to force the Wan Rx payload to be 64 bit aligned
*  55    26/06/2003  MRC      Added function to calculate the payload size for
*                             unframed contexts
*  56    02/07/2003  MRC      Updated structure comments
*  57    21/07/2003  MRC      Added queue stats function
*  58    30/07/2003  APL      Renamed packetToTdmMapping
*  59    11/08/2003  MRC      Added channel combination checking
*  60    28/08/2003  MRC      Fixed context create Rx CPU queue problem
*  61    18/11/2003  AMS      Update
*  62    06/01/2004  MRC      Reverted to revision 60
*  63    29/01/2004  MRC      Amended the channel checking rule to check
*                             that a channel number is not duplicated
*  64    24/03/2004  APL      In zl5011xWanTxQueueSlip if the payload size is
*                             insufficient to slip a whole frame then the return
*                             error is ZL5011X_PAYLOAD_SIZE_ERROR
*  65    20/04/2004  APL      Payload size can be specified in bytes for unframed
*                             mode
*  66    20/04/2004  APL      Added error status check in zl5011xWanRxPayloadConfig
*  67    14/07/2004  MRC      Fixed problem deleting Wan Tx contexts that had
*                             not initialised.
*  68    21/07/2004  MRC      Added Wan Tx clock source functions
*  69    26/07/2004  MRC      Fixed some compiler warnings
*  70    29/07/2004  MRC      Fixed some compiler warnings
*  71    04/08/2004  MRC      Comment change for DCO bypass parameter
*  72    19/08/2004  MRC      Added limits checking to payload calculation
*  73    25/08/2004  MRC      Initialise PW variables on context creation.
*  74    26/08/2004  MRC      Update PKC/context mappings on context create
*  75    15/09/2004  APL      Offset the DCO on auxiliary stream where this
*                             exists
*  76    16/09/2004  APL      Corrected comment in zl5011xWanRxGetPayloadLength
*  77    17/09/2004  MRC      Added min/max statistics to zl5011xWanTxGetQueueStats
*  78    27/09/2004  MRC      Added control for TDM_CLKiP freq to configureSync
*  79    20/10/2004  MRC      Added PRS variable to async configure struct
*  80    16/11/2004  MRC      Added individual stream frequency control
*  81    23/11/2004  APL      Changed default behaviour for stream frequency
*  82    24/11/2004  APL      Initialise per-stream parameter array properly
*  83    26/11/2004  MRC      Use async style per-stream control for sync operation
*  84    16/12/2004  MRC      Added clock reference mux function
*  85    17/12/2004  APL      Initialise per-stream parameter array (sync mode)
*  86    21/01/2005  MRC      zl5011xWanSetTxFreq can change nominal stream freq
*  87    28/01/2005  MRC      Added option to use a GPIO pin to force WanTx
*                             context deletion and current queue length to
*                             function zl5011xWanTxGetQueueStats
*  88    14/02/2005  APL      Previously static API function
*                             zl5011xUpdateRTPCurrentHeaderRecord is now available
*                             to other API files.
*  89    19/04/2005  MRC      Added context check when forcing Tx teardown
*  90    06/05/2005  APL      Added function zl5011xTdmGetCurrentSeqNum
*  91    12/05/2005  APL      zl5011xWanSetTxFreq can now set zero frequency
*  92    17/05/2005  MRC      Added function to return TDM queue counts and
*                             reset statistics upon context creation
*  93    08/06/2005  MRC      Corrected function header
*  94    04/07/2005  MRC      Added StreamClockConfig support for clock only streams
*  95    06/07/2005  MRC      Turn on DCO's during configureSync function
*  96    21/07/2005  MRC      Relaxed default PLL limits, to match settings used
*                             during device characterisation.
*
*******************************************************************************/

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

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

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

static zlStatusE zl5011xContextSetWanRxHostHeader(zl5011xParamsS *zl5011xParams,
      zl5011xContextSetHostQueueS *par);

/*****************   STATIC CONSTANTS ***************************/

#define ZL5011X_AUX_CLK_OFFSET   100000  /* +100 ppm for the auxiliary clock */

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

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

 Function:
   zl5011xContextCreateStructInit

 Description:
   Initialises structure used by zl5011xContextCreate functions.

 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 zl5011xContextCreateStructInit(zl5011xParamsS *zl5011xParams, zl5011xContextCreateS *par)
{
   zlStatusE status = ZL5011X_OK;

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

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE(ZL5011X_TDM_FN_ID,
            "zl5011xContextCreateStructInit:",
            0, 0, 0, 0, 0, 0);

      par->context = (Uint32T)ZL5011X_INVALID_CONTEXT;

      /* set an invalid default for the flow - the API will choose the
         most suitable flow if this is not explicitly specified */
      par->flow = (zl5011xFlowTypeE)ZL5011X_INVALID;

      par->unframedStream.underrunMode = ZL5011X_WAN_USE_LAST_BYTE;
      par->osExclusionEnable = ZL5011X_TRUE;
   }

   return status;
}

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

 Function:
   zl5011xContextCreateRx

 Description:
   Function to create a Wan Rx context (that is Wan Rx to the device).
   Checks that the context is not currently in use and sets it to the INIT
   state. For unframed operation, the context relates directly to the stream
   number, so for this instance, also add the first channel (0) for the stream.

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

 Structure inputs:
   context     context number for creation
   flow        routing through the device for the context - can be left as value
               specified in StructInit function for default operation.
   osExclusionEnable ZL5011X_TRUE to enable OS exclusion

 Structure outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   Flows to the CPU are initialised to use CPU queue 3.

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

zlStatusE zl5011xContextCreateRx(zl5011xParamsS *zl5011xParams, zl5011xContextCreateS *par)
{
   zlStatusE status = ZL5011X_OK;
   zl5011xWanChannelS tdm;
   zl5011xContextSetHostQueueS contextSetHostQueue;
   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;
      }
   }

   /* check that the Wan Rx context is valid */
   if (status == ZL5011X_OK)
   {
      status = zl5011xContextCheckRx(zl5011xParams, par->context, ZL5011X_CHECK_CONTEXT_NUMBER);
   }

   /* main function code starts */

   if (status == ZL5011X_OK)
   {
      ZL5011X_TRACE_CONTEXT(ZL5011X_TDM_FN_ID, par->context,
            "zl5011xContextCreateRx: ctxt %3d",
            par->context, 0, 0, 0, 0, 0);
   }

   if (status == ZL5011X_OK)
   {
      /* if the context is tearing down, then check to see if it has completed */
      if (zl5011xParams->wanIf.plaCurrent.context[par->context].state == ZL5011X_STATE_TEARING_DOWN)
      {
         status = zl5011xPlaCheckContextTeardown(zl5011xParams, par->context);

         /* if the teardown has completed, then reset the error code and
            continue */
         if (status == ZL5011X_CONTEXT_TEARDOWN_COMPLETE)
         {
            status = ZL5011X_OK;
         }
      }
   }

   if (status == ZL5011X_OK)
   {
      /* check that the context is not currently in use */
      if (zl5011xParams->wanIf.plaCurrent.context[par->context].state != ZL5011X_STATE_NOT_IN_USE)
      {
         status = ZL5011X_CONTEXT_IN_USE;
      }
   }

   if (status == ZL5011X_OK)
   {
      if (par->flow == (zl5011xFlowTypeE)ZL5011X_INVALID)
      {
         /* if the flow type has not been specified then set the default
            for this direction */
         zl5011xParams->wanIf.wanRxFlow[par->context] = ZL5011X_FLOW_WAN_PE_PKT;
      }
      else
      {
         zl5011xParams->wanIf.wanRxFlow[par->context] = par->flow;
      }

      zl5011xParams->wanIf.plaCurrent.context[par->context].state = ZL5011X_STATE_INIT;

      /* new configuration so clear out any previous packet Tx header information */
      zl5011xParams->packetIf.packetTx.txHeader[par->context].protocolType = ZL5011X_INVALID_PROTOCOL;
      zl5011xParams->packetIf.packetTx.txHeader[par->context].highHeader[0].txHighLength = 0;
      zl5011xParams->packetIf.packetTx.txHeader[par->context].highHeader[1].txHighLength = 0;

      /* Initialise the payload size to exactly 1 frame. */
      zl5011xParams->wanIf.plaCurrent.context[par->context].payloadFrames = 1;
      zl5011xParams->wanIf.plaCurrent.context[par->context].payloadBytes = 0;

      /* update the device structures idea of which is the current header */
      status = zl5011xUpdateRTPCurrentHeaderRecord(zl5011xParams, par->context);
   }

   if (status == ZL5011X_OK)
   {
      /* reset the RTP statistics - packet Tx */
      status = zl5011xRtpInitStatisticsTxEntry(zl5011xParams, par->context);
   }

   if (status == ZL5011X_OK)
   {
      /* setup the PLA flow and mpid as required for the flow type */
      switch (par->flow)
      {
         case ZL5011X_FLOW_WAN_CPU :
            /* set the CPU queue to queue 3 by default */
            status = zl5011xContextSetHostQueueStructInit(zl5011xParams, &contextSetHostQueue);

            if (status == ZL5011X_OK)
            {
               contextSetHostQueue.context = par->context;
               contextSetHostQueue.cpuQueue = ZL5011X_QUEUE_0;
               contextSetHostQueue.osExclusionEnable = ZL5011X_FALSE;
               status = zl5011xContextSetHostQueue(zl5011xParams, &contextSetHostQueue);
            }
            break;

         case ZL5011X_FLOW_WAN_PE_CPU :
            /* set the mpid up as the context ID, since the mapping is one to one
               into the RTP block */
            status = zl5011xPlaSetFlowType(zl5011xParams, par->context, ZL5011X_FLOW_WAN_PE_CPU, par->context);

            /* set the CPU queue to queue 3 by default */
            if (status == ZL5011X_OK)
            {
               status = zl5011xContextSetHostQueueStructInit(zl5011xParams, &contextSetHostQueue);
            }

            if (status == ZL5011X_OK)
            {
               contextSetHostQueue.context = par->context;
               contextSetHostQueue.cpuQueue = ZL5011X_QUEUE_0;
               contextSetHostQueue.osExclusionEnable = ZL5011X_FALSE;
               status = zl5011xContextSetHostQueue(zl5011xParams, &contextSetHostQueue);
            }
            break;

         default :
            status = zl5011xPlaSetFlowType(zl5011xParams, par->context,
                  zl5011xParams->wanIf.wanRxFlow[par->context], par->context);
      }
   }

   /* if in unframed mode, then need to add the stream to the context now */
   if ((status == ZL5011X_OK) && (zl5011xParams->wanIf.wanConnectionMode == ZL5011X_WAN_CONNECTION_UNFRAMED))
   {
      tdm.stream = (Uint8T)par->context;
      tdm.channel = 0;

      status = zl5011xPlaAddChan(zl5011xParams, par->context, tdm);
   }

   if (gotDevice == ZL5011X_TRUE)
   {
      if (status == ZL5011X_OK)
      {
         status = zl5011xReleaseDevice(zl5011xParams);
      }
      else
      {
         /* already have an error code, so don't overwrite it */
         (void)zl5011xReleaseDevice(zl5011xParams);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区高清| 国产精品久久久久久久久动漫| 日韩国产在线观看| 亚洲女性喷水在线观看一区| 久久嫩草精品久久久精品一| 欧美一区二区三区系列电影| 欧美精品黑人性xxxx| 欧美日韩成人综合| 日韩写真欧美这视频| 亚洲激情欧美激情| 舔着乳尖日韩一区| 美日韩黄色大片| 久久99精品网久久| 国产综合久久久久影院| 国产成人夜色高潮福利影视| 成人黄色电影在线| 不卡欧美aaaaa| 久久久777精品电影网影网 | 蜜桃精品在线观看| 色哟哟国产精品| 欧美唯美清纯偷拍| 欧美一级高清片在线观看| 一区二区三区蜜桃| 日韩不卡在线观看日韩不卡视频| 色94色欧美sute亚洲13| 欧美大胆一级视频| 国产精品丝袜在线| 亚瑟在线精品视频| 国产在线精品一区二区| 99精品视频中文字幕| 欧美精品欧美精品系列| 亚洲最大的成人av| 精品视频1区2区3区| 2021中文字幕一区亚洲| 亚洲欧洲性图库| 免费成人在线网站| 在线亚洲高清视频| 久久精品一区八戒影视| 成熟亚洲日本毛茸茸凸凹| 欧美日韩一区三区四区| 日韩精品电影在线| 91污在线观看| 精品久久久影院| 亚洲一区中文日韩| 成人午夜电影网站| 亚洲色图欧美偷拍| 成人免费三级在线| 亚洲欧美一区二区三区国产精品| 色av一区二区| 日本麻豆一区二区三区视频| 欧美成人性战久久| 成人a级免费电影| 亚洲综合成人在线视频| 91精品国产日韩91久久久久久| 国产综合色视频| 亚洲欧美视频一区| 日韩一区二区三区免费观看| 国产不卡在线播放| 亚洲精品一区二区三区精华液 | 国产精品美女久久久久高潮| 一本大道久久a久久综合婷婷| 亚洲一区在线观看视频| 日韩午夜精品电影| www.综合网.com| 亚洲国产高清不卡| 国产白丝网站精品污在线入口| 国产精品全国免费观看高清| 欧美天天综合网| 国产成人aaaa| 日韩国产精品久久久| 国产精品你懂的在线| 欧美剧在线免费观看网站| 丁香天五香天堂综合| 午夜精品影院在线观看| 国产嫩草影院久久久久| 国产+成+人+亚洲欧洲自线| 亚洲精品视频在线| 久久久精品国产免大香伊| 在线看日本不卡| 国产盗摄女厕一区二区三区| 日韩中文字幕av电影| 成人免费一区二区三区视频| 日韩视频免费观看高清完整版在线观看| 成人午夜视频在线| 国产一区三区三区| 日韩国产高清在线| 一区二区三区中文字幕电影| 国产婷婷色一区二区三区在线| 欧美精品精品一区| 在线观看一区不卡| 99精品热视频| 岛国精品在线观看| 国产精品一区二区视频| 亚洲精品乱码久久久久久 | 欧美电影免费观看高清完整版在 | 日本电影亚洲天堂一区| 国产成人免费网站| 韩国精品主播一区二区在线观看 | 亚洲最新在线观看| 亚洲日本在线观看| 中文幕一区二区三区久久蜜桃| 精品国产一区二区国模嫣然| 欧美丰满少妇xxxbbb| 欧美精品三级在线观看| 欧美写真视频网站| 91久久精品国产91性色tv| 一本到一区二区三区| 99久久99久久精品免费看蜜桃| 成人免费不卡视频| 99精品欧美一区二区三区综合在线| 国产成人综合在线播放| 国产精品一区二区在线观看不卡| 国产在线视视频有精品| 国产乱码精品一品二品| 国产精品自拍在线| 成人免费高清视频| 色网综合在线观看| 欧美日韩一区二区在线视频| 91精品国产一区二区三区| 欧美一区二区三区在线| 精品国免费一区二区三区| 精品国产精品网麻豆系列 | 亚洲免费视频成人| 一个色在线综合| 日日夜夜精品免费视频| 老司机精品视频线观看86| 自拍偷自拍亚洲精品播放| 亚洲视频狠狠干| 亚洲五码中文字幕| 久久久九九九九| 亚洲国产精品av| 亚洲制服丝袜在线| 精品一区二区av| 成人高清视频在线观看| 欧美色图激情小说| 日韩免费观看2025年上映的电影| 国产亚洲欧美中文| 国产精品传媒视频| 日本亚洲三级在线| 高清久久久久久| 欧美日韩国产成人在线免费| 精品少妇一区二区| 1024亚洲合集| 美日韩黄色大片| 波多野结衣中文字幕一区| 欧美日韩国产首页在线观看| 精品国产百合女同互慰| 亚洲免费av在线| 国产在线精品一区二区不卡了 | 国产美女视频一区| 色婷婷久久久亚洲一区二区三区| 911精品国产一区二区在线| 99精品视频免费在线观看| 欧美日韩精品免费观看视频| 久久婷婷久久一区二区三区| 亚洲综合清纯丝袜自拍| 国产乱码精品一区二区三区忘忧草| 91成人国产精品| 国产日韩欧美a| 首页国产欧美久久| 97精品国产97久久久久久久久久久久| 91精品国产综合久久精品| 国产精品家庭影院| 激情综合网av| 欧美日韩国产精品自在自线| 亚洲国产精品高清| 久久丁香综合五月国产三级网站| 91麻豆产精品久久久久久| 国产亚洲短视频| 蜜桃视频在线观看一区| 欧美性xxxxxx少妇| ...xxx性欧美| 成人av网站大全| 久久精品视频免费| 经典一区二区三区| 制服.丝袜.亚洲.中文.综合| 亚洲一区二区中文在线| a级精品国产片在线观看| 国产婷婷一区二区| 精品一区二区综合| 日韩女优视频免费观看| 日本一不卡视频| 777亚洲妇女| 日韩精品视频网| 欧美一区在线视频| 五月天精品一区二区三区| 欧美性色黄大片| 一区二区三区不卡视频| 91一区二区在线观看| 中国色在线观看另类| 国产91富婆露脸刺激对白| 久久中文娱乐网| 国产精品亚洲专一区二区三区| 日韩欧美久久久| 久久精品999| 国产亚洲一区字幕| 成人午夜视频免费看| 最新国产の精品合集bt伙计| 99精品黄色片免费大全| 中文字幕亚洲区|