2
3
Calls the if_attach( ) routine to attach an interface to the list of active interfaces. The argument to the if_attach( ) routine is a pointer to the ifnet data structure for with this device.
If the probe and attach operations were successful, increments the number of successfully configured el devices. You must do this if you are using lan_configure( ).
6.9 Setting Network Attributes and Registering the Adapter
The following code shows how the if_attach( ) routine sets the known nonzero network attributes for the enhanced hardware management (EHM) facility and registers the adapter:
net_method_automatic);
1
1
2
Sets any known nonzero network attributes for the enhanced hardware management facility. Make sure that this function call is made only after the call to if_attach( ).
Registers the adapter with EHM.
6.10 Handling the Reinsert Operation
If the user has reinserted the PCMCIA card, the if_el device driver does not need to initialize the media address and media length. It does not need to set up the media, specify the network driver interfaces, set the baud rate, or initialize simple lock information. These tasks are done during the first attach operation. The el_attach( ) routine needs only to initialize the device, as follows:
} else {
printf("el%d: %s, reloaded
if
}
2
1
2
If the adapter was reinserted, calls the printf( ) routine to display the following information on the console terminal:
•The controller number (which is stored in the unit variable).
•The version of the network interface (which is stored in the if_version member of the ifnet data structure).
•The hardware address of the device.
Calls the driver’s el_init( ) routine if the resources that are associated with the network interface were previously allocated.
Implementing the Autoconfiguration Support Section (attach)