kernels/linux-2.4.0/drivers/net/ppp_generic.c
/*
 * Disconnect a channel from the generic layer.
 * This can be called from mainline or BH/softirq level.
 */
Disconnect a channel from the generic layer.
This can be called from mainline or BH/softirq level.
Disconnect a channel from the generic layer . This can be called from mainline or BH / softirq level .
void
ppp_unregister_channel(struct ppp_channel *chan)
{
	struct channel *pch = chan->ppp;
	if (pch == 0)
		return;		
	chan->ppp = 0;
	spin_lock_bh(&pch->downl);
	pch->chan = 0;
	spin_unlock_bh(&pch->downl);
	ppp_disconnect_channel(pch);
	wake_up_interruptible(&pch->file.rwait);
	spin_lock_bh(&all_channels_lock);
	list_del(&pch->file.list);
	spin_unlock_bh(&all_channels_lock);
	if (atomic_dec_and_test(&pch->file.refcnt))
		ppp_destroy_channel(pch);
	MOD_DEC_USE_COUNT;
}
void ppp_unregister_channel ( struct ppp_channel * chan ) { struct channel * pch = chan -> ppp ; if ( pch == 0 ) return ; chan -> ppp = 0 ; spin_lock_bh ( & pch -> downl ) ; pch -> chan = 0 ; spin_unlock_bh ( & pch -> downl ) ; ppp_disconnect_channel ( pch ) ; wake_up_interruptible ( & pch -> file . rwait ) ; spin_lock_bh ( & all_channels_lock ) ; list_del ( & pch -> file . list ) ; spin_unlock_bh ( & all_channels_lock ) ; if ( atomic_dec_and_test ( & pch -> file . refcnt ) ) ppp_destroy_channel ( pch ) ; MOD_DEC_USE_COUNT ; }
Disconnect a channel from the generic layer.
Disconnect a channel from the generic layer .
/* should never happen */ /*
	 * This ensures that we have returned from any calls into the
	 * the channel's start_xmit or ioctl routine before we proceed.
	 */