Compaq Tru64 UNIX Installation Manual page 56

Writing network device drivers
Table of Contents

Advertisement

The following code shows the declaration of the variables and the
initialization of the cfg_subsys_attr_t data structure for the if_el
device driver:
static unsigned char el_pcmcia_optiondata[400] = "";
static unsigned char el_isa_optiondata[300] = "";
static unsigned char el_unused[300] = "";
static int el_polling = 0;
static int el_pollint = 16;
static int el_configured = 0;
static struct lan_config_data el_data = {
LAN_CONFIG_VERSION_ID,
0,
&eldriver,
&el_configured
};
cfg_subsys_attr_t el_attributes[] = {
{"PCMCIA_Option", CFG_ATTR_STRTYPE, CFG_OP_CONFIGURE | CFG_OP_QUERY,
{"ISA_Option", CFG_ATTR_STRTYPE, CFG_OP_CONFIGURE | CFG_OP_QUERY,
{"Polling", CFG_ATTR_INTTYPE, CFG_OP_QUERY | CFG_OP_CONFIGURE,
{"Polls_Per_Second", CFG_ATTR_INTTYPE, CFG_OP_QUERY | CFG_OP_CONFIGURE,
{"", 0, 0, 0, 0, 0, 0}
};
Declares a character array called pcmcia_optiondata and initializes
1
it to the null string. The pcmcia_optiondata character array is
where the cfgmgr framework stores the value for the PCMCIA_Option
attribute. The cfgmgr framework obtains this value from the
/etc/sysconfigtab database.
Declares a character array called isa_optiondata and initializes it
2
to the null string. The isa_optiondata character array is where the
cfgmgr framework stores the value for the ISA_Option attribute. The
cfgmgr framework obtains this value from the /etc/sysconfigtab
database.
Declares an integer variable called el_polling and initializes it to
3
the value 0 (zero). The el_polling variable is where the cfgmgr
framework stores the style of interrupt processing for the Polling
attribute. The cfgmgr framework obtains this value from the
/etc/sysconfigtab database.
Declares an integer variable called el_pollint and initializes it to the
4
value 16. The el_pollint variable is where the cfgmgr framework
stores the polls per second for the Polls_Per_Second attribute. The
cfgmgr framework obtains this value from the /etc/sysconfigtab
database.
Declares an integer variable called el_configured and initializes it
5
to the value 0 (zero). The driver must increment this variable for each
successfully configured el device.
4–2 Implementing the Configure Section
2
3
4
5
6
7
(caddr_t)el_pcmcia_optiondata, 0, 400, 0},
(caddr_t)el_isa_optiondata, 0, 300, 0},
(caddr_t)&el_polling, 0, 1, sizeof(int)},
(caddr_t)&el_pollint, 10, 100, sizeof(int)},
12
1
8
9
10
11

Advertisement

Table of Contents
loading

Table of Contents