Index Index for
Section 9
Index Alphabetical
listing for L
Bottom of page Bottom of
page

lan_register_adapter(9r)

NAME

lan_register_adapter - Network: Registers the adapter with Hardware Management

SYNOPSIS

void lan_register_adapter( struct net_hw_mgmt *ehm, struct controller *ctlr );

ARGUMENTS

ehm Specifies a pointer to the hardware management structure used by the network device. A network driver allocates a net_hw_mgmt data structure for each network device it controls. ctlr Specifies a pointer to the controller structure for the device being registered.

DESCRIPTION

The lan_register_adapter() routine registers a network device with Hardware Management. The current and default attribute tables are passed to Hardware Management along with other control information. Prior to performing the registration request, lan_register_adapter() will copy all the current attribute values (current_val) to the default attribute values (default_val). Thereafter, make sure that a network driver changes the attribute values only in the current_val table using the lan_set_attribute() routine.

NOTES

Make sure that the lan_register_adapter() routine is called only after the driver has set all known attributes for the device during device initialization. The call is typically made after if_attach() and lan_set_common_attributes() have been called.

EXAMPLE

The following example shows how to use lan_register_adapter(): struct nd_softc { struct ether_driver *is_ed; struct net_hw_mgmt ehm; ... } sc; static int nd_attach(struct controller *ctlr) { struct ifnet *ifp = &sc.is_ed->ess_ac.ac_if; ... lan_ehm_init (&sc.ehm, NET_EHM_VERSION_ID); lan_set_attribute (sc.ehm.current_val, NET_MODEL_NDX, "NETDEV"); ... if_attach (ifp); lan_set_common_attributes (sc.ehm.current_val, sc.is_ed); lan_register_adapter (&sc.ehm, ctlr); }

RETURN VALUES

None

SEE ALSO

Routines: lan_ehm_init(9r), lan_ehm_free(9r), lan_set_attribute(9r), lan_set_common_attributes(9r) Data Structures: net_hw_mgmt(9s)

Index Index for
Section 9
Index Alphabetical
listing for L
Top of page Top of
page