kernels/linux-2.4.0/drivers/net/3c527.c
/**
 *	mc32_close:
 *	@dev: 3c527 card to shut down
 *
 *	The 3c527 is a bus mastering device. We must be careful how we
 *	shut it down. It may also be running shared interrupt so we have
 *	to be sure to silence it properly
 *
 *	We abort any receive and transmits going on and then wait until
 *	any pending exec commands have completed in other code threads.
 *	In theory we can't get here while that is true, in practice I am
 *	paranoid
 *
 *	We turn off the interrupt enable for the board to be sure it can't
 *	intefere with other devices.
 */
@dev: 3c527 card to shut down

The 3c527 is a bus mastering device. We must be careful how we
shut it down. It may also be running shared interrupt so we have
to be sure to silence it properly

We abort any receive and transmits going on and then wait until
any pending exec commands have completed in other code threads.
In theory we can't get here while that is true, in practice I am
paranoid

We turn off the interrupt enable for the board to be sure it can't
intefere with other devices.
@dev : 3c527 card to shut down The 3c527 is a bus mastering device . We must be careful how we shut it down . It may also be running shared interrupt so we have to be sure to silence it properly We abort any receive and transmits going on and then wait until any pending exec commands have completed in other code threads . In theory we can ' t get here while that is true in practice I am paranoid We turn off the interrupt enable for the board to be sure it can ' t intefere with other devices .
static int mc32_close(struct net_device *dev)
{
	struct mc32_local *lp = (struct mc32_local *)dev->priv;
	int ioaddr = dev->base_addr;
	u8 regs;
	u16 one=1;
	netif_stop_queue(dev);
	mc32_command(dev, 4, &one, 2);
	mc32_rx_abort(dev);	
	mc32_tx_abort(dev);
	while(lp->exec_pending==1)
		sleep_on(&lp->event);
	regs=inb(ioaddr+HOST_CTRL);
	regs&=~HOST_CTRL_INTE;
	outb(regs, ioaddr+HOST_CTRL);
	mc32_flush_rx_ring(lp);
	mc32_flush_tx_ring(lp);
	return 0;
}
static int mc32_close ( struct net_device * dev ) { struct mc32_local * lp = ( struct mc32_local * ) dev -> priv ; int ioaddr = dev -> base_addr ; u8 regs ; u16 one = 1 ; netif_stop_queue ( dev ) ; mc32_command ( dev , 4 , & one , 2 ) ; mc32_rx_abort ( dev ) ; mc32_tx_abort ( dev ) ; while ( lp -> exec_pending == 1 ) sleep_on ( & lp -> event ) ; regs = inb ( ioaddr + HOST_CTRL ) ; regs &= ~ HOST_CTRL_INTE ; outb ( regs , ioaddr + HOST_CTRL ) ; mc32_flush_rx_ring ( lp ) ; mc32_flush_tx_ring ( lp ) ; return 0 ; }
mc32_close:
      @dev: 3c527 card to shut down
mc32_close : @dev : 3c527 card to shut down
/*
	 *	Send the indications on command (handy debug check)
	 */ /* Abort RX and Abort TX */ /* Catch any waiting commands */ /* Ok the card is now stopping */ /* Update the statistics here. */