aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgb/ixgb_param.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgb/ixgb_param.c')
-rw-r--r--drivers/net/ixgb/ixgb_param.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
index 5d5ddabf4360..865d14d6e5a7 100644
--- a/drivers/net/ixgb/ixgb_param.c
+++ b/drivers/net/ixgb/ixgb_param.c
@@ -44,10 +44,11 @@
44 */ 44 */
45 45
46#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET } 46#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET }
47#define IXGB_PARAM(X, desc) \ 47#define IXGB_PARAM(X, desc) \
48 static int __devinitdata X[IXGB_MAX_NIC+1] = IXGB_PARAM_INIT; \ 48 static int __devinitdata X[IXGB_MAX_NIC+1] \
49 static int num_##X = 0; \ 49 = IXGB_PARAM_INIT; \
50 module_param_array_named(X, X, int, &num_##X, 0); \ 50 static unsigned int num_##X = 0; \
51 module_param_array_named(X, X, int, &num_##X, 0); \
51 MODULE_PARM_DESC(X, desc); 52 MODULE_PARM_DESC(X, desc);
52 53
53/* Transmit Descriptor Count 54/* Transmit Descriptor Count
@@ -178,8 +179,8 @@ IXGB_PARAM(IntDelayEnable, "Transmit Interrupt Delay Enable");
178 179
179struct ixgb_option { 180struct ixgb_option {
180 enum { enable_option, range_option, list_option } type; 181 enum { enable_option, range_option, list_option } type;
181 char *name; 182 const char *name;
182 char *err; 183 const char *err;
183 int def; 184 int def;
184 union { 185 union {
185 struct { /* range_option info */ 186 struct { /* range_option info */
@@ -197,7 +198,7 @@ struct ixgb_option {
197}; 198};
198 199
199static int __devinit 200static int __devinit
200ixgb_validate_option(int *value, struct ixgb_option *opt) 201ixgb_validate_option(unsigned int *value, const struct ixgb_option *opt)
201{ 202{
202 if(*value == OPTION_UNSET) { 203 if(*value == OPTION_UNSET) {
203 *value = opt->def; 204 *value = opt->def;
@@ -266,7 +267,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
266 } 267 }
267 268
268 { /* Transmit Descriptor Count */ 269 { /* Transmit Descriptor Count */
269 struct ixgb_option opt = { 270 const struct ixgb_option opt = {
270 .type = range_option, 271 .type = range_option,
271 .name = "Transmit Descriptors", 272 .name = "Transmit Descriptors",
272 .err = "using default of " __MODULE_STRING(DEFAULT_TXD), 273 .err = "using default of " __MODULE_STRING(DEFAULT_TXD),
@@ -285,7 +286,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
285 tx_ring->count = ALIGN(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); 286 tx_ring->count = ALIGN(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
286 } 287 }
287 { /* Receive Descriptor Count */ 288 { /* Receive Descriptor Count */
288 struct ixgb_option opt = { 289 const struct ixgb_option opt = {
289 .type = range_option, 290 .type = range_option,
290 .name = "Receive Descriptors", 291 .name = "Receive Descriptors",
291 .err = "using default of " __MODULE_STRING(DEFAULT_RXD), 292 .err = "using default of " __MODULE_STRING(DEFAULT_RXD),
@@ -304,7 +305,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
304 rx_ring->count = ALIGN(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE); 305 rx_ring->count = ALIGN(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
305 } 306 }
306 { /* Receive Checksum Offload Enable */ 307 { /* Receive Checksum Offload Enable */
307 struct ixgb_option opt = { 308 const struct ixgb_option opt = {
308 .type = enable_option, 309 .type = enable_option,
309 .name = "Receive Checksum Offload", 310 .name = "Receive Checksum Offload",
310 .err = "defaulting to Enabled", 311 .err = "defaulting to Enabled",
@@ -312,7 +313,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
312 }; 313 };
313 314
314 if(num_XsumRX > bd) { 315 if(num_XsumRX > bd) {
315 int rx_csum = XsumRX[bd]; 316 unsigned int rx_csum = XsumRX[bd];
316 ixgb_validate_option(&rx_csum, &opt); 317 ixgb_validate_option(&rx_csum, &opt);
317 adapter->rx_csum = rx_csum; 318 adapter->rx_csum = rx_csum;
318 } else { 319 } else {
@@ -328,7 +329,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
328 { ixgb_fc_full, "Flow Control Enabled" }, 329 { ixgb_fc_full, "Flow Control Enabled" },
329 { ixgb_fc_default, "Flow Control Hardware Default" }}; 330 { ixgb_fc_default, "Flow Control Hardware Default" }};
330 331
331 struct ixgb_option opt = { 332 const struct ixgb_option opt = {
332 .type = list_option, 333 .type = list_option,
333 .name = "Flow Control", 334 .name = "Flow Control",
334 .err = "reading default settings from EEPROM", 335 .err = "reading default settings from EEPROM",
@@ -338,7 +339,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
338 }; 339 };
339 340
340 if(num_FlowControl > bd) { 341 if(num_FlowControl > bd) {
341 int fc = FlowControl[bd]; 342 unsigned int fc = FlowControl[bd];
342 ixgb_validate_option(&fc, &opt); 343 ixgb_validate_option(&fc, &opt);
343 adapter->hw.fc.type = fc; 344 adapter->hw.fc.type = fc;
344 } else { 345 } else {
@@ -346,7 +347,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
346 } 347 }
347 } 348 }
348 { /* Receive Flow Control High Threshold */ 349 { /* Receive Flow Control High Threshold */
349 struct ixgb_option opt = { 350 const struct ixgb_option opt = {
350 .type = range_option, 351 .type = range_option,
351 .name = "Rx Flow Control High Threshold", 352 .name = "Rx Flow Control High Threshold",
352 .err = "using default of " __MODULE_STRING(DEFAULT_FCRTH), 353 .err = "using default of " __MODULE_STRING(DEFAULT_FCRTH),
@@ -366,7 +367,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
366 "Ignoring RxFCHighThresh when no RxFC\n"); 367 "Ignoring RxFCHighThresh when no RxFC\n");
367 } 368 }
368 { /* Receive Flow Control Low Threshold */ 369 { /* Receive Flow Control Low Threshold */
369 struct ixgb_option opt = { 370 const struct ixgb_option opt = {
370 .type = range_option, 371 .type = range_option,
371 .name = "Rx Flow Control Low Threshold", 372 .name = "Rx Flow Control Low Threshold",
372 .err = "using default of " __MODULE_STRING(DEFAULT_FCRTL), 373 .err = "using default of " __MODULE_STRING(DEFAULT_FCRTL),
@@ -386,7 +387,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
386 "Ignoring RxFCLowThresh when no RxFC\n"); 387 "Ignoring RxFCLowThresh when no RxFC\n");
387 } 388 }
388 { /* Flow Control Pause Time Request*/ 389 { /* Flow Control Pause Time Request*/
389 struct ixgb_option opt = { 390 const struct ixgb_option opt = {
390 .type = range_option, 391 .type = range_option,
391 .name = "Flow Control Pause Time Request", 392 .name = "Flow Control Pause Time Request",
392 .err = "using default of "__MODULE_STRING(DEFAULT_FCPAUSE), 393 .err = "using default of "__MODULE_STRING(DEFAULT_FCPAUSE),
@@ -396,7 +397,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
396 }; 397 };
397 398
398 if(num_FCReqTimeout > bd) { 399 if(num_FCReqTimeout > bd) {
399 int pause_time = FCReqTimeout[bd]; 400 unsigned int pause_time = FCReqTimeout[bd];
400 ixgb_validate_option(&pause_time, &opt); 401 ixgb_validate_option(&pause_time, &opt);
401 adapter->hw.fc.pause_time = pause_time; 402 adapter->hw.fc.pause_time = pause_time;
402 } else { 403 } else {
@@ -419,7 +420,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
419 } 420 }
420 } 421 }
421 { /* Receive Interrupt Delay */ 422 { /* Receive Interrupt Delay */
422 struct ixgb_option opt = { 423 const struct ixgb_option opt = {
423 .type = range_option, 424 .type = range_option,
424 .name = "Receive Interrupt Delay", 425 .name = "Receive Interrupt Delay",
425 .err = "using default of " __MODULE_STRING(DEFAULT_RDTR), 426 .err = "using default of " __MODULE_STRING(DEFAULT_RDTR),
@@ -436,7 +437,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
436 } 437 }
437 } 438 }
438 { /* Transmit Interrupt Delay */ 439 { /* Transmit Interrupt Delay */
439 struct ixgb_option opt = { 440 const struct ixgb_option opt = {
440 .type = range_option, 441 .type = range_option,
441 .name = "Transmit Interrupt Delay", 442 .name = "Transmit Interrupt Delay",
442 .err = "using default of " __MODULE_STRING(DEFAULT_TIDV), 443 .err = "using default of " __MODULE_STRING(DEFAULT_TIDV),
@@ -454,7 +455,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
454 } 455 }
455 456
456 { /* Transmit Interrupt Delay Enable */ 457 { /* Transmit Interrupt Delay Enable */
457 struct ixgb_option opt = { 458 const struct ixgb_option opt = {
458 .type = enable_option, 459 .type = enable_option,
459 .name = "Tx Interrupt Delay Enable", 460 .name = "Tx Interrupt Delay Enable",
460 .err = "defaulting to Enabled", 461 .err = "defaulting to Enabled",
@@ -462,7 +463,7 @@ ixgb_check_options(struct ixgb_adapter *adapter)
462 }; 463 };
463 464
464 if(num_IntDelayEnable > bd) { 465 if(num_IntDelayEnable > bd) {
465 int ide = IntDelayEnable[bd]; 466 unsigned int ide = IntDelayEnable[bd];
466 ixgb_validate_option(&ide, &opt); 467 ixgb_validate_option(&ide, &opt);
467 adapter->tx_int_delay_enable = ide; 468 adapter->tx_int_delay_enable = ide;
468 } else { 469 } else {