]> err.no Git - linux-2.6/commitdiff
e1000: add smart power down code
authorAuke Kok <auke-jan.h.kok@intel.com>
Tue, 27 Jun 2006 16:06:45 +0000 (09:06 -0700)
committerAuke Kok <juke-jan.h.kok@intel.com>
Tue, 27 Jun 2006 16:06:45 +0000 (09:06 -0700)
Smart Power Down is a power saving feature in newer e1000 hardware. We
disable it because it causes time to link to be long, but make it a
user choice.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000_main.c
drivers/net/e1000/e1000_param.c

index 2b96ad0482efad8a11d3f8815b0db1fc8b68cb66..dbdaa332cac6595b3570375d2b1b27fccfed5d39 100644 (file)
@@ -338,6 +338,7 @@ struct e1000_adapter {
 #ifdef NETIF_F_TSO
        boolean_t tso_force;
 #endif
+       boolean_t smart_power_down;     /* phy smart power down */
        unsigned long flags;
 };
 
index 76e36a4fd9859d718937d1121947aab05f179515..ea18f3085f698ad18f04cfa3c2e1c08a8f2189ec 100644 (file)
@@ -607,6 +607,21 @@ e1000_reset(struct e1000_adapter *adapter)
 
        e1000_reset_adaptive(&adapter->hw);
        e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
+
+       if (!adapter->smart_power_down &&
+           (adapter->hw.mac_type == e1000_82571 ||
+            adapter->hw.mac_type == e1000_82572)) {
+               uint16_t phy_data = 0;
+               /* speed up time to link by disabling smart power down, ignore
+                * the return value of this function because there is nothing
+                * different we would do if it failed */
+               e1000_read_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT,
+                                  &phy_data);
+               phy_data &= ~IGP02E1000_PM_SPD;
+               e1000_write_phy_reg(&adapter->hw, IGP02E1000_PHY_POWER_MGMT,
+                                   phy_data);
+       }
+
        if (adapter->en_mng_pt) {
                manc = E1000_READ_REG(&adapter->hw, MANC);
                manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
index e55f8969a0fb0ca85f46f43ad2f9708e5bf55622..a8d9295b07797e527b50a7b9968e0104d2b8b6df 100644 (file)
@@ -183,6 +183,15 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
 
 E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
 
+/* Enable Smart Power Down of the PHY
+ *
+ * Valid Range: 0, 1
+ *
+ * Default Value: 0 (disabled)
+ */
+
+E1000_PARAM(SmartPowerDownEnable, "Enable PHY smart power down");
+
 #define AUTONEG_ADV_DEFAULT  0x2F
 #define AUTONEG_ADV_MASK     0x2F
 #define FLOW_CONTROL_DEFAULT FLOW_CONTROL_FULL
@@ -494,6 +503,22 @@ e1000_check_options(struct e1000_adapter *adapter)
                        adapter->itr = opt.def;
                }
        }
+       { /* Smart Power Down */
+               struct e1000_option opt = {
+                       .type = enable_option,
+                       .name = "PHY Smart Power Down",
+                       .err  = "defaulting to Disabled",
+                       .def  = OPTION_DISABLED
+               };
+
+               if (num_SmartPowerDownEnable > bd) {
+                       int spd = SmartPowerDownEnable[bd];
+                       e1000_validate_option(&spd, &opt, adapter);
+                       adapter->smart_power_down = spd;
+               } else {
+                       adapter->smart_power_down = opt.def;
+               }
+       }
 
        switch (adapter->hw.media_type) {
        case e1000_media_type_fiber: