]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/e1000e/param.c
Merge branches 'x86/mmio', 'x86/delay', 'x86/idle', 'x86/oprofile', 'x86/debug',...
[linux-2.6-omap-h63xx.git] / drivers / net / e1000e / param.c
index e4e655efb23cbd8b9cfe0e06896ced7db796b2ab..a66b92efcf80c231a35694fe3b5fb63e3ca69f64 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel PRO/1000 Linux driver
-  Copyright(c) 1999 - 2007 Intel Corporation.
+  Copyright(c) 1999 - 2008 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -30,7 +30,8 @@
 
 #include "e1000.h"
 
-/* This is the only thing that needs to be changed to adjust the
+/*
+ * This is the only thing that needs to be changed to adjust the
  * maximum number of ports that the driver can manage.
  */
 
@@ -46,21 +47,24 @@ module_param(copybreak, uint, 0644);
 MODULE_PARM_DESC(copybreak,
        "Maximum size of packet that is copied to a new buffer on receive");
 
-/* All parameters are treated the same, as an integer array of values.
+/*
+ * All parameters are treated the same, as an integer array of values.
  * This macro just reduces the need to repeat the same declaration code
  * over and over (plus this helps to avoid typo bugs).
  */
 
 #define E1000_PARAM_INIT { [0 ... E1000_MAX_NIC] = OPTION_UNSET }
-#define E1000_PARAM(X, desc) \
-       static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \
-       static int num_##X; \
-       module_param_array_named(X, X, int, &num_##X, 0); \
+#define E1000_PARAM(X, desc)                                   \
+       static int __devinitdata X[E1000_MAX_NIC+1]             \
+               = E1000_PARAM_INIT;                             \
+       static unsigned int num_##X;                            \
+       module_param_array_named(X, X, int, &num_##X, 0);       \
        MODULE_PARM_DESC(X, desc);
 
 
-/* Transmit Interrupt Delay in units of 1.024 microseconds
- *  Tx interrupt delay needs to typically be set to something non zero
+/*
+ * Transmit Interrupt Delay in units of 1.024 microseconds
+ * Tx interrupt delay needs to typically be set to something non zero
  *
  * Valid Range: 0-65535
  */
@@ -69,7 +73,8 @@ E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
 #define MAX_TXDELAY 0xFFFF
 #define MIN_TXDELAY 0
 
-/* Transmit Absolute Interrupt Delay in units of 1.024 microseconds
+/*
+ * Transmit Absolute Interrupt Delay in units of 1.024 microseconds
  *
  * Valid Range: 0-65535
  */
@@ -78,8 +83,9 @@ E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
 #define MAX_TXABSDELAY 0xFFFF
 #define MIN_TXABSDELAY 0
 
-/* Receive Interrupt Delay in units of 1.024 microseconds
- *   hardware will likely hang if you set this to anything but zero.
+/*
+ * Receive Interrupt Delay in units of 1.024 microseconds
+ * hardware will likely hang if you set this to anything but zero.
  *
  * Valid Range: 0-65535
  */
@@ -88,7 +94,8 @@ E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
 #define MAX_RXDELAY 0xFFFF
 #define MIN_RXDELAY 0
 
-/* Receive Absolute Interrupt Delay in units of 1.024 microseconds
+/*
+ * Receive Absolute Interrupt Delay in units of 1.024 microseconds
  *
  * Valid Range: 0-65535
  */
@@ -97,7 +104,8 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
 #define MAX_RXABSDELAY 0xFFFF
 #define MIN_RXABSDELAY 0
 
-/* Interrupt Throttle Rate (interrupts/sec)
+/*
+ * Interrupt Throttle Rate (interrupts/sec)
  *
  * Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
  */
@@ -106,7 +114,8 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
 #define MAX_ITR 100000
 #define MIN_ITR 100
 
-/* Enable Smart Power Down of the PHY
+/*
+ * Enable Smart Power Down of the PHY
  *
  * Valid Range: 0, 1
  *
@@ -114,7 +123,8 @@ E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
  */
 E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
 
-/* Enable Kumeran Lock Loss workaround
+/*
+ * Enable Kumeran Lock Loss workaround
  *
  * Valid Range: 0, 1
  *
@@ -124,9 +134,9 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
 
 struct e1000_option {
        enum { enable_option, range_option, list_option } type;
-       char *name;
-       char *err;
-       int  def;
+       const char *name;
+       const char *err;
+       int def;
        union {
                struct { /* range_option info */
                        int min;
@@ -139,8 +149,8 @@ struct e1000_option {
        } arg;
 };
 
-static int __devinit e1000_validate_option(int *value,
-                                          struct e1000_option *opt,
+static int __devinit e1000_validate_option(unsigned int *value,
+                                          const struct e1000_option *opt,
                                           struct e1000_adapter *adapter)
 {
        if (*value == OPTION_UNSET) {
@@ -213,7 +223,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
        }
 
        { /* Transmit Interrupt Delay */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Transmit Interrupt Delay",
                        .err  = "using default of "
@@ -232,7 +242,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Transmit Absolute Interrupt Delay */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Transmit Absolute Interrupt Delay",
                        .err  = "using default of "
@@ -261,13 +271,6 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                                         .max = MAX_RXDELAY } }
                };
 
-               /* modify min and default if 82573 for slow ping w/a,
-                * a value greater than 8 needs to be set for RDTR */
-               if (adapter->flags & FLAG_HAS_ASPM) {
-                       opt.def = 32;
-                       opt.arg.r.min = 8;
-               }
-
                if (num_RxIntDelay > bd) {
                        adapter->rx_int_delay = RxIntDelay[bd];
                        e1000_validate_option(&adapter->rx_int_delay, &opt,
@@ -277,7 +280,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Receive Absolute Interrupt Delay */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Receive Absolute Interrupt Delay",
                        .err  = "using default of "
@@ -296,7 +299,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Interrupt Throttling Rate */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = range_option,
                        .name = "Interrupt Throttling Rate (ints/sec)",
                        .err  = "using default of "
@@ -344,7 +347,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Smart Power Down */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = enable_option,
                        .name = "PHY Smart Power Down",
                        .err  = "defaulting to Disabled",
@@ -352,7 +355,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_SmartPowerDownEnable > bd) {
-                       int spd = SmartPowerDownEnable[bd];
+                       unsigned int spd = SmartPowerDownEnable[bd];
                        e1000_validate_option(&spd, &opt, adapter);
                        if ((adapter->flags & FLAG_HAS_SMART_POWER_DOWN)
                            && spd)
@@ -360,7 +363,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                }
        }
        { /* Kumeran Lock Loss Workaround */
-               struct e1000_option opt = {
+               const struct e1000_option opt = {
                        .type = enable_option,
                        .name = "Kumeran Lock Loss Workaround",
                        .err  = "defaulting to Enabled",
@@ -368,7 +371,7 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                };
 
                if (num_KumeranLockLoss > bd) {
-                       int kmrn_lock_loss = KumeranLockLoss[bd];
+                       unsigned int kmrn_lock_loss = KumeranLockLoss[bd];
                        e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
                        if (hw->mac.type == e1000_ich8lan)
                                e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw,