Incrementing The Transmit Timeout Counter And Resetting; Releasing The Simple Lock And Resetting The Ipl; Resetting The Unit - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

Calls the simple_lock( ) routine to assert a lock with exclusive access
2
for the resource that is associated with the el_softc_lock simple lock
data structure pointer. This means that no other kernel thread can
gain access to the locked resource until you call simple_unlock( ) to
release it. Because simple locks are spin locks, simple_lock( ) does
not return until the lock has been obtained.
10.2 Incrementing the Transmit Timeout Counter and

Resetting the Unit

The following code shows how the el_watch( ) routine counts the number
of transmit timeouts, clears the timer, and resets the unit:
sc->xmit_tmo++;
ifp->if_timer = 0;
el_reset_locked(sc, ifp, unit);
Increments the transmit timeout counter, which stores the number
1
of times transmit timeouts occur.
Calls the el_reset_locked( ) routine to reset the device.
2

10.3 Releasing the Simple Lock and Resetting the IPL

The following code shows how the el_watch( ) routine releases the simple
lock and resets the IPL.
simple_unlock(&sc->el_softc_lock);
splx(s);
return(0);
}
10–2 Implementing a Watchdog Section
1
2

Advertisement

Table of Contents
loading

Table of Contents