Setting Network Attributes And Registering The Adapter; Handling The Reinsert Operation - Compaq Tru64 UNIX Installation Manual

Writing network device drivers
Table of Contents

Advertisement

Calls the if_attach( ) routine to attach an interface to the list of
2
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
3
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);
lan_set_attribute(sc->ehm.current_val, NET_METHOD_NDX,
lan_register_adapter(&sc->ehm, ctlr);
Sets any known nonzero network attributes for the enhanced hardware
1
management facility. Make sure that this function call is made only
after the call to if_attach( ).
Registers the adapter with EHM.
2

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));
if (ifp->if_flags & IFF_RUNNING)
el_init(unit);
}
If the adapter was reinserted, calls the printf( ) routine to display the
1
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
2
associated with the network interface were previously allocated.
net_method_automatic);
2
2
Implementing the Autoconfiguration Support Section (attach) 6–9
1
1

Advertisement

Table of Contents
loading

Table of Contents