亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久99精品一区二区三区三区| 亚洲视频在线一区观看| 欧美成人三级在线| 久久久高清一区二区三区| 在线免费观看成人短视频| 成人ar影院免费观看视频| 成人一区二区三区| 日本韩国欧美三级| 精品蜜桃在线看| 日本一二三四高清不卡| 亚洲图片一区二区| 精品一区二区三区视频在线观看| 国产一区二区三区日韩| 成人性生交大片免费| 欧美精品少妇一区二区三区| 欧美一区二区视频免费观看| 久久精品夜色噜噜亚洲a∨| 亚洲色图视频网| 视频一区二区中文字幕| 国产精品自在在线| 亚洲18色成人| 成人免费av在线| 91.麻豆视频| 亚洲精品日韩一| 国产一区不卡精品| 欧美理论片在线| 亚洲另类一区二区| 国产精品一区二区91| 91精品国产综合久久精品麻豆 | 亚洲免费毛片网站| 国产美女av一区二区三区| 欧美日韩中文精品| 国产精品夫妻自拍| 国产盗摄女厕一区二区三区| 欧美成人性福生活免费看| 亚洲一区二区偷拍精品| 成人免费高清视频在线观看| 日韩丝袜美女视频| 秋霞国产午夜精品免费视频| 欧美精品在线观看一区二区| 亚洲一级二级在线| 欧美亚洲图片小说| 视频一区在线视频| 精品日韩欧美在线| 国产丶欧美丶日本不卡视频| 久久亚洲一区二区三区四区| 狠狠久久亚洲欧美| 国产亚洲精品bt天堂精选| 国产jizzjizz一区二区| 亚洲天堂2016| 欧美三级电影一区| 久久不见久久见免费视频7| 日韩欧美中文字幕公布| 狠狠色综合播放一区二区| 精品国产露脸精彩对白| 欧美午夜片在线看| 色综合久久久久网| 色综合久久天天综合网| 成人综合婷婷国产精品久久| 五月婷婷激情综合网| 亚洲线精品一区二区三区| 精品国一区二区三区| 国内精品国产三级国产a久久 | 蜜臀av性久久久久蜜臀aⅴ四虎| 精品国产亚洲在线| 欧美日韩mp4| 精品国产伦一区二区三区免费| 日本乱人伦aⅴ精品| 国产一区二区免费视频| 国产一区二区精品久久91| 亚洲日本一区二区三区| 欧美激情综合五月色丁香小说| 91精品国产综合久久婷婷香蕉 | 久久狠狠亚洲综合| 日韩电影一区二区三区四区| 亚洲精品欧美专区| 亚洲美腿欧美偷拍| 亚洲蜜臀av乱码久久精品| 国产精品国产三级国产aⅴ原创 | 亚洲成av人片在线观看| 久久99精品一区二区三区三区| 国产欧美日韩视频在线观看| 韩国三级在线一区| 欧美一区二区黄| 色综合亚洲欧洲| 成人午夜私人影院| 成人app下载| 91免费精品国自产拍在线不卡| 国产99久久久国产精品潘金| 国产美女av一区二区三区| 国产河南妇女毛片精品久久久| 蜜臂av日日欢夜夜爽一区| 麻豆91免费观看| 韩国v欧美v日本v亚洲v| 风间由美一区二区av101| 大白屁股一区二区视频| 99久久伊人精品| 欧美视频一区二| 国产日韩av一区| 日韩理论片一区二区| 亚洲成人你懂的| 狠狠色丁香婷婷综合| 97se亚洲国产综合自在线观| 欧美日韩在线不卡| 国产亚洲精品aa午夜观看| 亚洲一二三专区| 国产高清精品久久久久| 在线一区二区三区| 精品成人一区二区三区| 亚洲欧美韩国综合色| 日韩一区精品视频| 99久久婷婷国产精品综合| 欧美一区二区在线看| 最新日韩av在线| 国产一区二区三区日韩 | 在线观看www91| 国产喂奶挤奶一区二区三区| 日韩高清中文字幕一区| 91看片淫黄大片一级在线观看| 日韩精品一区二区三区蜜臀| 亚洲国产视频a| 欧洲一区二区av| 亚洲精品国产第一综合99久久 | 欧美在线观看你懂的| 一区二区三区中文在线观看| 免费xxxx性欧美18vr| 精品日韩欧美在线| 色婷婷av一区二区三区之一色屋| 亚洲国产欧美在线人成| 久久蜜桃av一区精品变态类天堂| 波多野结衣亚洲| 一级精品视频在线观看宜春院| 欧美喷水一区二区| 成人av动漫网站| 日本午夜精品视频在线观看| 日韩亚洲国产中文字幕欧美| 精品一区免费av| 国产精品网友自拍| 欧美性一级生活| 国产一区在线看| 亚洲国产综合人成综合网站| 中文字幕av在线一区二区三区| 欧美日韩电影在线播放| 久久99国产精品久久99果冻传媒| 亚洲免费在线视频一区 二区| 精品国产三级电影在线观看| 欧美日韩一区二区三区高清| 成人久久18免费网站麻豆| 丝袜诱惑亚洲看片 | 极品尤物av久久免费看| 亚洲女人小视频在线观看| 这里只有精品电影| 97精品超碰一区二区三区| 久久超碰97中文字幕| 日本欧美加勒比视频| 亚洲国产日韩一区二区| 一区二区三区 在线观看视频 | 欧美一区二区性放荡片| 欧美大片顶级少妇| 中文字幕中文乱码欧美一区二区| 91精品国产综合久久精品app| 日本韩国欧美国产| 日本韩国一区二区| 99久久久久免费精品国产| 菠萝蜜视频在线观看一区| 国产在线视频不卡二| 国产精品一区二区久久不卡| 国产一区二区三区黄视频| 国产精一品亚洲二区在线视频| 亚洲男人的天堂一区二区| 国产99久久久国产精品潘金网站| 成人短视频下载| 日本成人在线视频网站| 免播放器亚洲一区| 91啦中文在线观看| 欧美第一区第二区| 亚洲黄色av一区| 国产成人av一区二区三区在线观看| 成人av午夜电影| 大尺度一区二区| 天堂一区二区在线免费观看| 日韩免费电影网站| 亚洲一二三专区| 日本一区二区不卡视频| 日韩一区二区中文字幕| 国产成人鲁色资源国产91色综| 亚洲精品videosex极品| 国产精品污www在线观看| 欧美日韩和欧美的一区二区| 波多野结衣亚洲一区| 久久精品久久综合| 美女久久久精品| 日韩综合小视频| 午夜精品福利一区二区三区蜜桃| 久久精品免视看| 久久九九久精品国产免费直播| 91精品国产综合久久久蜜臀图片| 在线亚洲欧美专区二区| 色综合天天综合在线视频| 成人国产精品免费观看动漫|