Compaq Tru64 UNIX Installation Manual page 73

Writing network device drivers
Table of Contents

Advertisement

registration of interrupt handlers. All network device drivers are required to
register interrupt handlers.
el_intr_info.configuration_st = (caddr_t)ctlr;
el_intr_info.intr = el_intr;
el_intr_info.param = (caddr_t)unit;
el_intr_info.config_type = CONTROLLER_CONFIG_TYPE;
if (ctlr->bus_hd->bus_type == BUS_PCMCIA)
el_intr_info.config_type |= SHARED_INTR_CAPABLE;
el_ihandle.ih_bus = ctlr->bus_hd;
el_ihandle.ih_bus_info = (char *)&el_intr_info;
sc->hid = handler_add(&el_ihandle);
if (sc->hid == (ihandler_id_t *)(NULL)) {
printf("el%d: interrrupt handler add failed\n", unit);
if (sc->ispcmcia)
pcmcia_unregister_event_callback(card_infop->socket_vnum,
if_dealloc(sc->is_ed);
lan_ehm_free(&sc->ehm);
FREE(sc, M_DEVBUF);
return(0);
}
Sets the configuration_st member of the el_intr_info data
1
structure to the pointer to the controller data structure for this
3Com 3C5x9 device.
Sets the intr member of the el_intr_info data structure to
2
el_intr, which is the if_el device driver's interrupt handler.
Sets the param member of the el_intr_info data structure to the
3
controller number for the controller data structure for this 3Com
3C5x9 device.
Sets the config_type member of the el_intr_info data structure to
4
the constant CONTROLLER_CONFIG_TYPE, which identifies the if_el
driver type as a controller driver.
If the if_el driver operates on the PCMCIA bus, indicates that the
5
if_el driver can handle shared interrupts.
Sets the ih_bus member of the el_ihandle data structure to the bus
6
data structure for the if_el device driver. The bus data structure
is referenced through the bus_hd member of the controller data
structure for this 3Com 3C5x9 device.
Sets the ih_bus_info member of the el_ihandle data structure to the
7
address of the bus-specific information data structure, el_intr_info.
Calls the handler_add( ) routine to register the device driver's
8
interrupt handler and its associated ihandler_t data structure with
the bus-specific interrupt-dispatching algorithm.
Implementing the Autoconfiguration Support Section (probe) 5–15
1
2
3
4
5
6
7
8
9
CARD_REMOVAL_EVENT,
(caddr_t)el_card_remove);

Advertisement

Table of Contents
loading

Table of Contents