Compaq AA-RNG2A-TE Network Card User Manual


 
2 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.
3 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:
lan_set_common_attributes(sc->ehm.current_val, &sc->is_ed); 1
lan_set_attribute(sc->ehm.current_val, NET_METHOD_NDX,
net_method_automatic);
lan_register_adapter(&sc->ehm, ctlr);
2
1 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( ).
2 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 -- current lan address: %s\n", unit,
ifp->if_version, ether_sprintf(sc->is_addr));
1
if (ifp->if_flags & IFF_RUNNING) 2
el_init(unit);
}
1 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.
2 Calls the drivers el_init() routine if the resources that are
associated with the network interface were previously allocated.
Implementing the Autoconfiguration Support Section (attach) 69