•
For subsequent probe operations, reads the EEPROM to determine if the
hardware address (and thus the adapter) has changed (Section 5.1.10)
•
Registers the interrupt handler (Section 5.1.11)
•
Saves the
controller
and
softc
data structure pointers
(Section 5.1.12)
•
Tries to allocate another
controller
data structure (Section 5.1.13)
•
Registers the shutdown routine (Section 5.1.14)
5.1.1 Setting Up the el_probe Routine
The following code shows how to set up the
el_probe( )
routine:
static int el_probe (io_handle_t io_handle,
1
struct controller *ctlr)
2
{
struct el_softc *sc;
3
int unit = ctlr->ctlr_num, i, j, isatag=0, status, multi_func_flag=0;
4
struct handler_intr_info el_intr_info;
5
ihandler_t el_ihandle;
6
struct card_info *card_infop = (struct card_info *)(ctlr->card_info_ptr);
7
io_handle_t reg;
8
struct e_port port_sel;
9
struct irq irq_sel;
10
unsigned short *ed;
unsigned char *ee;
struct tuple_info *tuple_infop;
11
struct tuple_data_info tuple_data;
struct tuple_data_info *tuple_data_infop;
1
Declares an argument that specifies an I/O handle that you can use to
reference a device register or memory that is located in bus address
space (either I/O space or memory space). This I/O handle references
the device’s I/O address space for the bus where the read operation
originates (in calls to the
read_io_port( )
routine) and where the
write operation occurs (in calls to the
write_io_port( )
routine). The
bus configuration code passes this I/O handle to the driver’s
probe
interface during device autoconfiguration.
2
Declares a pointer to a
controller
data structure for this controller.
This data structure contains such information as the controller type,
the controller name, and the current status of the controller. The bus
configuration code passes this initialized
controller
data structure
to the driver’s
probe
and
attach
interfaces. A device driver typically
uses the
ctlr_num
member of the
controller
data structure as an
index to identify the instance of the controller a request is for.
3
Declares a pointer to the
el_softc
data structure and calls it
sc
.
4
Declares a
unit
variable and initializes it to the controller number for
this controller. This controller number identifies the specific 3Com
3C5x9 controller that is being probed. The controller number is
5–2 Implementing the Autoconfiguration Support Section (probe)