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

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

?? zl5011xrtp.c

?? Zalink50114----TDMoIP芯片驅動源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, context,
         "zl5011xRtpUpdateStatistics: ctxt %d, flags %08X",
         context, rollOverFlags, 0, 0, 0, 0);

   /* Update s/w counters */
   if (status == ZL5011X_OK)
   {
      if ((rollOverFlags & ZL5011X_RTP_TX_BYTE_ROLLOVER_MASK) != 0)
      {
         zl5011xParams->rtp.rtpSwCounts[context].txByteCount += ZL5011X_RTP_TX_BYTE_CARRY_MASK;
      }

      if ((rollOverFlags & ZL5011X_RTP_TX_PACKET_ROLLOVER_MASK) != 0)
      {
         zl5011xParams->rtp.rtpSwCounts[context].txPacketCount += ZL5011X_RTP_TX_PACKET_CARRY_MASK;
      }

      if ((rollOverFlags & ZL5011X_RTP_RX_PACKET_ROLLOVER_MASK) != 0)
      {
         zl5011xParams->rtp.rtpSwCounts[context].rxPacketCount += ZL5011X_RTP_RX_PACKET_CARRY_MASK;
      }

      if ((rollOverFlags & ZL5011X_RTP_RX_SEQ_NUM_ROLLOVER_MASK) != 0)
      {
         zl5011xParams->rtp.rtpSwCounts[context].rxSequenceNumber += ZL5011X_RTP_SEQ_NUM_CARRY_MASK;
      }
   }

   return status;
}

/*******************************************************************************
 Function:
    zl5011xRtpReadCounters

 Description:
   Reads the statistics counters from the RTP block. The high order bits
   are maintained by software using an interrupt. To ensure consistency of the
   data due to this, the read sequence is as follows:
      1) disable interrupts
      2) read counters from the device
      3) check the interrupt status. If an interrupt is pending then update the
         counters for that context.
      4) If an interrupt occurred and it was for the context under inspection,
         then re-read the counters from the device.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   context        Context for which counts are to be collected

 Outputs:
   counts         array of words to represent the statistics table
                  locations from the device

 Returns:
  zlStatusE

 Remarks:
   None

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

extern zlStatusE  zl5011xRtpReadCounters(zl5011xParamsS *zl5011xParams, Uint32T context,
      Uint32T *counts)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T statsAddress;
   Uint32T intContext, rollOverFlags;
   Uint32T loop;
   Uint32T interruptStatus;

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, context,
         "zl5011xRtpReadCounters: ctxt %d",
         context, 0, 0, 0, 0, 0);

   /* Get statistics address for context */
   if (status == ZL5011X_OK)
   {
      status = zl5011xRtpGetStatisticsAddress(zl5011xParams, context,
            &statsAddress);
   }

   for (loop = 0; loop < (ZL5011X_RTP_STATS_SIZE / sizeof(Uint32T)); loop++)
   {
      /* read the stats words from the device */
      if (status != ZL5011X_OK)
      {
         break;
      }

      status = zl5011xRead(zl5011xParams, statsAddress + (loop * sizeof(Uint32T)), counts + loop);
   }

   if (status == ZL5011X_OK)
   {
      status = zl5011xAdmGetInterruptStatus(zl5011xParams, &interruptStatus);
   }

   if (status == ZL5011X_OK)
   {
      /* check if an RTP interrupt is pending */
      if ((interruptStatus & (ZL5011X_1BIT_MASK << ZL5011X_ADM_RTP_STATS_INTERRUPT))
                                                                           != 0)
      {
         /* since the interrupt is pending, find out which context it is for */
         status = zl5011xRtpGetInterruptStatus(zl5011xParams, &intContext,
               &rollOverFlags);

         if (status == ZL5011X_OK)
         {
            status = zl5011xRtpUpdateStatistics(zl5011xParams,
                  intContext, rollOverFlags);

            /* if the update was successful, then clear the interrupt source.
               Otherwise leave the interrupt enabled, so that the ISR can do the
               interrogation again and then log the error */
            if (status == ZL5011X_OK)
            {
               /* ignore the return from the clear interrupt function */
               (void)zl5011xAdmClearInterruptSource(zl5011xParams,
                              ZL5011X_1BIT_MASK << ZL5011X_ADM_RTP_STATS_INTERRUPT);

               /* if the pending interrupt is for the current context, then
                  will have to read the counts from the device again */
               if (context == intContext)
               {
                  for (loop = 0; loop < (ZL5011X_RTP_STATS_SIZE /sizeof(Uint32T));
                                                                        loop++)
                  {
                     /* read the stats words from the device */
                     if (status != ZL5011X_OK)
                     {
                        break;
                     }

                     status = zl5011xRead(zl5011xParams,
                                       statsAddress + (loop * sizeof(Uint32T)),
                                       counts + loop);
                  }
               }
            }
            else
            {
               /* if the update statistics failed, then ignore the error code, since
                  the interrupt will log this failure later on. */
               status = ZL5011X_OK;
            }

         }
         else
         {
            /* if there was an error reading from the interrupt queue, then leave
               the interrupt set and continue on with this function.
               The ISR can do the interrogation again and then log the error */
            status = ZL5011X_OK;
         }
      }
   }

   return status;
}

