diff options
author | Nick Nunley <nicholasx.d.nunley@intel.com> | 2010-02-17 01:01:59 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 13:21:33 -0800 |
commit | 88a268c1a11a2e94b7c55a8cfe97892d845887c8 (patch) | |
tree | b748dcd6491b17376c984145c2dca02165d92547 /drivers/net/igb/igb_ethtool.c | |
parent | 53c992fa8497286f24f279ebec5a8c7a58d4e68c (diff) | |
download | kernel_samsung_smdk4412-88a268c1a11a2e94b7c55a8cfe97892d845887c8.zip kernel_samsung_smdk4412-88a268c1a11a2e94b7c55a8cfe97892d845887c8.tar.gz kernel_samsung_smdk4412-88a268c1a11a2e94b7c55a8cfe97892d845887c8.tar.bz2 |
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/igb_ethtool.c')
-rw-r--r-- | drivers/net/igb/igb_ethtool.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index 4eea03b..4852883 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c @@ -1722,6 +1722,9 @@ static void igb_diag_test(struct net_device *netdev, dev_info(&adapter->pdev->dev, "offline testing starting\n"); + /* power up link for link test */ + igb_power_up_link(adapter); + /* Link test performed before hardware reset so autoneg doesn't * interfere with test result */ if (igb_link_test(adapter, &data[4])) @@ -1745,6 +1748,8 @@ static void igb_diag_test(struct net_device *netdev, eth_test->flags |= ETH_TEST_FL_FAILED; igb_reset(adapter); + /* power up link for loopback test */ + igb_power_up_link(adapter); if (igb_loopback_test(adapter, &data[3])) eth_test->flags |= ETH_TEST_FL_FAILED; @@ -1763,9 +1768,14 @@ static void igb_diag_test(struct net_device *netdev, dev_open(netdev); } else { dev_info(&adapter->pdev->dev, "online testing starting\n"); - /* Online tests */ - if (igb_link_test(adapter, &data[4])) - eth_test->flags |= ETH_TEST_FL_FAILED; + + /* PHY is powered down when interface is down */ + if (!netif_carrier_ok(netdev)) { + data[4] = 0; + } else { + if (igb_link_test(adapter, &data[4])) + eth_test->flags |= ETH_TEST_FL_FAILED; + } /* Online tests aren't run; pass by default */ data[0] = 0; |