kernels/linux-2.4.0/drivers/net/sis900.c
/**
 *	sis900_close: - close sis900 device 
 *	@net_dev: the net device to be closed
 *
 *	Disable interrupts, stop the Tx and Rx Status Machine 
 *	free Tx and RX socket buffer
 */
- close sis900 device
@net_dev: the net device to be closed

Disable interrupts, stop the Tx and Rx Status Machine
free Tx and RX socket buffer
- close sis900 device @net_dev : the net device to be closed Disable interrupts stop the Tx and Rx Status Machine free Tx and RX socket buffer
static int
sis900_close(struct net_device *net_dev)
{
	long ioaddr = net_dev->base_addr;
	struct sis900_private *sis_priv = (struct sis900_private *)net_dev->priv;
	int i;
	netif_stop_queue(net_dev);
	outl(0x0000, ioaddr + imr);
	outl(0x0000, ioaddr + ier);
	outl(RxDIS | TxDIS, ioaddr + cr);
	del_timer(&sis_priv->timer);
	free_irq(net_dev->irq, net_dev);
	for (i = 0; i < NUM_RX_DESC; i++) {
		if (sis_priv->rx_skbuff[i] != NULL)
			dev_kfree_skb(sis_priv->rx_skbuff[i]);
		sis_priv->rx_skbuff[i] = 0;
	}
	for (i = 0; i < NUM_TX_DESC; i++) {
		if (sis_priv->tx_skbuff[i] != NULL)
			dev_kfree_skb(sis_priv->tx_skbuff[i]);
		sis_priv->tx_skbuff[i] = 0;
	}
	MOD_DEC_USE_COUNT;
	return 0;
}
static int sis900_close ( struct net_device * net_dev ) { long ioaddr = net_dev -> base_addr ; struct sis900_private * sis_priv = ( struct sis900_private * ) net_dev -> priv ; int i ; netif_stop_queue ( net_dev ) ; outl ( 0x0000 , ioaddr + imr ) ; outl ( 0x0000 , ioaddr + ier ) ; outl ( RxDIS | TxDIS , ioaddr + cr ) ; del_timer ( & sis_priv -> timer ) ; free_irq ( net_dev -> irq , net_dev ) ; for ( i = 0 ; i < NUM_RX_DESC ; i ++ ) { if ( sis_priv -> rx_skbuff [ i ] != NULL ) dev_kfree_skb ( sis_priv -> rx_skbuff [ i ] ) ; sis_priv -> rx_skbuff [ i ] = 0 ; } for ( i = 0 ; i < NUM_TX_DESC ; i ++ ) { if ( sis_priv -> tx_skbuff [ i ] != NULL ) dev_kfree_skb ( sis_priv -> tx_skbuff [ i ] ) ; sis_priv -> tx_skbuff [ i ] = 0 ; } MOD_DEC_USE_COUNT ; return 0 ; }
sis900_close: - close sis900 device
      @net_dev: the net device to be closed
sis900_close : - close sis900 device @net_dev : the net device to be closed
/* Disable interrupts by clearing the interrupt mask. */ /* Stop the chip's Tx and Rx Status Machine */ /* Free Tx and RX skbuff */ /* Green! Put the chip in low-power mode. */