Enabling The Interrupt Handler; Starting The Polling Process - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

6.11 Enabling the Interrupt Handler

The following code shows how the el_attach( ) routine enables the
interrupt handler:
handler_enable(sc->hid);
Calls the handler_enable( ) routine to enable a previously registered
1
interrupt handler. The el_probe( ) routine calls handler_add to
register the interrupt handler and it stores the handler ID in the hid
member of the el_softc data structure for this device.

6.12 Starting the Polling Process

The following code shows how the el_attach( ) routine starts the polling
process:
if (el_polling && !sc->polling_flag) {
sc->polling_flag = 1;
timeout((void *)el_intr, (void *)unit, (1*hz)/el_pollint);
} else
sc->polling_flag = 0;
return(0);
}
Starts the polling process if the el_polling attribute specifies that
1
polling is to be done.
To start the polling process, el_attach( ) sets the polling_flag
member to 1 (true), then calls the timeout( ) routine to schedule the
interrupt handler to run at some point in the future. timeout( ) is
called with the following arguments:
A pointer to the el_intr( ) routine, which is the if_el device
driver's interrupt handler.
The unit variable, which contains the controller number associated
with this device. This argument is passed to the el_intr( ) routine.
The el_pollint variable, which specifies the amount of time to
delay before calling the el_intr( ) routine.
If the user requests that polling be disabled, el_attach( ) sets the
2
polling_flag member to 0 (false).
6–10 Implementing the Autoconfiguration Support Section (attach)
1
1
2

Advertisement

Table of Contents
loading

Table of Contents