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

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

?? zl5011xrtp.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*******************************************************************************
*
*  File name:              zl5011xRtp.c
*
*  Version:                38
*
*  Author:                 PJE
*
*  Date created:           22/05/2002
*
*  Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
*  All rights reserved.
*
*  Module Description: RTP functions
*  The RTP block adds layer 4 and 5 headers, with
*  dynamic fields that are relevant to UDP and RTP. If a context does not
*  require the layer 4 and 5 headers, then the flow type can be set, so that
*  the RTP block is not included in the data path.
*
*
*
*  Revision History:
*
*  Rev:  Date:       Author:  Comments:
*  1     24/05/2002  PJE      Written easy bits - compiles ok
*  2     29/05/2002  PJE      Update
*  3     29/05/2002  PJE      added more - still debugging/writing
*  4     30/05/2002  PJE      after debugging - not including statistics fns.
*  5     10/06/2002  LCW      Update
*  6     10/06/2002  MRC      Modified header structure for set header fn
*  7     11/06/2002  MRC      Moved header structure and fixed timestamp fns
*  8     11/06/2002  MRC      Primary and secondary headers are actually stored
*                             in banks rather than consecutively
*  9     17/06/2002  MRC      CSW bit sense was wrong
*  10    21/06/2002  MRC      Improved check on RTP header address
*  11    25/06/2002  LCW      Update
*  12    26/06/2002  LCW      Minor mods.
*  13    26/06/2002  LCW      Fixed compilation error
*  14    28/06/2002  LCW      Code review actions
*  15    12/07/2002  MRC      Rewrote the statistics functions
*  16    12/07/2002  MRC      Statistics addressing fixed
*  17    15/07/2002  MRC      Statistics addressing for Init fn fixed
*  18    16/07/2002  PJE      correction to zl5011xRtpGetStatisticsAddress
*  19    22/07/2002  MRC      Actions following review
*  20    23/07/2002  MRC      Added block ID register
*  21    31/07/2002  MRC      Timestamp field must be 32 bit aligned for 32 bit
*                             timestamps, so simplified the get and seed fns
*  22    01/08/2002  MRC      Used specific mask for the RTP interrupt period
*  23    16/08/2002  MRC      Added control to allow the Tx RTP timestamp to be
*                             derived from the WAN interface.
*  24    23/08/2002  PJE      mod to zl5011xRtpSetHeader - setting CES header
*  25    02/10/2002  PJE      multiple define now ZL5011X_ADM_RTP_STATS_INTERRUPT
*  26    25/10/2002  PJE      API tidy up
*  27    31/10/2002  MRC      Added variants + minor fixes
*  28    09/06/2003  DJA      Performed pre-audit actions
*  29    29/07/2003  APL      Added support for variants with no TDM
*                             including using only one header in RTP
*                             Renamed global wanLimits structure to devLimits
*  30    04/07/2003  APL      Removed layer5TimestampFromWan for variants with no TDM
*  31    07/08/2003  APL      Audit action - modified comment
*  32    05/09/2003  APL      ZL50130 device should use Primary RTP header
*  33    05/09/2003  APL      Updated version history
*  34    23/07/2004  MRC      Fixed some compiler warnings
*  35    29/07/2004  MRC      Fixed some compiler warnings
*  36    16/12/2004  MRC      Removed TS increment check when using TS from WAN
*  37    06/05/2005  APL      Added function to get last tx sequence number
*  38    17/05/2005  MRC      Added functions to reset Rx and Tx statistics and
*                             fixed endianness of get seq num function
*
*******************************************************************************/

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

#include "zl5011x.h"
#include "zl5011xRtp.h"
#include "zl5011xRtpMap.h"
#include "zl5011xAdm.h"
#include "zl5011xAdmMap.h"
#include "zl5011xUtilLib.h"

/*****************   # DEFINES   **********************************************/

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

/*****************   STATIC GLOBAL VARIABLES   ********************************/

/*****************   EXPORTED GLOBAL VARIABLES   ******************************/

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