/*******************************************************************************
 Function:
    zl5011xRtpGetStatistics

 Description:
   Returns the RTP statistics for the context, using the low order bits from
   the device and the high order bits from a s/w count held in the device
   structure.

 Inputs:
   zl5011xParams   Pointer to the structure for this device instance
   context        selected context
   mode           collect statistics Rx, Tx or both

 Outputs:
   stats          structure used to return the stats to the calling function
                  Rx stats are :
                              rxFirstSequenceNumber, rxPacketCount,
                              rxSequenceNumber, interArrivalJitter
                  Tx stats are :
                              txByteCount, txPacketCount,

 Returns:
  zlStatusE

 Remarks:
   The RTP interrupt must be enabled for the high order bits of the counts to
   be maintained by s/w.

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

extern zlStatusE  zl5011xRtpGetStatistics(zl5011xParamsS *zl5011xParams, Uint32T context,
      zl5011xGetRtpStatsModeE mode, zl5011xRtpStatsS *stats)
{
   zlStatusE status = ZL5011X_OK;
   zl5011xBooleanE disabledInts = ZL5011X_FALSE;
   Uint32T readValue[ZL5011X_RTP_STATS_SIZE / sizeof(Uint32T)];

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, context,
         "zl5011xRtpGetStatistics: ctxt %d, mode %d",
         context, mode, 0, 0, 0, 0);

   status = ZL5011X_CHECK_GET_RTP_STATS_MODE(mode);

   /* Disable interrupts */
   if (status == ZL5011X_OK)
   {
      status = zl5011xHostInterruptDisable();

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

   /* Get statistics counts from the device for the context */
   if (status == ZL5011X_OK)
   {
      status = zl5011xRtpReadCounters(zl5011xParams, context, readValue);
   }

   /* Calculate statistics using the s/w counts and device counts */
   if (status == ZL5011X_OK)
   {
      if ((mode == ZL5011X_RTP_GET_RX_TX_STATS) || (mode == ZL5011X_RTP_GET_TX_STATS))
      {
         /* construct the stats values from the device data */
         stats->txByteCount = zl5011xParams->rtp.rtpSwCounts[context].txByteCount |
               (readValue[ZL5011X_RTP_TX_BYTE_COUNT_INDEX] &
               (ZL5011X_RTP_TX_BYTE_CARRY_MASK | ZL5011X_RTP_TX_BYTE_COUNT_MASK));

         stats->txPacketCount = zl5011xParams->rtp.rtpSwCounts[context].txPacketCount |
               (readValue[ZL5011X_RTP_TX_PACKET_COUNT_INDEX] &
               (ZL5011X_RTP_TX_PACKET_CARRY_MASK | ZL5011X_RTP_TX_PACKET_COUNT_MASK));
      }

      if ((mode == ZL5011X_RTP_GET_RX_TX_STATS) || (mode == ZL5011X_RTP_GET_RX_STATS))
      {
         stats->rxFirstSequenceNumber = zl5011xParams->rtp.rtpSwCounts[context].rxFirstSequenceNumber;

         /* construct the stats values from the device data */
         stats->rxPacketCount = zl5011xParams->rtp.rtpSwCounts[context].rxPacketCount |
               (readValue[ZL5011X_RTP_RX_PACKET_COUNT_INDEX] &
               (ZL5011X_RTP_RX_PACKET_CARRY_MASK | ZL5011X_RTP_RX_PACKET_COUNT_MASK));

         stats->rxSequenceNumber = zl5011xParams->rtp.rtpSwCounts[context].rxSequenceNumber |
               (readValue[ZL5011X_RTP_RX_SEQ_NUM_INDEX] &
               (ZL5011X_RTP_SEQ_NUM_CARRY_MASK | ZL5011X_RTP_SEQ_NUM_MASK));

         stats->interArrivalJitter = (readValue[ZL5011X_RTP_RX_SEQ_NUM_INDEX] >> ZL5011X_RTP_RX_JITTER_BITS)
               & ZL5011X_RTP_RX_JITTER_MASK;
      }
   }

   /* Enable interrupts */
   if (disabledInts == ZL5011X_TRUE)
   {
      status = zl5011xHostInterruptEnable();
   }

   return status;

}

