22 #include <linux/netdevice.h>
30 #define ATL1E_MAX_NIC 32
32 #define OPTION_UNSET -1
33 #define OPTION_DISABLED 0
34 #define OPTION_ENABLED 1
40 #define ATL1E_PARAM_INIT { [0 ... ATL1E_MAX_NIC] = OPTION_UNSET }
42 #define ATL1E_PARAM(x, desc) \
43 static int __devinitdata x[ATL1E_MAX_NIC + 1] = ATL1E_PARAM_INIT; \
44 static unsigned int num_##x; \
45 module_param_array_named(x, x, int, &num_##x, 0); \
46 MODULE_PARM_DESC(x, desc);
54 #define ATL1E_MIN_TX_DESC_CNT 32
55 #define ATL1E_MAX_TX_DESC_CNT 1020
56 #define ATL1E_DEFAULT_TX_DESC_CNT 128
57 ATL1E_PARAM(tx_desc_cnt,
"Transmit description count");
65 #define ATL1E_MIN_RX_MEM_SIZE 8
66 #define ATL1E_MAX_RX_MEM_SIZE 1024
67 #define ATL1E_DEFAULT_RX_MEM_SIZE 256
68 ATL1E_PARAM(rx_mem_size,
"memory size of rx buffer(KB)");
89 #define INT_MOD_DEFAULT_CNT 100
90 #define INT_MOD_MAX_CNT 65000
91 #define INT_MOD_MIN_CNT 50
92 ATL1E_PARAM(int_mod_timer,
"Interrupt Moderator Timer");
94 #define AUTONEG_ADV_DEFAULT 0x2F
95 #define AUTONEG_ADV_MASK 0x2F
96 #define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL
98 #define FLASH_VENDOR_DEFAULT 0
99 #define FLASH_VENDOR_MIN 0
100 #define FLASH_VENDOR_MAX 2
114 struct atl1e_opt_list {
int i;
char *
str; } *
p;
130 netdev_info(adapter->
netdev,
131 "%s Enabled\n", opt->
name);
134 netdev_info(adapter->
netdev,
135 "%s Disabled\n", opt->
name);
140 if (*value >= opt->
arg.
r.min && *value <= opt->
arg.r.max) {
141 netdev_info(adapter->
netdev,
"%s set to %i\n",
148 struct atl1e_opt_list *
ent;
150 for (i = 0; i < opt->
arg.
l.nr; i++) {
151 ent = &opt->
arg.
l.p[
i];
152 if (*value == ent->i) {
153 if (ent->str[0] !=
'\0')
154 netdev_info(adapter->
netdev,
165 netdev_info(adapter->
netdev,
"Invalid %s specified (%i) %s\n",
185 netdev_notice(adapter->
netdev,
186 "no configuration for board #%i\n", bd);
187 netdev_notice(adapter->
netdev,
188 "Using defaults for all values\n");
194 .name =
"Transmit Ddescription Count",
195 .err =
"using default of "
202 if (num_tx_desc_cnt > bd) {
203 val = tx_desc_cnt[bd];
204 atl1e_validate_option(&val, &opt, adapter);
213 .name =
"Memory size of rx buffer(KB)",
214 .err =
"using default of "
221 if (num_rx_mem_size > bd) {
222 val = rx_mem_size[bd];
223 atl1e_validate_option(&val, &opt, adapter);
233 .name =
"Interrupt Moderate Timer",
234 .err =
"using default of "
241 if (num_int_mod_timer > bd) {
242 val = int_mod_timer[bd];
243 atl1e_validate_option(&val, &opt, adapter);
244 adapter->
hw.imt = (
u16) val;
252 .name =
"Speed/Duplex Selection",
253 .err =
"using default of "
260 if (num_media_type > bd) {
262 atl1e_validate_option(&val, &opt, adapter);
263 adapter->
hw.media_type = (
u16) val;
265 adapter->
hw.media_type = (
u16)(opt.
def);