aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/ich8lan.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2009-12-01 10:47:22 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-02 03:35:52 -0500
commit17f208deb9bf88315aa72c08c866a235c399fb9a (patch)
tree9cc8bc9ce40587590fcea9d80e134adaf54567b2 /drivers/net/e1000e/ich8lan.c
parenteb656d4552a6c9de5fdcee4a376b171f57b8a4a2 (diff)
e1000e: provide family-specific PHY power up/down operations
The different families (80003es2lan, 8257x, ICHx/PCH) supported by the driver each have their own conditions when the PHY can be powered down. This patch rewrites the PHY power up/down code to fit with the family- specific style used in the driver. All pre-existing calls to power up or down the PHY remain untouched. A new call to power down the PHY when removing the driver when the interface is down replaces the current call to reset the PHY in order to reduce power consumption. Signed-off-by: Bruce Allan <bruce.w.allan@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/e1000e/ich8lan.c')
-rw-r--r--drivers/net/e1000e/ich8lan.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 7530fc5d81c3..9c3895598923 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -217,6 +217,7 @@ static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw);
217static s32 e1000_led_on_pchlan(struct e1000_hw *hw); 217static s32 e1000_led_on_pchlan(struct e1000_hw *hw);
218static s32 e1000_led_off_pchlan(struct e1000_hw *hw); 218static s32 e1000_led_off_pchlan(struct e1000_hw *hw);
219static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active); 219static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active);
220static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw);
220static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw); 221static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw);
221static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link); 222static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link);
222 223
@@ -266,6 +267,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
266 phy->ops.set_d3_lplu_state = e1000_set_lplu_state_pchlan; 267 phy->ops.set_d3_lplu_state = e1000_set_lplu_state_pchlan;
267 phy->ops.write_reg = e1000_write_phy_reg_hv; 268 phy->ops.write_reg = e1000_write_phy_reg_hv;
268 phy->ops.write_reg_locked = e1000_write_phy_reg_hv_locked; 269 phy->ops.write_reg_locked = e1000_write_phy_reg_hv_locked;
270 phy->ops.power_up = e1000_power_up_phy_copper;
271 phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
269 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; 272 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
270 273
271 phy->id = e1000_phy_unknown; 274 phy->id = e1000_phy_unknown;
@@ -299,6 +302,9 @@ static s32 e1000_init_phy_params_ich8lan(struct e1000_hw *hw)
299 phy->addr = 1; 302 phy->addr = 1;
300 phy->reset_delay_us = 100; 303 phy->reset_delay_us = 100;
301 304
305 phy->ops.power_up = e1000_power_up_phy_copper;
306 phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
307
302 /* 308 /*
303 * We may need to do this twice - once for IGP and if that fails, 309 * We may need to do this twice - once for IGP and if that fails,
304 * we'll set BM func pointers and try again 310 * we'll set BM func pointers and try again
@@ -3392,6 +3398,23 @@ static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw)
3392} 3398}
3393 3399
3394/** 3400/**
3401 * e1000_power_down_phy_copper_ich8lan - Remove link during PHY power down
3402 * @hw: pointer to the HW structure
3403 *
3404 * In the case of a PHY power down to save power, or to turn off link during a
3405 * driver unload, or wake on lan is not enabled, remove the link.
3406 **/
3407static void e1000_power_down_phy_copper_ich8lan(struct e1000_hw *hw)
3408{
3409 /* If the management interface is not enabled, then power down */
3410 if (!(hw->mac.ops.check_mng_mode(hw) ||
3411 hw->phy.ops.check_reset_block(hw)))
3412 e1000_power_down_phy_copper(hw);
3413
3414 return;
3415}
3416
3417/**
3395 * e1000_clear_hw_cntrs_ich8lan - Clear statistical counters 3418 * e1000_clear_hw_cntrs_ich8lan - Clear statistical counters
3396 * @hw: pointer to the HW structure 3419 * @hw: pointer to the HW structure
3397 * 3420 *