/*******************************************************************************
 Function:
    zl5011xRtpGetHeaderAddress

 Description:
   Gets the start address of the RTP header.

 Inputs:
    zl5011xParams        Pointer to the structure for this device instance
    context             Selected context
    primaryOrSecondary  Get the address of the ZL5011X_PRIMARY_HEADER or
                        the ZL5011X_SECONDARY_HEADER header

 Outputs:
   pAddress             Start address of the header

 Returns:
   zlStatusE

 Remarks:
   None

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

extern zlStatusE zl5011xRtpGetHeaderAddress(zl5011xParamsS *zl5011xParams,
      Uint32T context,
      zl5011xContextHeaderSwitchE primaryOrSecondary,
      Uint32T *pAddress)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, context,
         "zl5011xRtpGetHeaderAddress: ctxt %3d, header %d",
         context, primaryOrSecondary, 0, 0, 0, 0);

   /* the primary headers are arranged one after the other from the base
      address for the headers. i.e. header(n) base = base + (n * header size) */
   *pAddress = zl5011xParams->rtp.rtpTxHeaderBaseAddress + (context * ZL5011X_RTP_HEADER_SIZE);

   /* if using the secondary header, then these are located after the
      primary headers in the memory map. So add in an offset for the total
      header size */
   if (primaryOrSecondary == ZL5011X_SECONDARY_HEADER)
   {
      *pAddress += ZL5011X_RTP_SHADOW_HEADER_OFFSET;
   }

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, context,
         "zl5011xRtpGetHeaderAddress: ctxt %3d, header %d, addr 0x%08X",
         context, primaryOrSecondary, *pAddress, 0, 0, 0);

   return status;
}

/*******************************************************************************
 Function:
    zl5011xRtpGetStatisticsAddress

 Description:
   Gets the base address of the statistics for the given context.

 Inputs:
   zl5011xParams    Pointer to the structure for this device instance
   context         Selected context

 Outputs:
   address   The base address of the statistics data base held
                            within external memory.

 Returns:
  zlStatusE

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

extern zlStatusE  zl5011xRtpGetStatisticsAddress(zl5011xParamsS *zl5011xParams,
      Uint32T context, Uint32T *address)
{
   zlStatusE status = ZL5011X_OK;

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, context,
         "zl5011xRtpGetStatisticsAddress: ctxt %d",
         context, 0, 0, 0, 0, 0);

   *address = zl5011xParams -> rtp.rtpStatsBaseAddress + (context * ZL5011X_RTP_STATS_SIZE);

   return status;
}

/*******************************************************************************
 Function:
    zl5011xRtpGetTxSeqNum

 Description:
      Returns the sequence number from the currently active RTP Tx header.
      This is the sequence number used for the last Tx packet.

 Inputs:
   zl5011xParams      pointer to the structure for this device instance
   context           selected context
   activeHeader      the header to fetch the sequence number from

 Outputs:
   seqNum            sequence number from the RTP Tx header as used for the
                     last Tx packet

 Returns:
   zlStatusE

 Remarks:
   None

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

extern zlStatusE zl5011xRtpGetTxSeqNum(zl5011xParamsS *zl5011xParams,
      Uint32T context, Uint16T *pSeqNum, zl5011xContextHeaderSwitchE activeHeader)
{
   zlStatusE status = ZL5011X_OK;
   Uint32T seqAddress;
   Uint32T position= 0;
   Uint32T shiftTemp = 0;
   Uint32T rtpData;
   Uint16T temp;

   ZL5011X_TRACE_CONTEXT(ZL5011X_RTP_FN_ID, context, "zl5011xRtpGetTxSeqNum: ctxt %3d, ",
              context, 0, 0, 0, 0, 0);

   /* get sequence number if enabled */
   if ( zl5011xParams->packetIf.packetTx.txHeader[context].highHeader[activeHeader].layer5SequenceNumEnable == ZL5011X_TRUE)
   {
      /* Get the active header address for this context */
      status = zl5011xRtpGetHeaderAddress(zl5011xParams, context, activeHeader, &seqAddress);

      if (status == ZL5011X_OK)
      {
         /* get the position of the sequence number in the header */
         position = zl5011xParams->packetIf.packetTx.txHeader[context].highHeader[activeHeader].layer5SequenceNumPos;

         /* mask off the bottom bits of the position, to get the address of a 32-bit word */
         seqAddress += position & ~ ZL5011X_2BIT_MASK;

         /* read 32-bit word containing sequence number */
         status = zl5011xRead(zl5011xParams, seqAddress, &rtpData);
      }

      if (status == ZL5011X_OK)
      {
         /* Determine the shift required within the word */
         shiftTemp = (position & ZL5011X_2BIT_MASK) * 8;

         temp = (Uint16T)((rtpData >> shiftTemp) & ZL5011X_8BIT_MASK);

         if (zl5011xParams->packetIf.packetTx.txHeader[context].highHeader[activeHeader].layer5SequenceNum16bit == ZL5011X_TRUE)
         {
            /* extract another byte for 16 bit sequence numbers */
            temp = (Uint16T)((rtpData >> (shiftTemp + 8)) & ZL5011X_8BIT_MASK) | (temp << 8);
         }

         *pSeqNum = temp;

         ZL5011X_TRACE(ZL5011X_RTP_FN_ID, "zl5011xRtpGetTxSeqNum: ctxt %3d, seq num 0x%.4X ",
              context, *pSeqNum, 0, 0, 0, 0);
      }
   }
   else  /* Seq num not enabled */
   {
      *pSeqNum = 0;
      status = ZL5011X_PKT_INCOMPATIBLE_HEADER_ERROR;

      ZL5011X_TRACE(ZL5011X_RTP_FN_ID, "zl5011xRtpGetTxSeqNum: ctxt %3d, seq num not enabled",
              context, 0, 0, 0, 0, 0);
   }

   return status;
}

/*****************   END   ****************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产人成亚洲区| 欧美在线色视频| 色一区在线观看| 7777精品伊人久久久大香线蕉超级流畅| 精品国产乱码久久久久久浪潮| 亚洲乱码国产乱码精品精可以看| 久久精品国产成人一区二区三区 | 亚洲国产婷婷综合在线精品| 韩国欧美国产一区| 欧美日韩成人在线| 洋洋av久久久久久久一区| 国产精品一二三四| 欧美精品日日鲁夜夜添| 亚洲精品国产无天堂网2021 | 欧美变态口味重另类| 一区二区三区在线视频观看58| 国产精品综合网| 欧美精品电影在线播放| 亚洲婷婷在线视频| 国产一区二区不卡| 欧美一级高清大全免费观看| 亚洲图片有声小说| 91久久精品一区二区三| 亚洲欧洲日韩女同| 成人午夜视频网站| 国产三级精品在线| 国产91丝袜在线观看| 欧美精品一区二区蜜臀亚洲| 看电视剧不卡顿的网站| 日韩一级完整毛片| 美日韩一级片在线观看| 欧美一区二区日韩一区二区| 日一区二区三区| 欧美一区国产二区| 麻豆91在线播放免费| 日韩一区二区视频| 久久成人18免费观看| 欧美成人aa大片| 韩国精品久久久| 国产日韩欧美精品综合| 国产精品99精品久久免费| 久久天堂av综合合色蜜桃网| 国产成人在线视频播放| 欧美国产一区视频在线观看| 国产91精品精华液一区二区三区 | 亚洲午夜羞羞片| 欧美疯狂做受xxxx富婆| 另类小说图片综合网| 久久日韩粉嫩一区二区三区| 成人黄色av网站在线| 一区二区三区在线视频免费 | 亚洲r级在线视频| 884aa四虎影成人精品一区| 麻豆精品视频在线观看视频| 国产日产欧产精品推荐色| 99riav久久精品riav| 亚洲狠狠爱一区二区三区| 欧美日韩电影在线| 秋霞av亚洲一区二区三| 欧美xxx久久| 亚洲成人久久影院| 久久久美女毛片| 成人少妇影院yyyy| 亚洲婷婷综合色高清在线| 欧美午夜影院一区| 麻豆成人免费电影| 国产午夜一区二区三区| 波多野结衣亚洲一区| 自拍偷拍国产精品| 色中色一区二区| 精品一区二区免费视频| 国产日本亚洲高清| 91久久线看在观草草青青| 亚洲chinese男男1069| 欧美性猛交xxxxxx富婆| 国产一区二区三区视频在线播放| 国产三级一区二区| 日本精品一区二区三区四区的功能| 亚洲午夜视频在线观看| 日韩三级在线免费观看| 成人avav在线| 蜜桃视频第一区免费观看| 日韩视频在线永久播放| 夫妻av一区二区| 亚洲成人一区二区| 26uuu色噜噜精品一区| 99re6这里只有精品视频在线观看| 亚洲男同性恋视频| 精品免费日韩av| 91丨九色丨蝌蚪丨老版| 蜜臀av国产精品久久久久| 久久这里只有精品视频网| 在线影视一区二区三区| 国产乱人伦偷精品视频免下载| 最好看的中文字幕久久| 欧美大片顶级少妇| 91成人国产精品| 国产精品白丝jk黑袜喷水| 亚洲一区二区中文在线| 久久精品亚洲精品国产欧美| 91麻豆国产自产在线观看| 福利电影一区二区| 免费观看成人鲁鲁鲁鲁鲁视频| 亚洲欧洲精品成人久久奇米网| 91精品国产高清一区二区三区蜜臀| 国产成人av资源| 日本人妖一区二区| 亚洲色图欧洲色图婷婷| 国产亚洲一二三区| 日韩精品中文字幕在线不卡尤物| 欧美军同video69gay| 色菇凉天天综合网| 粉嫩13p一区二区三区| 美国毛片一区二区| 偷窥少妇高潮呻吟av久久免费| 亚洲欧美综合色| 国产午夜亚洲精品不卡| 日韩欧美一二区| 91在线观看高清| 欧美性大战久久| 一本大道久久a久久精品综合| 国产精品资源在线观看| 老鸭窝一区二区久久精品| 香蕉成人伊视频在线观看| 亚洲色图丝袜美腿| 1区2区3区国产精品| 国产精品久久久久一区| 国产精品素人一区二区| 国产亚洲欧洲997久久综合 | 精品久久久久一区二区国产| 精品蜜桃在线看| 精品乱人伦小说| 久久视频一区二区| 久久久.com| 久久久五月婷婷| 国产日韩欧美综合一区| 国产精品人人做人人爽人人添| 精品国产免费一区二区三区四区| 久久综合久久99| 久久久av毛片精品| 国产精品色在线观看| 中文字幕在线观看一区| 亚洲欧美日韩精品久久久久| 一区二区欧美精品| 亚州成人在线电影| 性做久久久久久免费观看欧美| 精品一区二区综合| 国产99精品国产| 99久久99久久精品国产片果冻| 色成年激情久久综合| 日韩一级二级三级精品视频| 欧美v日韩v国产v| 国产日本欧洲亚洲| 日韩av不卡一区二区| 精品制服美女久久| 成人深夜视频在线观看| 91丨porny丨户外露出| 欧美日本在线看| 欧美mv和日韩mv的网站| 久久久五月婷婷| 日韩高清不卡一区二区| 韩国视频一区二区| 色综合久久中文综合久久牛| 欧美日本在线一区| 国产日韩av一区二区| 亚洲国产一区二区三区| 久久国产精品一区二区| 91精品福利视频| 日韩免费高清视频| 亚洲色图欧洲色图婷婷| 首页国产欧美日韩丝袜| 成人国产电影网| 91精品在线观看入口| 国产精品视频yy9299一区| 日日夜夜精品视频天天综合网| 韩国欧美国产1区| 欧美亚洲国产一区在线观看网站| 欧美一区二区三级| 亚洲欧美偷拍三级| 国产麻豆成人精品| 欧美日韩久久久久久| 欧美激情在线一区二区| 视频一区二区中文字幕| 成人在线综合网站| 日韩一二三区不卡| 亚洲欧洲制服丝袜| 国产 日韩 欧美大片| 欧美一区二区三区啪啪| 亚洲欧美日韩成人高清在线一区| 久久精品理论片| 欧美日本国产视频| 亚洲欧洲日韩女同| 国产98色在线|日韩| 久久综合久久综合亚洲| 五月天激情小说综合| 成人一区二区在线观看| 欧美国产欧美综合| 国产在线播放一区三区四| 777a∨成人精品桃花网| 一区二区三区在线观看视频|