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

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

?? csend.c

?? CS8900的Vxworks驅(qū)動(dòng)源代碼 1.0
?? C
?? 第 1 頁 / 共 5 頁
字號:
      {
          /* Reset the threshold counter */
          pCS->TxUnderruns = 0;
          
          /* Select the next TxStartCommand */ 
          if( pCS->TxStartCMD == TX_CMD_START_5 )
             pCS->TxStartCMD = TX_CMD_START_381;

          else if( pCS->TxStartCMD == TX_CMD_START_381 )
            pCS->TxStartCMD = TX_CMD_START_1021;

          else pCS->TxStartCMD = TX_CMD_START_ALL;
      }
	  
      /* Try to TX the frame again */
      if ( pCS->InMemoryMode )
      {
            csWritePacketPage( pCS, PKTPG_TX_CMD, pCS->TxStartCMD );
            csWritePacketPage( pCS, PKTPG_TX_LENGTH, BYTE_SWAP(pCS->TxLength) );
      }
      else  /* In IO mode */
      {
            SYS_ENET_OUT_WORD( (pCS->IOAddr)+PORT_TX_CMD, pCS->TxStartCMD );
            SYS_ENET_OUT_WORD( (pCS->IOAddr)+PORT_TX_LENGTH, 
            BYTE_SWAP(pCS->TxLength));
      }

      /* Read BusStatus register which indicates success of the request */
      BusStatus = csReadPacketPage( pCS, PKTPG_BUS_ST );

      if ( BusStatus & BUS_ST_RDY4TXNOW )
      {
           /* On-chip buffer space available -- start transmission */
             csCopyTxFrame( pCS, pCS->pTxFrameChain );
      } 


      pCS->TotalTxUnderruns++;

#ifdef CS_DEBUG_ENABLE
      logMsg("csBufferEvent: CS_END_DEVICE %d, Total Tx underrun=%d\n",
         pCS->unit, pCS->TotalTxUnderruns,0,0,0,0 );
#endif
   }


   else if ( BufEvent & BUF_EVENT_RDY4TX )
   {

      (pCS->Rdy4TxInts) += 1;

      /* The chip is ready for transmission now */

      /* If a TX is pending, copy the frame to the chip to start transmission */
      if( pCS->pTxFrameChain != NULL )
      {
         csCopyTxFrame( pCS, pCS->pTxFrameChain );
      }
   }

}




/*******************************************************************************
*
* csTransmitEvent -
*
* This routine is called whenever the transmission of a packet has completed
* successfully or unsuccessfully.  If the transmission was not successful,
* then the output error count is incremented.  If there are more packets in the
* transmit queue, then the next packet is started immediately.
*
*/

LOCAL void csTransmitEvent( CS_END_DEVICE *pCS, USHORT TxEvent )
{
   /* WE only get here if the transmit in progress has completed, either 
    * successfully or due to an error condition.  In any event, queue the 
    * mbuf chain for freeing at task level and NULL the frame pointer to mark
    * the TX no longer in progress.
    */

   csEnqueue( pCS->pTxBuffFreeList, pCS->pTxFrameChain );
   pCS->pTxFrameChain = NULL;
   pCS->TxInProgress = FALSE;   

   /* If there were any errors transmitting this frame */
   if ( TxEvent & (TX_EVENT_LOSS_CRS | TX_EVENT_SQE_ERR | TX_EVENT_OUT_WIN |
            TX_EVENT_JABBER | TX_EVENT_16_COLL) )
   {
      /* Increment the output error count */
    /* @kml	 The definition of the MIB-II variable ifOutUcastPkts in Interface
	   group from RFC 1158 is "The total  number of  packets that higher-level 
	   protocols requested be transmitted to a subnetwork-unicast address, 
	   INCLUDE those that were discarded or not sent."*/
      END_ERR_ADD (&pCS->end, MIB2_OUT_ERRS, +1);

      /* If debugging is enabled then log error messages */
#ifdef  CS_DEBUG_ENABLE

         if ( TxEvent & TX_EVENT_LOSS_CRS )
         {
            logMsg("csTransmitEvent: CS_END_DEVICE %d, Loss of carrier\n",
               pCS->unit, 0,0,0,0,0 );
         }
         if ( TxEvent & TX_EVENT_SQE_ERR )
         {
            logMsg("csTransmitEvent: CS_END_DEVICE %d, SQE error\n",
               pCS->unit, 0,0,0,0,0 );
         }
         if ( TxEvent & TX_EVENT_OUT_WIN )
         {
            logMsg("csTransmitEvent: CS_END_DEVICE %d, Out-of-window collision\n",
               pCS->unit, 0,0,0,0,0 );
         }
         if ( TxEvent & TX_EVENT_JABBER )
         {
            logMsg("csTransmitEvent: CS_END_DEVICE %d, Jabber\n",
               pCS->unit, 0,0,0,0,0 );
         }
         if ( TxEvent & TX_EVENT_16_COLL )
         {
            logMsg("csTransmitEvent: CS_END_DEVICE %d, 16 collisions\n",
               pCS->unit, 0,0,0,0,0 );
         }
#endif
    }

   /* Previous TX complete so start the next TX now if more to transmit */
   csTxNextFrame( pCS );

}




