Disabling The Interrupt Handler; Terminating The Autosense Kernel Thread - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

s variable. This value represents the CPU priority level that existed
before the call to splimp( ).
Calls the simple_lock( ) routine to assert a lock with exclusive
2
access for the resource that is associated with the el_softc_lock
data structure. 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.
Stops the device and puts it in a reset state.
3
Calls the simple_unlock( ) routine to release the simple lock.
4
Calls the splx( ) routine to reset the CPU priority to the level that is
5
stored in the s variable.

7.4 Disabling the Interrupt Handler

The following code shows how the el_unattach( ) routine disables and
deletes the interrupt handler:
if (sc->hid) {
handler_disable(sc->hid);
handler_del(sc->hid);
sc->hid = NULL;
}
Disables and deletes the interrupt handler. The argument that is
1
supplied to each function is the handler ID that was returned by
handler_add in the el_probe( ) routine.

7.5 Terminating the Autosense Kernel Thread

The following code shows how the el_unattach( ) routine terminates the
autosense kernel thread:
if (sc->autosense_thread) {
thread_force_terminate(sc->autosense_thread);
sc->autosense_thread = NULL;
}
Terminates the autosense kernel thread.
1
1
1
Implementing the unattach Routine 7–3

Advertisement

Table of Contents
loading

Table of Contents