FreeBSD/sys/dev/cs/if_cs.c
/*
 * Device timeout/watchdog routine. Entered if the device neglects to
 * generate an interrupt after a transmit has been started on it.
 */
Device timeout/watchdog routine. Entered if the device neglects to
generate an interrupt after a transmit has been started on it.
Device timeout / watchdog routine . Entered if the device neglects to generate an interrupt after a transmit has been started on it .
static void
cs_watchdog(void *arg)
{
	struct cs_softc *sc = arg;
	struct ifnet *ifp = sc->ifp;
	CS_ASSERT_LOCKED(sc);
	if (sc->tx_timeout && --sc->tx_timeout == 0) {
		if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
		log(LOG_ERR, "%s: device timeout\n", ifp->if_xname);
		if (ifp->if_flags & IFF_UP)
			cs_reset(sc);
		else
			cs_stop(sc);
	}
	callout_reset(&sc->timer, hz, cs_watchdog, sc);
}
static void cs_watchdog ( void * arg ) { struct cs_softc * sc = arg ; struct ifnet * ifp = sc -> ifp ; CS_ASSERT_LOCKED ( sc ) ; if ( sc -> tx_timeout && -- sc -> tx_timeout == 0 ) { if_inc_counter ( ifp , IFCOUNTER_OERRORS , 1 ) ; log ( LOG_ERR , " \n " , ifp -> if_xname ) ; if ( ifp -> if_flags & IFF_UP ) cs_reset ( sc ) ; else cs_stop ( sc ) ; } callout_reset ( & sc -> timer , hz , cs_watchdog , sc ) ; }
Device timeout/watchdog routine.
Device timeout / watchdog routine .
/* Reset the interface */