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_phy.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_phy.c')
-rw-r--r-- | drivers/net/igb/e1000_phy.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c index 3670a66401b8..cf1f32300923 100644 --- a/drivers/net/igb/e1000_phy.c +++ b/drivers/net/igb/e1000_phy.c | |||
@@ -1931,6 +1931,41 @@ s32 igb_phy_init_script_igp3(struct e1000_hw *hw) | |||
1931 | } | 1931 | } |
1932 | 1932 | ||
1933 | /** | 1933 | /** |
1934 | * igb_power_up_phy_copper - Restore copper link in case of PHY power down | ||
1935 | * @hw: pointer to the HW structure | ||
1936 | * | ||
1937 | * In the case of a PHY power down to save power, or to turn off link during a | ||
1938 | * driver unload, restore the link to previous settings. | ||
1939 | **/ | ||
1940 | void igb_power_up_phy_copper(struct e1000_hw *hw) | ||
1941 | { | ||
1942 | u16 mii_reg = 0; | ||
1943 | |||
1944 | /* The PHY will retain its settings across a power down/up cycle */ | ||
1945 | hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg); | ||
1946 | mii_reg &= ~MII_CR_POWER_DOWN; | ||
1947 | hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); | ||
1948 | } | ||
1949 | |||
1950 | /** | ||
1951 | * igb_power_down_phy_copper - Power down copper PHY | ||
1952 | * @hw: pointer to the HW structure | ||
1953 | * | ||
1954 | * Power down PHY to save power when interface is down and wake on lan | ||
1955 | * is not enabled. | ||
1956 | **/ | ||
1957 | void igb_power_down_phy_copper(struct e1000_hw *hw) | ||
1958 | { | ||
1959 | u16 mii_reg = 0; | ||
1960 | |||
1961 | /* The PHY will retain its settings across a power down/up cycle */ | ||
1962 | hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg); | ||
1963 | mii_reg |= MII_CR_POWER_DOWN; | ||
1964 | hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); | ||
1965 | msleep(1); | ||
1966 | } | ||
1967 | |||
1968 | /** | ||
1934 | * igb_check_polarity_82580 - Checks the polarity. | 1969 | * igb_check_polarity_82580 - Checks the polarity. |
1935 | * @hw: pointer to the HW structure | 1970 | * @hw: pointer to the HW structure |
1936 | * | 1971 | * |