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

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

?? zl5011xtdm.c

?? Zalink50114----TDMoIP芯片驅(qū)動源碼
?? 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);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区喷汁尤物| 性做久久久久久免费观看欧美| 亚洲欧美日韩电影| 国产一区二区三区免费观看| 欧美午夜在线一二页| 欧美激情中文字幕| 黄页视频在线91| 欧美久久久影院| 亚洲福利一二三区| 国产盗摄一区二区| 精品电影一区二区三区| 亚洲一区二区三区美女| 91视频精品在这里| 中文字幕av一区二区三区免费看| 精东粉嫩av免费一区二区三区| 精品视频在线免费| 亚洲裸体xxx| www.亚洲免费av| 精品欧美久久久| 日本特黄久久久高潮| 在线播放日韩导航| 日韩精品一区二区三区中文不卡| 在线观看91视频| 亚洲欧洲韩国日本视频| 国产91清纯白嫩初高中在线观看| 成人午夜免费视频| 国产欧美日韩精品在线| 国产在线播放一区二区三区| 91精品国产综合久久久久| 亚洲成人免费在线| 欧美日韩亚洲综合在线| 亚洲乱码国产乱码精品精小说 | 国产精品电影一区二区| 国产一区二区三区高清播放| 精品伦理精品一区| 激情欧美日韩一区二区| 欧美成人一区二区三区片免费 | 亚洲一区中文日韩| 大白屁股一区二区视频| 欧美日韩一区在线观看| 亚洲精品成人天堂一二三| 色婷婷综合久久久| 亚洲视频在线一区观看| 色视频成人在线观看免| 亚洲永久免费av| 7777精品伊人久久久大香线蕉超级流畅| 亚洲.国产.中文慕字在线| 在线播放视频一区| 久久狠狠亚洲综合| 久久久久久久久99精品| 大桥未久av一区二区三区中文| 国产精品二三区| 色婷婷久久久综合中文字幕| 一区二区三区精密机械公司| 国内精品免费**视频| 国产嫩草影院久久久久| 精品电影一区二区三区| 岛国精品在线播放| 亚洲人123区| 欧美视频中文一区二区三区在线观看| 亚洲第一精品在线| 日韩一级成人av| 国产一区二区看久久| 欧美国产欧美综合| 色诱视频网站一区| 午夜精品久久久久久久久| 日韩亚洲欧美成人一区| 国产一区在线精品| 99精品久久99久久久久| 精品国产网站在线观看| 国产a精品视频| 亚洲精品乱码久久久久| 7777精品伊人久久久大香线蕉的| 韩国av一区二区三区四区| 国产精品国产三级国产普通话三级| 91在线播放网址| 青青草精品视频| 国产精品久久网站| 欧美日韩国产高清一区二区三区 | 国产精品天美传媒| 色八戒一区二区三区| 秋霞成人午夜伦在线观看| 国产农村妇女毛片精品久久麻豆| 色诱视频网站一区| 激情亚洲综合在线| 亚洲精品高清视频在线观看| www.综合网.com| 午夜伦理一区二区| 欧美精彩视频一区二区三区| 欧美亚洲综合在线| 国产乱妇无码大片在线观看| 亚洲精品菠萝久久久久久久| 日韩欧美高清dvd碟片| 99久久婷婷国产| 美女视频黄免费的久久 | 精品一区二区三区免费毛片爱| 亚洲人一二三区| 91麻豆精品国产91| 波多野结衣视频一区| 欧美久久一二区| 日韩高清一级片| 国产精品乱码妇女bbbb| 这里只有精品99re| 色婷婷国产精品| 国产在线精品国自产拍免费| 尤物视频一区二区| 久久久久久久一区| 69久久夜色精品国产69蝌蚪网| 成人久久久精品乱码一区二区三区| 香蕉加勒比综合久久| 国产精品国产精品国产专区不蜜| 欧美一区二区三区系列电影| 91丨九色porny丨蝌蚪| 国产乱子伦一区二区三区国色天香| 亚洲主播在线播放| 中文成人综合网| 日韩欧美不卡一区| 精品视频一区二区三区免费| 成人激情图片网| 国产乱码精品一品二品| 日韩电影在线观看一区| 亚洲欧美日韩精品久久久久| av亚洲产国偷v产偷v自拍| 韩国精品久久久| 蜜臀av性久久久久蜜臀aⅴ流畅 | 国产视频一区二区三区在线观看| 欧美一区二区三区啪啪| 欧美色图天堂网| 色综合色综合色综合| 福利电影一区二区| 国产一区在线精品| 久久99精品久久久| 天天操天天干天天综合网| 亚洲欧美一区二区不卡| 国产精品久久久久久亚洲伦| 久久久久久久久久久久久女国产乱| 奇米一区二区三区| 久久精品人人做| 久久毛片高清国产| 欧美mv日韩mv国产| 欧美一区在线视频| 偷窥国产亚洲免费视频| 亚洲黄色av一区| 亚洲女人小视频在线观看| 国产精品午夜春色av| 久久精品夜色噜噜亚洲a∨| 精品久久五月天| 精品伦理精品一区| www成人在线观看| www精品美女久久久tv| 精品少妇一区二区三区在线播放| 91精品国产免费| 欧美一二三区在线| 欧美mv和日韩mv的网站| 精品国产1区2区3区| 久久久综合网站| 欧美极品aⅴ影院| 国产精品免费丝袜| 成人欧美一区二区三区白人 | 成人久久久精品乱码一区二区三区| 国产一区二区三区香蕉| 国产伦精品一区二区三区免费迷| 国产尤物一区二区| 国产iv一区二区三区| 成人av动漫在线| 色婷婷精品大在线视频| 欧美吞精做爰啪啪高潮| 欧美日韩国产美| 欧美videossexotv100| 久久综合狠狠综合久久激情| 欧美国产一区在线| 亚洲欧美一区二区久久| 亚洲大尺度视频在线观看| 日韩黄色免费电影| 久久国产人妖系列| 精品成人在线观看| 欧美一区二区在线播放| 精品国产伦一区二区三区观看体验| 2017欧美狠狠色| 国产精品久久久久久久久久久免费看| 中文字幕日本乱码精品影院| 亚洲一区视频在线| 奇米一区二区三区av| 国产福利一区在线| 一本一道波多野结衣一区二区| 欧美体内she精高潮| 日韩一区二区不卡| 国产精品网站在线播放| 亚洲国产精品综合小说图片区| 日韩av电影一区| 国产成人精品免费网站| 色老汉av一区二区三区| 麻豆成人av在线| 国产成人无遮挡在线视频| 91视视频在线直接观看在线看网页在线看| 在线视频一区二区免费| 日韩你懂的在线播放| 国产精品久久久一区麻豆最新章节| 亚洲一区二区中文在线| 精品一区二区日韩|