Compaq AA-RNG2A-TE manual Setting Up the elconfigure Routine

Models: AA-RNG2A-TE

1 159
Download 159 pages 42.56 Kb
Page 57
Image 57

6

7

8

9

10

11

12

Declares the lan_config_data structure, which contains all information specific to the el driver. The lan_configure common code uses this structure.

Declares an array of cfg_subsys_attr_t data structures and calls it el_attributes.

Describes the PCMCIA_Option attribute, which specifies the option data for the PCMCIA bus.

Describes the ISA_Option attribute, which specifies the option data for the ISA bus.

Describes the Polling attribute, which is specific to this device driver. It indicates the style of interrupt processing. The operation code specifies CFG_OP_CONFIGURE and CFG_OP_QUERY. This means that the attribute can only be set at configuration time and, after that, only queried. You can specify a value in the sysconfigtab file fragment (which is appended to the /etc/sysconfigtab database). The cfgmgr framework obtains this value from the /etc/sysconfigtab database and stores it in the el_polling variable.

Describes the Polls_Per_Second attribute, which is specific to this device driver. It indicates the polls per second for interrupt processing. Similar to the Polling attribute, you can only specify a value for this attribute at configuration time. The cfgmgr framework obtains this value from the /etc/sysconfigtab database and stores it in the el_pollint variable.

Ends the array by specifying the null string.

4.2 Setting Up the el_configure Routine

The following code shows how to set up the el_configure( ) routine:

int el_configure(cfg_op_t op, 1 cfg_attr_t *indata, 2 size_t indatalen, 3 cfg_attr_t *outdata, 4 size_t outdatalen) 5

{

return (lan_configure (op, &el_data));

}

6

1

2

Declares an argument called op to contain a constant that describes the configuration operation to be performed on the driver. This argument evaluates to one of the following valid constants: CFG_OP_CONFIGURE, CFG_OP_UNCONFIGURE, CFG_OP_QUERY, or CFG_OP_RECONFIGURE.

Declares a pointer to a cfg_attr_t data structure called indata, which consists of input to the el_configure( ) routine. The cfgmgr framework fills in this data structure. The cfg_attr_t data structure

Implementing the Configure Section 4–3

Page 57
Image 57
Compaq AA-RNG2A-TE manual Setting Up the elconfigure Routine, Following code shows how to set up the elconfigure routine