/*******************************************************************************
 Function:
    zl5011xRtpInit

 Description:
   Called at initialisation time.
   Resets the granule timeout to a default value.
   Disables reporting.

 Inputs:
    zl5011xParams      Pointer to the structure for this device instance

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

extern zlStatusE zl5011xRtpInit(zl5011xParamsS *zl5011xParams)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T loop;

   ZL5011X_TRACE(ZL5011X_RTP_FN_ID, "zl5011xRtpInit:", 0, 0, 0, 0, 0, 0);

   /* Reset the granule timeout to a default value. */
   status = zl5011xRtpSetGranuleTimeout( zl5011xParams, ZL5011X_RTP_DEFAULT_GRN_TIMEOUT);

   /* Disable reporting. */
   if (status == ZL5011X_OK)
   {
      status = zl5011xRtpDisableReporting(zl5011xParams);
   }

   /* set the block ID. This is only used for debugging TM messages. */
   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, ZL5011X_RTP_BLOCK_ID,
            ZL5011X_RTP_SOURCE_BLOCK_ID);
   }

   if (status == ZL5011X_OK)
   {
      for (loop = 0; loop < ZL5011X_PKT_TX_NUM_CONTEXT_HEADERS; loop++)
      {
         zl5011xParams->packetIf.packetTx.txHeader[loop].protocolType = ZL5011X_INVALID_PROTOCOL;
         zl5011xParams->packetIf.packetTx.txHeader[loop].highHeader[0].txHighLength = 0;
         zl5011xParams->packetIf.packetTx.txHeader[loop].highHeader[1].txHighLength = 0;
      }
   }

   return(status);
}

/*******************************************************************************
 Function:
    zl5011xRtpConfigure

 Description:
      Sets up the statistics table base address and the header base address
      and initialises the statistics structures.

 Inputs:
    zl5011xParams      Pointer to the structure for this device instance
    statistics table base address
    header base address

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

extern zlStatusE zl5011xRtpConfigure(zl5011xParamsS *zl5011xParams,
      Uint32T statsBaseAddr, Uint32T txHeaderBaseAddr)
{
   Uint32T loop;
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE(ZL5011X_RTP_FN_ID, "zl5011xRtpConfigure:", 0, 0, 0, 0, 0, 0);

   /* Sets up the statistics table base address */
   status = zl5011xRtpSetStatisticsBaseAddress( zl5011xParams, statsBaseAddr);

   /* Sets up the Tx per-context data strucure base address */
   if (status == ZL5011X_OK)
   {
        status = zl5011xRtpSetHeaderBaseAddress( zl5011xParams, txHeaderBaseAddr);
   }

   /* initialises the statistics structures */
   if (status == ZL5011X_OK)
   {
      for (loop = 0; loop < ZL5011X_MAX_NUMBER_CONTEXTS; loop++)
      {
         status = zl5011xRtpInitStatisticsEntry(zl5011xParams, loop);
      }
   }

   return(status);
}

/*******************************************************************************
 Function:
    zl5011xRtpSetGranuleTimeout

 Description:
   Enables and sets the granule timeout during the granule request or release
   process

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance
   timeout           The granule timeout in terms of clock cycles

 Outputs:
   None

 Returns:
   zlStatusE

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

extern zlStatusE zl5011xRtpSetGranuleTimeout(zl5011xParamsS *zl5011xParams,
                                             Uint32T timeout)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T rtpAddress=ZL5011X_RTP_CONFIG1;

   ZL5011X_TRACE(ZL5011X_RTP_FN_ID, "zl5011xRtpSetGranuleTimeout: value 0x%.8lx",
                           timeout, 0, 0, 0, 0, 0);

   /* Range check for timeout parameter */
   if (timeout > ZL5011X_RTP_MAX_GRANULE_TIMEOUT)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   /* for any non-zero value enable the timeout */
   if ((timeout > 0) && (status == ZL5011X_OK))
   {
      timeout |= ZL5011X_1BIT_MASK<< ZL5011X_RTP_GRN_TIMEOUT_ENABLE;
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xWrite(zl5011xParams, rtpAddress, timeout);
   }

   if (status == ZL5011X_OK)
   {
      /* update structure */
      zl5011xParams->rtp.granuleTimeout= timeout;
   }

   return(status);
}

