diff options
Diffstat (limited to 'drivers/net/e1000e/param.c')
-rw-r--r-- | drivers/net/e1000e/param.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c index ed912e023a72..77a3d7207a5f 100644 --- a/drivers/net/e1000e/param.c +++ b/drivers/net/e1000e/param.c | |||
@@ -114,6 +114,15 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); | |||
114 | #define DEFAULT_ITR 3 | 114 | #define DEFAULT_ITR 3 |
115 | #define MAX_ITR 100000 | 115 | #define MAX_ITR 100000 |
116 | #define MIN_ITR 100 | 116 | #define MIN_ITR 100 |
117 | /* IntMode (Interrupt Mode) | ||
118 | * | ||
119 | * Valid Range: 0 - 2 | ||
120 | * | ||
121 | * Default Value: 2 (MSI-X) | ||
122 | */ | ||
123 | E1000_PARAM(IntMode, "Interrupt Mode"); | ||
124 | #define MAX_INTMODE 2 | ||
125 | #define MIN_INTMODE 0 | ||
117 | 126 | ||
118 | /* | 127 | /* |
119 | * Enable Smart Power Down of the PHY | 128 | * Enable Smart Power Down of the PHY |
@@ -133,6 +142,15 @@ E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down"); | |||
133 | */ | 142 | */ |
134 | E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); | 143 | E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround"); |
135 | 144 | ||
145 | /* | ||
146 | * Write Protect NVM | ||
147 | * | ||
148 | * Valid Range: 0, 1 | ||
149 | * | ||
150 | * Default Value: 1 (enabled) | ||
151 | */ | ||
152 | E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]"); | ||
153 | |||
136 | struct e1000_option { | 154 | struct e1000_option { |
137 | enum { enable_option, range_option, list_option } type; | 155 | enum { enable_option, range_option, list_option } type; |
138 | const char *name; | 156 | const char *name; |
@@ -352,6 +370,24 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
352 | adapter->itr = 20000; | 370 | adapter->itr = 20000; |
353 | } | 371 | } |
354 | } | 372 | } |
373 | { /* Interrupt Mode */ | ||
374 | struct e1000_option opt = { | ||
375 | .type = range_option, | ||
376 | .name = "Interrupt Mode", | ||
377 | .err = "defaulting to 2 (MSI-X)", | ||
378 | .def = E1000E_INT_MODE_MSIX, | ||
379 | .arg = { .r = { .min = MIN_INTMODE, | ||
380 | .max = MAX_INTMODE } } | ||
381 | }; | ||
382 | |||
383 | if (num_IntMode > bd) { | ||
384 | unsigned int int_mode = IntMode[bd]; | ||
385 | e1000_validate_option(&int_mode, &opt, adapter); | ||
386 | adapter->int_mode = int_mode; | ||
387 | } else { | ||
388 | adapter->int_mode = opt.def; | ||
389 | } | ||
390 | } | ||
355 | { /* Smart Power Down */ | 391 | { /* Smart Power Down */ |
356 | const struct e1000_option opt = { | 392 | const struct e1000_option opt = { |
357 | .type = enable_option, | 393 | .type = enable_option, |
@@ -388,4 +424,25 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) | |||
388 | opt.def); | 424 | opt.def); |
389 | } | 425 | } |
390 | } | 426 | } |
427 | { /* Write-protect NVM */ | ||
428 | const struct e1000_option opt = { | ||
429 | .type = enable_option, | ||
430 | .name = "Write-protect NVM", | ||
431 | .err = "defaulting to Enabled", | ||
432 | .def = OPTION_ENABLED | ||
433 | }; | ||
434 | |||
435 | if (adapter->flags & FLAG_IS_ICH) { | ||
436 | if (num_WriteProtectNVM > bd) { | ||
437 | unsigned int write_protect_nvm = WriteProtectNVM[bd]; | ||
438 | e1000_validate_option(&write_protect_nvm, &opt, | ||
439 | adapter); | ||
440 | if (write_protect_nvm) | ||
441 | adapter->flags |= FLAG_READ_ONLY_NVM; | ||
442 | } else { | ||
443 | if (opt.def) | ||
444 | adapter->flags |= FLAG_READ_ONLY_NVM; | ||
445 | } | ||
446 | } | ||
447 | } | ||
391 | } | 448 | } |