Skip to content

Commit

Permalink
e1000: handle manageability for pci-e adapters at PHY powerdown
Browse files Browse the repository at this point in the history
When powering down the PHY (if WoL is disabled) we should only check
copper PHY's and handle PCI-E adapters differently.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
  • Loading branch information
Bruce Allan authored and Auke Kok committed Sep 27, 2006
1 parent 09ae3e8 commit 61c2505
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,25 +512,48 @@ void e1000_power_up_phy(struct e1000_adapter *adapter)

static void e1000_power_down_phy(struct e1000_adapter *adapter)
{
boolean_t mng_mode_enabled = (adapter->hw.mac_type >= e1000_82571) &&
e1000_check_mng_mode(&adapter->hw);
/* Power down the PHY so no link is implied when interface is down
* The PHY cannot be powered down if any of the following is TRUE
/* Power down the PHY so no link is implied when interface is down *
* The PHY cannot be powered down if any of the following is TRUE *
* (a) WoL is enabled
* (b) AMT is active
* (c) SoL/IDER session is active */
if (!adapter->wol && adapter->hw.mac_type >= e1000_82540 &&
adapter->hw.mac_type != e1000_ich8lan &&
adapter->hw.media_type == e1000_media_type_copper &&
!(E1000_READ_REG(&adapter->hw, MANC) & E1000_MANC_SMBUS_EN) &&
!mng_mode_enabled &&
!e1000_check_phy_reset_block(&adapter->hw)) {
adapter->hw.media_type == e1000_media_type_copper) {
uint16_t mii_reg = 0;

switch (adapter->hw.mac_type) {
case e1000_82540:
case e1000_82545:
case e1000_82545_rev_3:
case e1000_82546:
case e1000_82546_rev_3:
case e1000_82541:
case e1000_82541_rev_2:
case e1000_82547:
case e1000_82547_rev_2:
if (E1000_READ_REG(&adapter->hw, MANC) &
E1000_MANC_SMBUS_EN)
goto out;
break;
case e1000_82571:
case e1000_82572:
case e1000_82573:
case e1000_80003es2lan:
case e1000_ich8lan:
if (e1000_check_mng_mode(&adapter->hw) ||
e1000_check_phy_reset_block(&adapter->hw))
goto out;
break;
default:
goto out;
}
e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &mii_reg);
mii_reg |= MII_CR_POWER_DOWN;
e1000_write_phy_reg(&adapter->hw, PHY_CTRL, mii_reg);
mdelay(1);
}
out:
return;
}

void
Expand Down

0 comments on commit 61c2505

Please sign in to comment.