/*******************************************************************************
 Function:
    zl5011xRtpSetStatisticsBaseAddress

 Description:
      The address is used as the top 13 bits of the external memory address
      for accessing the statistics structure.


 Inputs:
    zl5011xParams     Pointer to the structure for this device instance
   Uint32T           statsBaseAddr

 Outputs:
   None

 Returns:
   zlStatusE

 Remarks:
   None

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

extern zlStatusE zl5011xRtpSetStatisticsBaseAddress(zl5011xParamsS *zl5011xParams,
      Uint32T statsBaseAddr)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T bits, bitMask;

   ZL5011X_TRACE(ZL5011X_RTP_FN_ID,
         "zl5011xRtpSetStatisticsBaseAddress: value 0x%.8lx",
         statsBaseAddr, 0, 0, 0, 0, 0);

   if ((statsBaseAddr & ~(ZL5011X_RTP_MM_RTPS_MASK << ZL5011X_RTP_MM_RTPS_DROP_BITS)) != 0)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   if (status == ZL5011X_OK)
   {
      bits = statsBaseAddr >> ZL5011X_RTP_MM_RTPS_DROP_BITS;
      bitMask = ZL5011X_RTP_MM_RTPS_MASK << ZL5011X_RTP_MM_RTPS_BADDR;

      status = zl5011xReadModWrite(zl5011xParams, ZL5011X_RTP_CONFIG0,
            bits << ZL5011X_RTP_MM_RTPS_BADDR, bitMask);

      /* update structure */
      zl5011xParams -> rtp.rtpStatsBaseAddress = statsBaseAddr;
   }

   return(status);
}

/*******************************************************************************
 Function:
    zl5011xRtpSetHeaderBaseAddress

 Description:
   Constructs and sets the header base address.

 Inputs:
   zl5011xParams      Pointer to the structure for this device instance
   headerBaseAddr    The address to be set in bytes

 Outputs:
   None

 Returns:
   zlStatusE

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

extern zlStatusE zl5011xRtpSetHeaderBaseAddress(zl5011xParamsS *zl5011xParams,
      Uint32T headerBaseAddr)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T bits, bitMask;

   ZL5011X_TRACE(ZL5011X_RTP_FN_ID,
         "zl5011xRtpSetHeaderBaseAddress: value 0x%.8lx",
         headerBaseAddr, 0, 0, 0, 0, 0);

   if ((headerBaseAddr & ~(ZL5011X_RTP_MM_RTPTX_MASK << ZL5011X_RTP_MM_RTPTX_DROP_BITS)) != 0)
   {
      status = ZL5011X_PARAMETER_INVALID;
   }

   if (status == ZL5011X_OK)
   {
      bits = headerBaseAddr >> ZL5011X_RTP_MM_RTPTX_DROP_BITS;
      bitMask = ZL5011X_RTP_MM_RTPTX_MASK << ZL5011X_RTP_MM_RTPTX_BADDR;

      status = zl5011xReadModWrite(zl5011xParams, ZL5011X_RTP_CONFIG0,
            bits << ZL5011X_RTP_MM_RTPTX_BADDR, bitMask);

      /* update structure */
      zl5011xParams->rtp.rtpTxHeaderBaseAddress = headerBaseAddr;
   }

   return(status);
}