/*******************************************************************************
*
* csReceiveEvent -
*
* This routine is called whenever a packet is received at the chip.  If the
* packet is received with errors, then the input error count is incremented.
* If the packet is received OK, then the data is copied to an internal receive
* buffer and processed at task level (in csEventHandler). 
*
* RETURNS: Nothing
*/

LOCAL void csReceiveEvent( CS_END_DEVICE *pCS, USHORT RxEvent )
{
   M_BLK_ID         pMblk;
   CL_BLK_ID        pClBlk;
   char *pData;
   int DataLen;

  /* If the frame was not received OK */
   if ( !(RxEvent & RX_EVENT_RX_OK) )
   {

      /* Increment the input error count */
      /*pIf->if_ierrors++;*/
      END_ERR_ADD (&pCS->end, MIB2_IN_ERRS, +1);

      /* If debugging is enabled then log error messages */
#ifdef  CS_DEBUG_ENABLE

         /* If an error bit is set */
         if ( RxEvent != REG_NUM_RX_EVENT )
         {
            if ( RxEvent & RX_EVENT_RUNT )
            {
              logMsg("csReceiveEvent: CS_END_DEVICE %d, Runt\n",
                 pCS->unit, 0,0,0,0,0 );
            }
            if ( RxEvent & RX_EVENT_X_DATA )
            {
              logMsg("csReceiveEvent: CS_END_DEVICE %d, Extra data\n",
                 pCS->unit, 0,0,0,0,0 );
            }
            if ( RxEvent & RX_EVENT_CRC_ERR )
            {
               if ( RxEvent & RX_EVENT_DRIBBLE )
               {
                  logMsg("csReceiveEvent: CS_END_DEVICE %d, Alignment error\n",
                     pCS->unit, 0,0,0,0,0 );
               }
               else
               {
                  logMsg("csReceiveEvent: CS_END_DEVICE %d, CRC Error\n",
                     pCS->unit, 0,0,0,0,0 );
               }
            }
            else if ( RxEvent & RX_EVENT_DRIBBLE )
            {
               logMsg("csReceiveEvent: CS_END_DEVICE %d, Dribble bits\n",
                  pCS->unit, 0,0,0,0,0 );
            }
         }
#endif
      

      /* Skip this error frame */
      csReadPacketPage( pCS, PKTPG_RX_LENGTH );
      csWritePacketPage( pCS, PKTPG_RX_CFG,
                         csReadPacketPage(pCS,PKTPG_RX_CFG) | RX_CFG_SKIP );

      return;
   }

   /* Get a receive frame buffer */
     pData = netClusterGet(pCS->end.pNetPool, pCS->pClPoolId);

    /* Grab a cluster block to marry to the cluster we received. */

    pClBlk = netClBlkGet (pCS->end.pNetPool, M_DONTWAIT);

           
    /*
     * OK we've got a spare, let's get an M_BLK_ID and marry it to the
     * one in the ring.
     */

    pMblk = mBlkGet (pCS->end.pNetPool, M_DONTWAIT, MT_DATA);
 
   if ( pData == NULL || pClBlk == NULL || pMblk == NULL)  /* If no buffer available */
   {
           if (pData) {
        netClFree (pCS->end.pNetPool, pData);
       }

                if (pClBlk) {
        netClBlkFree (pCS->end.pNetPool, pClBlk); 
        }

        if ( pMblk ) {
        netMblkFree (pCS->end.pNetPool, pMblk);
                }

      /* Increment the input error count */
      /*pIf->if_ierrors++;*/
      END_ERR_ADD (&pCS->end, MIB2_IN_ERRS, +1);
 
#ifdef CS_DEBUG_ENABLE
      logMsg("csReceiveEvent(): unit=%d, No receive buffer available!\n",
         pCS->unit, 0,0,0,0,0 );
#endif


      /* Must read the length of all received frames */
      csReadPacketPage( pCS, PKTPG_RX_LENGTH );

      /* Skip the received frame */
      csWritePacketPage( pCS, PKTPG_RX_CFG,
            csReadPacketPage(pCS,PKTPG_RX_CFG) | RX_CFG_SKIP );
      return;
   }


   /* Copy the received frame from the chip to the buffer */
   /* Set offset 2 to the receiving buffer pointer so that the IP heater starts the
      17th bytes for 32-bits alignment*/
   DataLen=csCopyRxFrame( pCS, pData+2);

    /* Join the cluster to the MBlock */

    netClBlkJoin (pClBlk, pData, DataLen, NULL, 0, 0, 0);
    netMblkClJoin (pMblk, pClBlk);

   /* Set offset 2 to the receiving buffer pointer so that the IP heater starts the
      17th bytes for 32-bits alignment*/
    /*pMblk->mBlkHdr.mData += pDrvCtrl->offset;*/
    pMblk->mBlkHdr.mData += 2;
    pMblk->mBlkHdr.mLen = DataLen;
    pMblk->mBlkHdr.mFlags |= M_PKTHDR;
    pMblk->mBlkPktHdr.len = DataLen;

   /* Queue a pointer to the buffer to be processed at task level */
   csEnqueue( pCS->pRxBuffProcessList, pMblk );
}



