kernels/linux-2.4.0/drivers/net/3c527.c
/**
 *	mc32_tx_abort:
 *	@dev: 3c527 to abort
 *
 *	Peforms a receive abort sequence on the card. In fact after some
 *	experimenting we now simply tell the card to suspend transmits . When
 *	issuing aborts occasionally odd things happened. In theory we want
 *	an abort to be sure we can recycle our buffers. As it happens we
 *	just have to be careful to shut the card down on close, and
 *	boot it carefully from scratch on setup.
 */


Peforms a receive abort sequence on the card. In fact after some
experimenting we now simply tell the card to suspend transmits . When
issuing aborts occasionally odd things happened. In theory we want
an abort to be sure we can recycle our buffers. As it happens we
just have to be careful to shut the card down on close, and
boot it carefully from scratch on setup.
Peforms a receive abort sequence on the card . In fact after some experimenting we now simply tell the card to suspend transmits . When issuing aborts occasionally odd things happened . In theory we want an abort to be sure we can recycle our buffers . As it happens we just have to be careful to shut the card down on close and boot it carefully from scratch on setup .
static void mc32_tx_abort(struct net_device *dev)
{
	struct mc32_local *lp = (struct mc32_local *)dev->priv;
	int ioaddr = dev->base_addr;
	while(!(inb(ioaddr+HOST_STATUS)&HOST_STATUS_CRR));
	lp->tx_box->mbox=0;
	outb(3, ioaddr+HOST_CMD);	
	atomic_set(&lp->tx_count, lp->tx_len);
	if(lp->tx_skb_top!=lp->tx_skb_end)
	{
		int i;
		if(lp->tx_skb_top<=lp->tx_skb_end)
		{
			for(i=lp->tx_skb_top;i<lp->tx_skb_end;i++)
			{
				dev_kfree_skb(lp->tx_skb[i]);
				lp->tx_skb[i]=NULL;
			}
		}
		else
		{
			for(i=lp->tx_skb_end;i<TX_RING_MAX;i++)
			{
				dev_kfree_skb(lp->tx_skb[i]);
				lp->tx_skb[i]=NULL;
			}
			for(i=0;i<lp->tx_skb_top;i++)
			{
				dev_kfree_skb(lp->tx_skb[i]);
				lp->tx_skb[i]=NULL;
			}
		}
	}
	lp->tx_skb_top=lp->tx_skb_end=0;
}
static void mc32_tx_abort ( struct net_device * dev ) { struct mc32_local * lp = ( struct mc32_local * ) dev -> priv ; int ioaddr = dev -> base_addr ; while ( ! ( inb ( ioaddr + HOST_STATUS ) & HOST_STATUS_CRR ) ) ; lp -> tx_box -> mbox = 0 ; outb ( 3 , ioaddr + HOST_CMD ) ; atomic_set ( & lp -> tx_count , lp -> tx_len ) ; if ( lp -> tx_skb_top != lp -> tx_skb_end ) { int i ; if ( lp -> tx_skb_top <= lp -> tx_skb_end ) { for ( i = lp -> tx_skb_top ; i < lp -> tx_skb_end ; i ++ ) { dev_kfree_skb ( lp -> tx_skb [ i ] ) ; lp -> tx_skb [ i ] = NULL ; } } else { for ( i = lp -> tx_skb_end ; i < TX_RING_MAX ; i ++ ) { dev_kfree_skb ( lp -> tx_skb [ i ] ) ; lp -> tx_skb [ i ] = NULL ; } for ( i = 0 ; i < lp -> tx_skb_top ; i ++ ) { dev_kfree_skb ( lp -> tx_skb [ i ] ) ; lp -> tx_skb [ i ] = NULL ; } } } lp -> tx_skb_top = lp -> tx_skb_end = 0 ; }
mc32_tx_abort:
      @dev: 3c527 to abort
mc32_tx_abort : @dev : 3c527 to abort
/* Suspend */ /* Ring empty */ /* Flush */