kernels/linux-2.4.0/drivers/net/tokenring/tms380tr.c
/*
 * The timer routine: Check if adapter still open and working, reopen if not. 
 */
The timer routine: Check if adapter still open and working, reopen if not.
The timer routine : Check if adapter still open and working reopen if not .
static void tms380tr_timer_chk(unsigned long data)
{
	struct net_device *dev = (struct net_device*)data;
	struct net_local *tp = (struct net_local*)dev->priv;
	if(tp->HaltInProgress)
		return;
	tms380tr_chk_outstanding_cmds(dev);
	if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies)
		&& (tp->QueueSkb < MAX_TX_QUEUE || tp->TplFree != tp->TplBusy))
	{
		tp->LastSendTime = jiffies;
		tms380tr_exec_cmd(dev, OC_CLOSE);	
	}
	tp->timer.expires = jiffies + 2*HZ;
	add_timer(&tp->timer);
	if(tp->AdapterOpenFlag || tp->ReOpenInProgress)
		return;
	tp->ReOpenInProgress = 1;
	tms380tr_open_adapter(dev);
	return;
}
static void tms380tr_timer_chk ( unsigned long data ) { struct net_device * dev = ( struct net_device * ) data ; struct net_local * tp = ( struct net_local * ) dev -> priv ; if ( tp -> HaltInProgress ) return ; tms380tr_chk_outstanding_cmds ( dev ) ; if ( time_before ( tp -> LastSendTime + SEND_TIMEOUT , jiffies ) && ( tp -> QueueSkb < MAX_TX_QUEUE || tp -> TplFree != tp -> TplBusy ) ) { tp -> LastSendTime = jiffies ; tms380tr_exec_cmd ( dev , OC_CLOSE ) ; } tp -> timer . expires = jiffies + 2 * HZ ; add_timer ( & tp -> timer ) ; if ( tp -> AdapterOpenFlag || tp -> ReOpenInProgress ) return ; tp -> ReOpenInProgress = 1 ; tms380tr_open_adapter ( dev ) ; return ; }
The timer routine: Check if adapter still open and working, reopen if not.
The timer routine : Check if adapter still open and working reopen if not .
/* Anything to send, but stalled to long */ /* Does reopen automatically */