/*******************************************************************************
 Function:
    zl5011xRtpGetInterruptStatus

 Description:
      The RTP block generates an interrupt to indicate that the counters have
      rolled over. The rollover is detected by a scanning function inside the
      RTP block, which checks for the roll overs. The minimum interval between
      the interrupts is set using the function RtpSetInterruptPeriod.
      If this is the first interrupt for a context, then the sequence number held
      in the interrupt register is the first sequence number. This is stored
      straight into the device structure.

 Inputs:
    zl5011xParams    Pointer to the structure for this device instance

 Outputs:
      Pcontext      The context associated with the interrupt
      pRollFlags    Flags to indicate counter roll over

 Returns:
    zlStatusE

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

extern zlStatusE zl5011xRtpGetInterruptStatus(zl5011xParamsS *zl5011xParams,
      Uint32T *pContext,
      Uint32T *pRollFlags)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T rtpData;

   ZL5011X_TRACE(ZL5011X_RTP_FN_ID,
         "zl5011xRtpGetInterruptStatus:",
         0, 0, 0, 0, 0, 0);

   /* read stats reg */
   status = zl5011xRead(zl5011xParams, ZL5011X_RTP_STATS0, &rtpData );

   if (status == ZL5011X_OK)
   {
      /* get context  and flags */
      *pContext= rtpData & ZL5011X_RTP_INTERRUPT_CTXT_MASK;
      *pRollFlags= rtpData & ZL5011X_RTP_ROLLOVER_FLAGS_MASK;

      if (*pContext > zl5011xParams->devLimits.numContexts)
      {
         status = ZL5011X_RTP_INTERRUPT_ERROR;
      }
   }

   if (status == ZL5011X_OK)
   {
      if (zl5011xParams->rtp.rtpSwCounts[*pContext].rxFirstSequenceNumber == (Uint32T)ZL5011X_INVALID)
      {
         zl5011xParams->rtp.rtpSwCounts[*pContext].rxFirstSequenceNumber =
               (rtpData >> ZL5011X_RTP_FIRST_SEQ_NO_BITS) & ZL5011X_RTP_FIRST_SEQ_NO_MASK;

         ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, *pContext,
               "zl5011xRtpGetInterruptStatus: ctxt %3d, first packet seq %04X",
               *pContext, zl5011xParams->rtp.rtpSwCounts[*pContext].rxFirstSequenceNumber, 0, 0, 0, 0);
      }
   }

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, *pContext,
         "zl5011xRtpGetInterruptStatus: ctxt %3d, flags 0x%.8lx",
         *pContext, *pRollFlags, 0, 0, 0, 0);

   return(status);
}

