Implementing The Unattach Routine; Setting Up The El_Unattach Routine - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

Implementing the unattach Routine

The el_unattach( ) routine is called to stop the device and to free memory
and other resources prior to unloading the driver or powering off the bus
to which the device is attached. The el_unattach( ) routine undoes
everything that was performed by the el_probe( ) and el_attach( )
routines.
______________________
The PCMCIA bus does not support the el_unattach( ) routine.
The el_unattach( ) routine performs the following tasks:
Verifies that the interface has shut down (Section 7.2)
Obtains and releases the simple lock (Section 7.3)
Disables the interrupt handler (Section 7.4)
Terminates the autosense thread (Section 7.5)
Unregisters the PCMCIA event callback routine (Section 7.6)
Stops the polling process (Section 7.7)
Unregisters the shutdown interface (Section 7.8)
Terminates the simple lock (Section 7.9)
Unregisters the card from the hardware management database
(Section 7.10)
Frees data structures and resources used by the adapter (Section 7.11)

7.1 Setting Up the el_unattach Routine

The following code shows how to set up the el_unattach( ) routine:
static int el_unattach(struct bus *bus,
{
int unit = ctlr->ctlr_num;
int s, status;
Note
_______________________
1
struct controller *ctlr)
2
Implementing the unattach Routine 7–1
7

Advertisement

Table of Contents
loading

Table of Contents