4
Implementing the Configure Section
The configure section of a network device driver contains the code that incorporates the device driver into the kernel, either statically or dynamically. In a static configuration, the device driver’s configure interface registers callback routines, which allow the cfgmgr framework to configure the driver into the kernel at a specified point during system startup. In a dynamic configuration, the configure interface cooperates with the cfgmgr framework to handle
Because these tasks are common to all network drivers, the code has been consolidated into a single routine called lan_configure( ). Routines with the prefix lan_ reside in the lan_common.c source file. A network driver’s configure( ) routine can simply call lan_configure( ) to carry out the following tasks:
•CFG_OP_CONFIGURE
•CFG_OP_RECONFIGURE
•CFG_OP_UNCONFIGURE
•CFG_OP_QUERY
The if_el driver’s configure section contains an attributes data structure and the el_configure( ) routine.
The following sections describe how to initialize the cfg_subsys_attr_t data structure and how to set up the el_configure( ) routine:
•Declaring
•Setting up the el_configure( ) routine (Section 4.2)
4.1Declaring
As part of implementing a device driver’s configure interface, you declare a number of variables and initialize the cfg_subsys_attr_t data structure.
Implementing the Configure Section