5
Implementing the Autoconfiguration
Support Section (probe)
The autoconfiguration support section contains the code that implements a
network device driver’s
probe
interface. A network device driver’s
probe
interface determines whether the network device exists and is functional on
a given system. The bus configuration code calls the driver’s
probe
interface.
The
if_el
driver operates on the ISA and PCMCIA bus. For the PCMCIA
bus, it provides a driver-specific routine that is called when a user removes
the card from the slot. For the ISA bus, the driver provides routines to reset,
activate, and read from hardware registers. These routines are specific to
the
if_el
device driver. To learn how the driver handles these tasks, see
the source listing in the examples directory that is installed with the device
driver kit.
The following sections describe how to use the
probe
interface:
•
Implementing the
el_probe( )
routine (Section 5.1)
•
Implementing the
el_shutdown( )
routine (Section 5.2)
•
Implementing the
el_autosense_thread( )
routine (Section 5.3)
5.1 Implementing the el_probe Routine
The
el_probe( )
routine performs the following tasks:
•
Checks the maximum number of devices that the driver supports
(Section 5.1.2)
•
Performs bus-specific tasks (Section 5.1.3)
•
Allocates memory for the
softc
and
ether_driver
data structures
(Section 5.1.4 and Section 5.1.5)
•
Initializes the enhanced hardware management data structure
(Section 5.1.6)
•
Computes the control and status register addresses (Section 5.1.7)
•
Sets bus-specific data structure members (Section 5.1.8)
•
If this is the first time the device has been probed, copies data from the
EEPROM, reads and saves the device’s physical address and starts the
autosense kernel thread to determine the media type (Section 5.1.9)
Implementing the Autoconfiguration Support Section (probe) 5–1