/*******************************************************************************
 Function:
    zl5011xRtpSetInterruptPeriod

 Description:
      This sets the interrupt interval and disables the random distribution
      function.

 Inputs:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆精品久久一二三| 亚洲成人tv网| 亚洲午夜久久久久| 狠狠色丁香久久婷婷综合丁香| www.日韩在线| 欧美不卡激情三级在线观看| 亚洲女同女同女同女同女同69| 蜜臀av一区二区三区| 欧美日韩一区精品| 国产精品久久久久久亚洲伦| 黄一区二区三区| 3d动漫精品啪啪一区二区竹菊 | 成人午夜视频福利| 777久久久精品| 一区二区三区在线不卡| 国产精品正在播放| 日韩美女主播在线视频一区二区三区| 亚洲欧洲日韩av| www.日韩在线| 国产精品电影一区二区三区| 国产精品1区2区3区在线观看| 69久久夜色精品国产69蝌蚪网| 亚洲柠檬福利资源导航| 成人动漫精品一区二区| 欧美国产激情一区二区三区蜜月| 奇米影视一区二区三区| 91麻豆精品国产91久久久久久久久| 亚洲综合激情网| 色婷婷综合久久久中文一区二区| 国产精品系列在线| 成人免费视频国产在线观看| 国产拍欧美日韩视频二区| 国产自产视频一区二区三区| 精品免费99久久| 国模一区二区三区白浆| 精品日韩在线一区| 精品影视av免费| 久久蜜臀精品av| 豆国产96在线|亚洲| 中国av一区二区三区| 粉嫩在线一区二区三区视频| 国产精品国产馆在线真实露脸 | 国产精品久久精品日日| 成人午夜又粗又硬又大| 亚洲情趣在线观看| 欧美在线观看视频一区二区 | 欧美三片在线视频观看| 五月激情六月综合| 亚洲精品在线一区二区| 国产成人精品综合在线观看| 欧美国产日韩在线观看| 在线观看国产日韩| 日韩中文字幕不卡| 欧美va天堂va视频va在线| 国产成人av电影| 亚洲少妇30p| 欧美另类变人与禽xxxxx| 日韩高清在线一区| 久久亚区不卡日本| 不卡欧美aaaaa| 亚洲二区在线观看| 欧美成人精品高清在线播放 | 亚洲日本护士毛茸茸| 欧美亚洲一区二区三区四区| 久久福利资源站| 亚洲伦理在线免费看| 日韩小视频在线观看专区| 成人天堂资源www在线| 亚洲国产一区视频| 久久精品欧美日韩| 精品1区2区3区| 国产成人三级在线观看| 亚洲国产综合色| 久久久久99精品国产片| 欧美色图第一页| 国产成人av电影在线播放| 香蕉久久夜色精品国产使用方法 | 国产精品亚洲一区二区三区妖精| 亚洲精品一卡二卡| 欧美精品一区二区三区一线天视频 | 99久久精品国产观看| 免费成人在线观看| 中文字幕在线视频一区| 69p69国产精品| 色婷婷亚洲婷婷| 国产九色sp调教91| 日韩av在线播放中文字幕| 亚洲视频中文字幕| 国产精品无码永久免费888| 日韩一二在线观看| 欧美亚洲国产怡红院影院| 国产福利不卡视频| 久久99蜜桃精品| 日韩成人一区二区三区在线观看| 亚洲色图欧洲色图| 国产免费观看久久| 精品免费视频.| 欧美一级在线观看| 色婷婷综合久久久久中文 | 日韩精品一级二级| 亚洲欧洲成人自拍| 日本一区二区三区国色天香 | 狂野欧美性猛交blacked| 亚洲成av人影院在线观看网| 综合欧美亚洲日本| 国产精品福利电影一区二区三区四区| 国产亚洲午夜高清国产拍精品| 日韩免费性生活视频播放| 欧美理论片在线| 精品视频1区2区| 欧美精品亚洲二区| 欧美片在线播放| 欧美精品乱码久久久久久| 欧美中文字幕一区| 精品视频1区2区3区| 欧美三级视频在线播放| 欧美欧美欧美欧美| 在线91免费看| 欧美一级午夜免费电影| 日韩一区二区三区精品视频| 欧美一区二区在线看| 欧美va日韩va| 久久久高清一区二区三区| 国产欧美1区2区3区| 国产亚洲欧美色| 中文字幕亚洲电影| 亚洲精品va在线观看| 亚洲国产精品久久久男人的天堂 | 91精品国产色综合久久不卡蜜臀| 日韩欧美中文字幕精品| 久久久天堂av| 亚洲图片欧美激情| 亚洲成a天堂v人片| 久久精品99国产国产精| 国产盗摄一区二区三区| 99国产精品国产精品毛片| 欧美体内she精视频| 日韩美女视频在线| 国产精品伦一区| 亚洲一卡二卡三卡四卡五卡| 蜜桃视频在线观看一区| 高清国产午夜精品久久久久久| 91久久免费观看| 亚洲精品一区二区三区四区高清 | 久久亚区不卡日本| 中文字幕佐山爱一区二区免费| 夜夜揉揉日日人人青青一国产精品| 丝袜亚洲精品中文字幕一区| 国产永久精品大片wwwapp| 日本韩国欧美一区| 日韩色视频在线观看| 国产精品久久久久久久久免费樱桃| 亚洲高清不卡在线| 国产福利精品一区二区| 欧美日韩国产三级| 中文字幕不卡一区| 全国精品久久少妇| va亚洲va日韩不卡在线观看| 91精品国产色综合久久不卡蜜臀 | 99视频一区二区| 91精品国产综合久久精品图片| 欧美国产成人在线| 蜜臀av性久久久久av蜜臀妖精| 91丨porny丨首页| 精品乱码亚洲一区二区不卡| 亚洲靠逼com| 国产成人无遮挡在线视频| 91精品综合久久久久久| 亚洲三级在线观看| 国产成人啪免费观看软件| 91精品福利在线一区二区三区| 亚洲欧洲av色图| 国产成人亚洲综合a∨猫咪| 这里只有精品视频在线观看| 亚洲日本va午夜在线电影| 国产一区欧美日韩| 欧美一区三区四区| 亚洲一区二区三区爽爽爽爽爽| av高清久久久| 欧美激情一区二区三区全黄| 美女高潮久久久| 欧美日韩欧美一区二区| 亚洲丝袜精品丝袜在线| 国产激情视频一区二区三区欧美| 欧美一区午夜精品| 男女性色大片免费观看一区二区| 欧美性色aⅴ视频一区日韩精品| 久久久国产午夜精品| 国产精品伊人色| 久久夜色精品国产欧美乱极品| 蜜臂av日日欢夜夜爽一区| 精品视频色一区| 天堂影院一区二区| 制服.丝袜.亚洲.另类.中文| 亚洲成人动漫在线免费观看| 欧美色图天堂网| 亚洲成av人片在线观看无码| 91国产免费观看| 亚洲一区二区三区国产| 欧美三级乱人伦电影|