diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2009-12-01 10:47:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-02 03:35:52 -0500 |
commit | 17f208deb9bf88315aa72c08c866a235c399fb9a (patch) | |
tree | 9cc8bc9ce40587590fcea9d80e134adaf54567b2 /drivers/net/e1000e/phy.c | |
parent | eb656d4552a6c9de5fdcee4a376b171f57b8a4a2 (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/phy.c')
-rw-r--r-- | drivers/net/e1000e/phy.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 9ce499734dca..140b23b320fd 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -2534,6 +2534,43 @@ out: | |||
2534 | } | 2534 | } |
2535 | 2535 | ||
2536 | /** | 2536 | /** |
2537 | * e1000_power_up_phy_copper - Restore copper link in case of PHY power down | ||
2538 | * @hw: pointer to the HW structure | ||
2539 | * | ||
2540 | * In the case of a PHY power down to save power, or to turn off link during a | ||
2541 | * driver unload, or wake on lan is not enabled, restore the link to previous | ||
2542 | * settings. | ||
2543 | **/ | ||
2544 | void e1000_power_up_phy_copper(struct e1000_hw *hw) | ||
2545 | { | ||
2546 | u16 mii_reg = 0; | ||
2547 | |||
2548 | /* The PHY will retain its settings across a power down/up cycle */ | ||
2549 | e1e_rphy(hw, PHY_CONTROL, &mii_reg); | ||
2550 | mii_reg &= ~MII_CR_POWER_DOWN; | ||
2551 | e1e_wphy(hw, PHY_CONTROL, mii_reg); | ||
2552 | } | ||
2553 | |||
2554 | /** | ||
2555 | * e1000_power_down_phy_copper - Restore copper link in case of PHY power down | ||
2556 | * @hw: pointer to the HW structure | ||
2557 | * | ||
2558 | * In the case of a PHY power down to save power, or to turn off link during a | ||
2559 | * driver unload, or wake on lan is not enabled, restore the link to previous | ||
2560 | * settings. | ||
2561 | **/ | ||
2562 | void e1000_power_down_phy_copper(struct e1000_hw *hw) | ||
2563 | { | ||
2564 | u16 mii_reg = 0; | ||
2565 | |||
2566 | /* The PHY will retain its settings across a power down/up cycle */ | ||
2567 | e1e_rphy(hw, PHY_CONTROL, &mii_reg); | ||
2568 | mii_reg |= MII_CR_POWER_DOWN; | ||
2569 | e1e_wphy(hw, PHY_CONTROL, mii_reg); | ||
2570 | msleep(1); | ||
2571 | } | ||
2572 | |||
2573 | /** | ||
2537 | * e1000e_commit_phy - Soft PHY reset | 2574 | * e1000e_commit_phy - Soft PHY reset |
2538 | * @hw: pointer to the HW structure | 2575 | * @hw: pointer to the HW structure |
2539 | * | 2576 | * |