kernels/linux-2.4.0/drivers/net/wan/sdla_chdlc.c
/*============================================================================
 * Close network interface.
 * o if this is the last close, then disable communications and interrupts.
 * o reset flags.
 */
Close network interface.
o if this is the last close, then disable communications and interrupts.
o reset flags.
Close network interface . o if this is the last close then disable communications and interrupts . o reset flags .
static int if_close (struct net_device* dev)
{
	chdlc_private_area_t* chdlc_priv_area = dev->priv;
	sdla_t* card = chdlc_priv_area->card;
	if(test_and_set_bit(1, (void*)&card->wandev.critical))
		return -EAGAIN;
	netif_stop_queue(dev);
	wanpipe_close(card);
	port_set_state(card, WAN_DISCONNECTED);
	chdlc_set_intr_mode(card, 0);
	chdlc_comm_disable(card);
	clear_bit(1, (void*)&card->wandev.critical);
	return 0;
}
static int if_close ( struct net_device * dev ) { chdlc_private_area_t * chdlc_priv_area = dev -> priv ; sdla_t * card = chdlc_priv_area -> card ; if ( test_and_set_bit ( 1 , ( void * ) & card -> wandev . critical ) ) return - EAGAIN ; netif_stop_queue ( dev ) ; wanpipe_close ( card ) ; port_set_state ( card , WAN_DISCONNECTED ) ; chdlc_set_intr_mode ( card , 0 ) ; chdlc_comm_disable ( card ) ; clear_bit ( 1 , ( void * ) & card -> wandev . critical ) ; return 0 ; }
Close network interface.
Close network interface .