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

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

?? if_cs.c

?? 這是一個在VxWorks系統實現CS網卡END驅動的原代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
   {
      LOGMSG("csBufferEvent: unit %d, Software initiated interrupt\n",
         pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
   }

}




/*******************************************************************************
*
* 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_SOFTC *pCS, USHORT TxEvent )
{
   struct ifnet *pIf;

   pIf = &pCS->ArpCom.ac_if;
   
   /* 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."*/

	  /*pIf->if_opackets--;*/
      pIf->if_oerrors++;

      /* If debugging is enabled then log error messages */
      if ( csDebug == TRUE )
      {
	 if ( TxEvent & TX_EVENT_LOSS_CRS )
	 {
	    LOGMSG("csTransmitEvent: unit %d, Loss of carrier\n",
	       pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
	 }
	 if ( TxEvent & TX_EVENT_SQE_ERR )
	 {
	    LOGMSG("csTransmitEvent: unit %d, SQE error\n",
	       pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
	 }
	 if ( TxEvent & TX_EVENT_OUT_WIN )
	 {
	    LOGMSG("csTransmitEvent: unit %d, Out-of-window collision\n",
	       pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
	 }
	 if ( TxEvent & TX_EVENT_JABBER )
	 {
	    LOGMSG("csTransmitEvent: unit %d, Jabber\n",
	       pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
	 }
	 if ( TxEvent & TX_EVENT_16_COLL )
	 {
	    LOGMSG("csTransmitEvent: unit %d, 16 collisions\n",
	       pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
	 }
      }
   } 


   /* 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_SOFTC *pCS, USHORT RxEvent )
{
   struct ifnet *pIf;
   PRXBUF pRxBuff;

   pIf = &pCS->ArpCom.ac_if;

   /* If the frame was not received OK */
   if ( !(RxEvent & RX_EVENT_RX_OK) )
   {
      /* Increment the input error count */
      pIf->if_ierrors++;

      /* If debugging is enabled then log error messages */
      if ( csDebug == TRUE )
      {
         /* If an error bit is set */
         if ( RxEvent != REG_NUM_RX_EVENT )
         {
            if ( RxEvent & RX_EVENT_RUNT )
            {
              LOGMSG("csReceiveEvent: unit %d, Runt\n",
                 pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
            }
            if ( RxEvent & RX_EVENT_X_DATA )
            {
              LOGMSG("csReceiveEvent: unit %d, Extra data\n",
                 pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
            }
            if ( RxEvent & RX_EVENT_CRC_ERR )
            {
               if ( RxEvent & RX_EVENT_DRIBBLE )
               {
                  LOGMSG("csReceiveEvent: unit %d, Alignment error\n",
                     pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
               }
               else
               {
                  LOGMSG("csReceiveEvent: unit %d, CRC Error\n",
                     pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
               }
            }
            else if ( RxEvent & RX_EVENT_DRIBBLE )
            {
               LOGMSG("csReceiveEvent: unit %d, Dribble bits\n",
                  pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );
            }
         }
      }

      /* 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 */
   pRxBuff = csAllocRxBuff( pCS );

   if ( pRxBuff == NULL )  /* If no buffer available */
   {
      /* Increment the input error count */
      pIf->if_ierrors++;
      
#if ( ! STRESS_TESTING )
      LOGMSG("csReceiveEvent: unit %d, No receive buffer available\n",
         pCS->ArpCom.ac_if.if_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 */
   csCopyRxFrame( pCS, pRxBuff );

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

}



/*******************************************************************************
* 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_SOFTC *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 );
      m_freem( 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
*
*/

#ifdef BSD43_DRIVER 
LOCAL void csStartOutput( int Unit )
{
   FAST CS_SOFTC *pCS;
   FAST struct mbuf *pMbuf;
   struct ifqueue *pTxQueue;
   int Spl;
   BOOL  QError;

   if ( Unit >= CS_MAX_NUM_UNITS ) 
      return;

   pCS = &cs_softc[Unit];

#else /* BSD4.4 DRIVER */

LOCAL void csStartOutput
    (
    CS_SOFTC * pCS		/* pointer to control structure */
    )
    {
   FAST struct mbuf *pMbuf;
   struct ifqueue *pTxQueue;
   int Spl;
   BOOL  QError;
#endif /* BSD43_DRIVER */


   pTxQueue = &pCS->ArpCom.ac_if.if_snd;

   /* Note the maximum depth of the transmit queue */
   if ( pTxQueue->ifq_len > pCS->MaxTxDepth )
      pCS->MaxTxDepth = pTxQueue->ifq_len;

   /* Drain the interface's send queue into the local TX queue */

   while ( pTxQueue->ifq_head != NULL )
   {
      Spl = splnet();
      /* Dequeue an mbuf chain from the transmit queue */
      IF_DEQUEUE( pTxQueue, pMbuf );
      splx( Spl );
      
      QError = csEnqueue( pCS->pTxQueue, pMbuf );

      if ( QError )
      {
	    /* TxQueue is full -- dump the frame and exit loop */	     
	    m_freem( (PTXBUF)pMbuf );

	    /* Update output stats */
	    pCS->ArpCom.ac_if.if_oerrors++;

	    LOGMSG("csStartOutput: unit %d, Transmit queue overflow\n",
	           pCS->ArpCom.ac_if.if_unit, 0,0,0,0,0 );

	    /* Local TX queue is full so exit loop */
	    break;
      }

	  /* @kml*/
	 pCS->ArpCom.ac_if.if_opackets++;

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

   }


   /* 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_SOFTC *pCS )
{
   int State = 0;
   USHORT BusStatus;
   PMBUF  pMbuf;

   /* etherOutputHookRtn is not supported in a standard way.  It does not
    * perform an "alternative TX operation".  To do so would require copying
    * the TX data to a local linear buffer (too expensive).  Since we don't 
    * have a linear buffer, simply pass a NULL as the second and third 
    * parameters.
    */

   if (etherOutputHookRtn != NULL)
   {
	  

      (* etherOutputHookRtn) (&pCS->ArpCom, NULL, NULL);
   }


   /* 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 = intLock( );
      }

      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->m_next )
      {
	 pCS->TxLength += pMbuf->m_len;
      }

      /* Bid for space on the chip and start the TX if bid successful */
      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 )
      {
	   /* The chip is ready for transmission now */
	   /* Copy the frame to the chip to start transmission */
	   csCopyTxFrame( pCS, pCS->pTxFrameChain );

	   /* Mark TX as in progress */
	   pCS->TxInProgress = TRUE;


	   if ( !pCS->InISR )
	   {
	    /* Re-enable interrupts at the CPU */
	    intUnlock( State );
	   }


	   /* Transmission now in progress */
	   break;
      }
      else
      {
	 /* If there was an error in the transmit bid */
	 if ( BusStatus & BUS_ST_TX_BID_ERR )
	 {
	    /* Set TX not in progress */
	    pMbuf = pCS->pTxFrameChain;
	    pCS->pTxFrameChain = NULL;
	    pCS->TxInProgress = FALSE;

	    if ( !pCS->InISR )
	    {
	       /* Re-enable interrupts at the CPU */
	       intUnlock( State);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区视频在线观看视频| 久久91精品久久久久久秒播| 亚洲成a人片在线不卡一二三区| 日本成人在线网站| a在线欧美一区| 精品黑人一区二区三区久久| 亚洲最新在线观看| 国产99久久久精品| 欧美一级爆毛片| 亚洲免费av在线| 欧美精品一区男女天堂| 国产精品成人免费在线| 日日摸夜夜添夜夜添亚洲女人| 丁香婷婷综合色啪| 亚洲精品一区二区三区四区高清| 一区二区三区高清| av电影在线观看一区| www国产精品av| 亚洲女人的天堂| 福利一区二区在线观看| 成人性视频免费网站| 69精品人人人人| 亚洲精品福利视频网站| 东方欧美亚洲色图在线| 精品乱码亚洲一区二区不卡| 亚洲午夜在线电影| 欧美中文字幕一二三区视频| 中文字幕第一区| 国产精品一区二区在线观看不卡| 51久久夜色精品国产麻豆| 亚洲综合免费观看高清完整版| 成人国产精品免费网站| 国产精品三级av| 成人不卡免费av| 国产精品第13页| 91亚洲精品久久久蜜桃网站| 同产精品九九九| 欧美视频中文一区二区三区在线观看 | 制服丝袜成人动漫| 午夜激情久久久| 欧美精选在线播放| 蜜臀av性久久久久av蜜臀妖精| 欧美二区在线观看| 蜜臀久久久久久久| 欧美变态tickle挠乳网站| 美女一区二区久久| 国产欧美日韩精品在线| eeuss鲁片一区二区三区 | 一本大道久久a久久精二百 | 精品久久久久99| 国产成人啪午夜精品网站男同| 久久免费视频色| 成人动漫精品一区二区| 亚洲精品日日夜夜| 欧美日本韩国一区二区三区视频 | 欧美性视频一区二区三区| 亚洲午夜电影网| 日韩免费福利电影在线观看| 国产美女av一区二区三区| 中文字幕中文字幕在线一区| 色婷婷综合久久久久中文 | 国产精品一二三四区| 中日韩免费视频中文字幕| 一本色道亚洲精品aⅴ| 午夜欧美大尺度福利影院在线看 | 亚洲欧洲国产日本综合| 欧美日韩在线播放一区| 激情图片小说一区| 亚洲久本草在线中文字幕| 欧美一区二区免费视频| 成人高清免费观看| 日本一不卡视频| 国产精品国产自产拍高清av| 91国内精品野花午夜精品| 激情文学综合插| 亚洲国产精品麻豆| 中文字幕欧美区| 欧美精品九九99久久| 成人黄色软件下载| 久久精品国产精品亚洲精品| 国产精品不卡在线观看| 欧美成人福利视频| 欧美性色综合网| 高清免费成人av| 美女网站视频久久| 亚洲国产欧美在线人成| 国产精品乱码久久久久久| 欧美一级理论片| 色老汉一区二区三区| 激情久久五月天| 五月婷婷激情综合网| 国产精品麻豆网站| 久久麻豆一区二区| 91麻豆精品国产91久久久资源速度| 粉嫩绯色av一区二区在线观看| 秋霞午夜鲁丝一区二区老狼| 亚洲午夜久久久久中文字幕久| 自拍偷拍国产精品| 国产精品五月天| 欧美激情一区二区三区蜜桃视频 | 国产精品国产自产拍高清av| 久久免费视频色| 久久婷婷久久一区二区三区| 91精品在线麻豆| 欧美美女直播网站| 欧美日韩中文另类| 在线视频国产一区| 日本大香伊一区二区三区| 成人在线视频一区二区| 国产风韵犹存在线视精品| 激情国产一区二区| 国产精品18久久久久| 韩国一区二区在线观看| 图片区小说区国产精品视频| 亚洲主播在线播放| 国产精品传媒视频| 日韩一区欧美一区| 国产精品久久三| 久久久久久久综合狠狠综合| 日韩午夜av电影| 欧美一区二区视频在线观看2022| 99久久亚洲一区二区三区青草 | 欧美高清激情brazzers| 色综合av在线| 91丨porny丨首页| 国产精品一线二线三线精华| 丝袜美腿成人在线| 视频一区二区三区在线| 亚洲成人精品一区二区| 亚洲国产综合在线| 蜜桃精品视频在线| 久久成人羞羞网站| 看电影不卡的网站| 久久99久久99精品免视看婷婷| 亚洲精品美腿丝袜| 亚洲一区二区四区蜜桃| 一区二区三区四区蜜桃| 一区二区免费看| 亚洲电影一区二区三区| 亚洲专区一二三| 韩国v欧美v亚洲v日本v| 精油按摩中文字幕久久| 国产乱码精品1区2区3区| 国产一区二区电影| 色视频欧美一区二区三区| 91国在线观看| 欧美剧情片在线观看| 欧美一区二区三区在线视频| 欧美一区二区女人| 国产午夜亚洲精品理论片色戒| 国产欧美日韩亚州综合| 亚洲视频每日更新| 亚洲一区二区在线视频| 一区二区三区四区中文字幕| 精品在线观看视频| 成人h精品动漫一区二区三区| www.亚洲色图.com| 欧美日韩国产首页| 在线亚洲一区二区| 中文字幕久久午夜不卡| 亚洲狠狠丁香婷婷综合久久久| 亚洲精品成人在线| 美腿丝袜亚洲一区| 国产成人免费在线| 欧美日韩国产在线播放网站| 日韩欧美视频在线| 中文字幕一区二区三区在线播放 | 天天操天天综合网| 国产麻豆9l精品三级站| 91麻豆蜜桃一区二区三区| 国产网红主播福利一区二区| 亚洲精品成人在线| 国产一区二区电影| 欧美视频在线一区| 2023国产精品| 亚洲一区二区三区三| 国产美女视频91| 欧美日韩日日夜夜| 国产精品视频一二三| 另类中文字幕网| 国产一区二区福利| 91精品国产综合久久香蕉麻豆 | 一区二区三区四区视频精品免费| 蜜臀av性久久久久蜜臀av麻豆 | 久久久噜噜噜久久人人看| 一区二区高清在线| 麻豆精品一区二区| www.欧美日韩国产在线| 国产欧美日韩麻豆91| 美女精品一区二区| 91国在线观看| 欧美国产成人精品| 国产成人欧美日韩在线电影| 91精品国产福利在线观看| 亚洲美女淫视频| 国产精品 日产精品 欧美精品| 精品电影一区二区三区 | 成人毛片在线观看| 国产亚洲精久久久久久| 免费一级片91|