/*******************************************************************************
* csEventHandler -
*
* This routine runs at the task level to processes RX frames and frees TX'd 
* mbuf chains queued at the ISR level.  Up to two instances of this
* routine may be queued to tNetTask to prevent a race condition between final
* checking of a queue here and an enqueue at the ISR level.  A netJob
* "counter" is decremented each time this routine starts.
*
* RETURNS: Nothing.
*
*/

LOCAL void csEventHandler( CS_END_DEVICE *pCS )
{
   void  *pBuff;

   if( pCS->NetJobDepth > 0 ) 
       pCS->NetJobDepth--;
      
   while( !csQueueEmpty( pCS->pRxBuffProcessList ) )
   {
      /* Process an RX frame */  
      pBuff = csDequeue( pCS->pRxBuffProcessList );
      csProcessReceive( pCS, pBuff ); 
   }

   while( !csQueueEmpty( pCS->pTxBuffFreeList ) )
   {
      /* Free up the TX'd mbuf chains */
      pBuff = csDequeue( pCS->pTxBuffFreeList );    
      netMblkClChainFree (pBuff);
   }
}






/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
 * Transmit-releated Routines                                              *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */



/*******************************************************************************
*
* csStartOutput -
*
* This routine is called to start the transmission of the packet at the head
* of the transmit queue.  This routine is called by the ether_output() routine
* when a new packet is added to the transmit queue. 
*
* RETURNS: Nothing
*
*/

LOCAL void csStartOutput( CS_END_DEVICE *pCS,  M_BLK_ID pMBuf)
{
   BOOL  QError;

   END_TX_SEM_TAKE(&pCS->end, WAIT_FOREVER);
   QError = csEnqueue( pCS->pTxQueue, pMBuf );
   END_TX_SEM_GIVE(&pCS->end);
     
   if ( QError )
   {
      /* TxQueue is full -- dump the frame and exit loop */             
      netMblkClChainFree (pMBuf);
      /* Update output stats */
      END_ERR_ADD (&pCS->end, MIB2_OUT_ERRS, +1);
#ifdef CS_DEBUG_ENABLE
      logMsg("csStartOutput: CS_END_DEVICE %d, Transmit queue overflow\n",
              pCS->unit, 0,0,0,0,0 );
#endif
   }

#ifdef CS_DEBUG_ENABLE
   pCS->TxQueueDepth++;
   if ( pCS->TxQueueDepth > pCS->MaxTxQueueDepth )
             pCS->MaxTxQueueDepth = pCS->TxQueueDepth;
#endif

   /* Update output stats */
   END_ERR_ADD (&pCS->end, MIB2_OUT_UCAST, +1);

   /* Transmit another frame if a TX is not currently in progress */
   if ( !pCS->TxInProgress ) 
   {
      csTxNextFrame( pCS );
   }
}



