diff options
author | Nick Nunley <nicholasx.d.nunley@intel.com> | 2010-02-16 20:01:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:21:33 -0500 |
commit | 88a268c1a11a2e94b7c55a8cfe97892d845887c8 (patch) | |
tree | b748dcd6491b17376c984145c2dca02165d92547 /drivers/net/igb/e1000_82575.c | |
parent | 53c992fa8497286f24f279ebec5a8c7a58d4e68c (diff) |
igb: Power down link when interface is down
This changes the behavior of the driver to power down the link
when the associated interface is down, unless management is enabled.
Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/e1000_82575.c')
-rw-r--r-- | drivers/net/igb/e1000_82575.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index 59817bcc716..9d7fa2fb85e 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -727,6 +727,34 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw) | |||
727 | } | 727 | } |
728 | 728 | ||
729 | /** | 729 | /** |
730 | * igb_power_up_serdes_link_82575 - Power up the serdes link after shutdown | ||
731 | * @hw: pointer to the HW structure | ||
732 | **/ | ||
733 | void igb_power_up_serdes_link_82575(struct e1000_hw *hw) | ||
734 | { | ||
735 | u32 reg; | ||
736 | |||
737 | |||
738 | if ((hw->phy.media_type != e1000_media_type_internal_serdes) && | ||
739 | !igb_sgmii_active_82575(hw)) | ||
740 | return; | ||
741 | |||
742 | /* Enable PCS to turn on link */ | ||
743 | reg = rd32(E1000_PCS_CFG0); | ||
744 | reg |= E1000_PCS_CFG_PCS_EN; | ||
745 | wr32(E1000_PCS_CFG0, reg); | ||
746 | |||
747 | /* Power up the laser */ | ||
748 | reg = rd32(E1000_CTRL_EXT); | ||
749 | reg &= ~E1000_CTRL_EXT_SDP3_DATA; | ||
750 | wr32(E1000_CTRL_EXT, reg); | ||
751 | |||
752 | /* flush the write to verify completion */ | ||
753 | wrfl(); | ||
754 | msleep(1); | ||
755 | } | ||
756 | |||
757 | /** | ||
730 | * igb_get_pcs_speed_and_duplex_82575 - Retrieve current speed/duplex | 758 | * igb_get_pcs_speed_and_duplex_82575 - Retrieve current speed/duplex |
731 | * @hw: pointer to the HW structure | 759 | * @hw: pointer to the HW structure |
732 | * @speed: stores the current speed | 760 | * @speed: stores the current speed |
@@ -1166,6 +1194,22 @@ out: | |||
1166 | } | 1194 | } |
1167 | 1195 | ||
1168 | /** | 1196 | /** |
1197 | * igb_power_down_phy_copper_82575 - Remove link during PHY power down | ||
1198 | * @hw: pointer to the HW structure | ||
1199 | * | ||
1200 | * In the case of a PHY power down to save power, or to turn off link during a | ||
1201 | * driver unload, or wake on lan is not enabled, remove the link. | ||
1202 | **/ | ||
1203 | void igb_power_down_phy_copper_82575(struct e1000_hw *hw) | ||
1204 | { | ||
1205 | /* If the management interface is not enabled, then power down */ | ||
1206 | if (!(igb_enable_mng_pass_thru(hw) || igb_check_reset_block(hw))) | ||
1207 | igb_power_down_phy_copper(hw); | ||
1208 | |||
1209 | return; | ||
1210 | } | ||
1211 | |||
1212 | /** | ||
1169 | * igb_clear_hw_cntrs_82575 - Clear device specific hardware counters | 1213 | * igb_clear_hw_cntrs_82575 - Clear device specific hardware counters |
1170 | * @hw: pointer to the HW structure | 1214 | * @hw: pointer to the HW structure |
1171 | * | 1215 | * |