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

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

?? csend.c

?? cs8900在vxworks系統(tǒng)下的驅(qū)動
?? 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欧美精品.com| 成人午夜又粗又硬又大| 国产综合久久久久久久久久久久| 亚洲成av人片一区二区梦乃| 视频一区二区三区在线| 青青草国产成人99久久| 日本亚洲最大的色成网站www| 麻豆精品一区二区三区| 久久精品国产精品青草| 精品综合久久久久久8888| 国产高清成人在线| 成人高清免费在线播放| jlzzjlzz亚洲女人18| 精品91自产拍在线观看一区| 国产成人av影院| 成人91在线观看| 欧美午夜精品久久久久久孕妇 | 99re这里都是精品| 在线观看日产精品| 欧美国产日韩在线观看| 亚洲国产精品人人做人人爽| 高清免费成人av| 日韩欧美久久一区| 亚洲第一成年网| 成人午夜视频在线观看| 欧美一级高清片在线观看| 椎名由奈av一区二区三区| 成人激情综合网站| 久久av资源网| 国产精品综合视频| www.亚洲色图| 91麻豆精品国产无毒不卡在线观看| 久久精品人人做人人综合 | 亚洲免费av网站| 亚洲曰韩产成在线| 丁香五精品蜜臀久久久久99网站 | 不卡的av中国片| 欧美日韩亚洲综合一区| 久久久久久久久蜜桃| 免费精品视频在线| 欧美丰满一区二区免费视频| 国产精品女人毛片| 国产成人精品免费视频网站| 在线综合视频播放| 视频精品一区二区| 91精品一区二区三区久久久久久| 一区二区三区国产精华| 欧美日韩你懂得| 亚洲动漫第一页| 精品伦理精品一区| 9人人澡人人爽人人精品| 亚洲日本青草视频在线怡红院| av电影天堂一区二区在线观看| 亚洲欧美日本在线| 欧美日韩一区国产| 久久99国产精品久久| 91精品国产高清一区二区三区| 久久精品国产免费看久久精品| 精品三级在线观看| 成人伦理片在线| 一区二区三区四区国产精品| 日韩一区二区三区观看| 国产伦精品一区二区三区免费迷 | 中文字幕乱码一区二区免费| 91国内精品野花午夜精品| 日韩和的一区二区| 亚洲色图欧美偷拍| 91精品中文字幕一区二区三区| 国产美女av一区二区三区| 婷婷国产在线综合| 亚洲视频一区二区在线| 精品成人私密视频| 欧洲亚洲国产日韩| 国内精品嫩模私拍在线| 亚洲一区二区视频在线观看| 国产日韩影视精品| 欧美sm极限捆绑bd| 91麻豆精品国产综合久久久久久| 97成人超碰视| 懂色一区二区三区免费观看| 美国三级日本三级久久99| 国产在线乱码一区二区三区| 麻豆视频一区二区| 国产乱码精品一区二区三区av| 久久精品国内一区二区三区| 天堂一区二区在线| 中文字幕亚洲一区二区av在线 | 欧美—级在线免费片| 精品1区2区在线观看| 日韩一区二区免费电影| 欧美区在线观看| 欧美日韩一区二区三区高清| 欧美亚洲自拍偷拍| 欧美日韩免费一区二区三区| 欧美丝袜丝交足nylons| 欧美日韩午夜在线视频| 欧美挠脚心视频网站| 在线播放/欧美激情| 日韩一区二区在线观看| 久久综合久久综合九色| 精品久久久三级丝袜| 国产精品丝袜一区| 丝袜美腿亚洲色图| 91在线国产观看| 在线观看91精品国产麻豆| 精品国产乱子伦一区| 亚洲精品一区二区三区香蕉| 国产亚洲成aⅴ人片在线观看| 久久精品一级爱片| 一区二区免费在线| 国产在线一区二区综合免费视频| 99精品久久只有精品| 欧美一区二区三区播放老司机| 欧美国产视频在线| 五月婷婷激情综合| 成人涩涩免费视频| 久久久亚洲午夜电影| 毛片不卡一区二区| 欧美精品1区2区3区| 中文字幕日本不卡| 国产精品羞羞答答xxdd| 91精品国产全国免费观看| 亚洲色图在线看| av亚洲精华国产精华精华| 欧美电影免费观看完整版| 一区二区在线观看免费视频播放| 99久久久久免费精品国产| 久久综合资源网| 欧美aaaaaa午夜精品| 91在线观看视频| 中文字幕精品一区二区三区精品| 老司机免费视频一区二区 | 欧美一个色资源| 经典三级在线一区| 久久一区二区视频| va亚洲va日韩不卡在线观看| 久久久国产精品麻豆| 国产成人免费高清| 亚洲日本在线看| 欧美蜜桃一区二区三区| 免费看日韩精品| 国产欧美精品国产国产专区| 国产精品66部| 亚洲一区二区在线播放相泽| 精品国产自在久精品国产| 懂色av中文字幕一区二区三区 | 国产一区福利在线| 国产精品毛片无遮挡高清| 99国产精品久久久久久久久久| 亚洲精品免费在线观看| 欧美精品在线观看一区二区| 成a人片国产精品| 开心九九激情九九欧美日韩精美视频电影 | 国产午夜亚洲精品午夜鲁丝片| 99久久99久久精品免费看蜜桃| 国产欧美日韩三区| 欧美日韩亚洲综合在线| 成人av在线播放网站| 麻豆精品视频在线| 曰韩精品一区二区| 国产精品欧美综合在线| 欧美老年两性高潮| 欧美性一二三区| 色先锋久久av资源部| 国产精品99久久久久久宅男| 一区二区三区精品| 国产精品久久久久久久久快鸭| 91精品国产黑色紧身裤美女| 91丨九色porny丨蝌蚪| 国内不卡的二区三区中文字幕| 午夜欧美在线一二页| 亚洲国产精品自拍| 天天影视色香欲综合网老头| 亚洲免费视频中文字幕| 精品成人a区在线观看| 成a人片亚洲日本久久| 日本美女视频一区二区| 国产精品区一区二区三| 日韩欧美高清dvd碟片| 91丝袜高跟美女视频| 麻豆国产一区二区| 久久99精品视频| 精品一二三四区| 久久99热这里只有精品| 日本vs亚洲vs韩国一区三区二区| **欧美大码日韩| 亚洲欧美区自拍先锋| 午夜精品久久久久| 婷婷成人激情在线网| 激情综合亚洲精品| 99久久久无码国产精品| 精品国产一区二区国模嫣然| 欧美精品一区男女天堂| 亚洲国产精品成人综合| 国产精品成人在线观看| 亚洲精品乱码久久久久久久久| 亚洲超碰精品一区二区| 精品一区二区三区视频|