/*******************************************************************************
* csTxNextFrame -
*
* This routine start the TX of the next frame in the local TX send queue.
* If an error occurs, the output error count is incremented and the mbuf chain
* is freed, either by immediately calling mfree_m() if we are at task level, 
* or queueing the mbuf chain for release at the task level if we are currently
* at the ISR level.
*
* RETURNS: Nothing
*
*/

LOCAL void csTxNextFrame ( CS_END_DEVICE *pCS )
{
USHORT BusStatus;
M_BLK_ID  pMbuf;
int State = 0;

   /* Transmit the next frame in the local TxQueue */
   while( !csQueueEmpty( pCS->pTxQueue ) )
   {
#ifdef CS_DEBUG_ENABLE
      pCS->TxQueueDepth--;
#endif

      if ( !pCS->InISR )
      {
	    /* Ensure the transmit bid and copy to chip is atomic */
	    State = INT_LOCK( );
      }

      pCS->pTxFrameChain = csDequeue( pCS->pTxQueue );
         
      /* Find the total length of the data to transmit */
      pCS->TxLength = 0;
      for ( pMbuf = pCS->pTxFrameChain; pMbuf!=NULL; pMbuf=pMbuf->mBlkHdr.mNext )
      {
         pCS->TxLength += pMbuf->mBlkHdr.mLen;
      }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩女优av电影| 国产欧美日本一区视频| 国产在线不卡一卡二卡三卡四卡| 国产精品天美传媒| 欧美一二三四在线| 色婷婷激情综合| 国产精品一卡二| 奇米精品一区二区三区在线观看| 国产精品久久久久影院亚瑟| 欧美一卡二卡三卡| 在线视频你懂得一区二区三区| 国产成人亚洲综合a∨猫咪| 视频一区视频二区中文| 亚洲精品乱码久久久久久久久 | 99久久精品一区| 激情综合色播激情啊| 日韩激情在线观看| 怡红院av一区二区三区| 中文一区在线播放| 精品国产伦一区二区三区观看体验| 欧洲一区二区三区免费视频| av在线播放一区二区三区| 国产精品一区二区久久精品爱涩 | 国产剧情一区二区| 免费的成人av| 日韩av一二三| 午夜精品久久久久| 亚洲在线观看免费视频| 亚洲精品日韩一| 亚洲欧美色综合| 日韩美女视频一区| 中文字幕一区三区| 中文字幕亚洲在| 国产精品人成在线观看免费| 久久精品夜色噜噜亚洲aⅴ| 精品三级在线观看| 精品日韩99亚洲| 久久久美女毛片| 国产亚洲一区二区三区在线观看| 日韩精品一区二区三区在线观看| 欧美一区二区三区在线观看| 日韩小视频在线观看专区| 91麻豆精品久久久久蜜臀| 欧美日本国产视频| 777午夜精品免费视频| 欧美一区二区三区视频免费播放 | 中文字幕巨乱亚洲| 国产精品丝袜在线| 亚洲婷婷在线视频| 亚洲精品免费看| 亚洲超碰精品一区二区| 三级久久三级久久久| 蜜桃视频一区二区| 国产一区欧美一区| 成人激情免费视频| 在线观看视频一区| 在线不卡欧美精品一区二区三区| 日韩小视频在线观看专区| 久久综合久久99| 国产日韩精品一区二区浪潮av| 国产精品美女久久久久久| 久久精品国产色蜜蜜麻豆| 国产乱码精品一区二区三区av| 不卡一区二区中文字幕| 色噜噜狠狠色综合中国| 制服丝袜中文字幕一区| 精品久久久久99| 国产精品国产三级国产a| 亚洲高清免费一级二级三级| 美女性感视频久久| 成人精品国产福利| 欧美日韩在线播放三区四区| 日韩免费观看2025年上映的电影| 国产午夜一区二区三区| 亚洲男女一区二区三区| 日本美女一区二区| 成人午夜大片免费观看| 精品视频1区2区3区| 久久综合九色综合97婷婷| 中文字幕一区二区三区不卡在线| 无吗不卡中文字幕| 丰满岳乱妇一区二区三区| 欧美亚洲国产一区在线观看网站| 7777精品伊人久久久大香线蕉完整版 | 国产精品一区在线| 91久久人澡人人添人人爽欧美| 日韩一区二区三区高清免费看看| 久久久精品免费观看| 亚洲一区二区精品视频| 国产成人午夜高潮毛片| 欧美浪妇xxxx高跟鞋交| 国产精品欧美一区二区三区| 午夜精品久久久久久久久| 成人午夜在线播放| 亚洲国产日韩精品| 国产高清亚洲一区| 4438x成人网最大色成网站| 国产精品女人毛片| 久久99精品久久只有精品| 91福利国产成人精品照片| 久久久国际精品| 偷窥国产亚洲免费视频| 91亚洲永久精品| 久久久91精品国产一区二区精品 | 国产成人精品一区二区三区四区 | 国产精品私人影院| 久久激情五月婷婷| 精品视频在线看| 亚洲日本护士毛茸茸| 国产乱子伦视频一区二区三区| 欧美人妇做爰xxxⅹ性高电影| 国产精品人妖ts系列视频| 久99久精品视频免费观看| 欧美日韩国产免费一区二区| 最新热久久免费视频| 成人网男人的天堂| 2024国产精品| 久久国产视频网| 日韩欧美你懂的| 日本一不卡视频| 91精品欧美综合在线观看最新 | 亚洲成人自拍一区| 欧美在线|欧美| 伊人夜夜躁av伊人久久| 暴力调教一区二区三区| 欧美激情在线看| 国产精品1区2区| 国产亚洲欧洲一区高清在线观看| 乱中年女人伦av一区二区| 日韩一级在线观看| 奇米精品一区二区三区在线观看| 欧美精品xxxxbbbb| 午夜精品久久久久影视| 欧美日韩极品在线观看一区| 一区二区不卡在线播放| 欧美写真视频网站| 亚洲成人先锋电影| 欧美精品国产精品| 日韩高清不卡一区二区三区| 欧美日韩国产免费一区二区 | 日韩精品每日更新| 欧美一区二区三区啪啪| 久久精品国产精品亚洲综合| 欧美www视频| 国产精品一区免费视频| 国产欧美精品在线观看| aaa欧美日韩| 樱桃视频在线观看一区| 欧美性大战久久久久久久| 午夜精品一区二区三区电影天堂| 91精品综合久久久久久| 久久丁香综合五月国产三级网站| 26uuu亚洲综合色| 成人听书哪个软件好| 亚洲欧美成aⅴ人在线观看| 一本到不卡精品视频在线观看| 亚洲一线二线三线视频| 8v天堂国产在线一区二区| 精品亚洲porn| 亚洲天堂a在线| 欧美剧情电影在线观看完整版免费励志电影| 午夜精品一区二区三区免费视频| 精品欧美久久久| 成人黄色在线网站| 亚洲成在人线免费| 久久亚洲二区三区| 色噜噜狠狠色综合欧洲selulu| 日韩专区一卡二卡| 国产欧美一区二区精品性色| 91麻豆精品一区二区三区| 午夜精品一区二区三区免费视频| 精品国产乱码久久久久久浪潮| 成年人网站91| 日韩成人精品在线观看| 欧美激情综合在线| 欧美日韩精品免费观看视频| 国产乱一区二区| 亚洲小少妇裸体bbw| 久久日一线二线三线suv| 91捆绑美女网站| 经典三级视频一区| 亚洲在线观看免费视频| 久久免费偷拍视频| 精品视频在线视频| 国产99久久久久久免费看农村| 夜夜嗨av一区二区三区网页| 日韩欧美一二三区| 日本高清不卡视频| 国产麻豆日韩欧美久久| 亚洲成精国产精品女| 日本一区二区三区四区| 欧美一区二区三区四区在线观看| 99热99精品| 国产乱码字幕精品高清av| 五月天亚洲婷婷| 亚洲男同性视频| 国产女同互慰高潮91漫画| 欧美一级国产精品| 在线观看日产精品| 成人av免费在线观看|