Compaq AA-RNG2A-TE manual Releasing the Simple Lock and Resetting the IPL

Models: AA-RNG2A-TE

1 159
Download 159 pages 42.56 Kb
Page 122
Image 122

2

Calls the simple_lock( ) routine to assert a lock with exclusive access 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.2Incrementing 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++;

1

ifp->if_timer = 0;

el_reset_locked(sc, ifp, unit);

2

1

2

Increments the transmit timeout counter, which stores the number of times transmit timeouts occur.

Calls the el_reset_locked( ) routine to reset the device.

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–2Implementing a Watchdog Section

Page 122
Image 122
Compaq AA-RNG2A-TE manual Releasing the Simple Lock and Resetting the IPL