diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2010-07-01 09:39:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-02 01:45:57 -0400 |
commit | 8d420a1b3ea65357b6eb59e4e742248d2838e904 (patch) | |
tree | 6aa2f8e2c4442844bb0a341753a7c43835a75516 /drivers/net/igb | |
parent | c0f2276f3601a96b29d4347c5938e9494e8e4e5d (diff) |
igb: correct link test not being run when link is down
The igb online link test was always reporting pass because instead of
checking for if_running it was checking for netif_carrier_ok.
This change corrects the test so that it is run if the interface is running
instead of checking for netif carrier ok.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@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')
-rw-r--r-- | drivers/net/igb/igb_ethtool.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index f2ebf927e4bc..26bf6a13d1c1 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
@@ -1823,12 +1823,10 @@ static void igb_diag_test(struct net_device *netdev, | |||
1823 | dev_info(&adapter->pdev->dev, "online testing starting\n"); | 1823 | dev_info(&adapter->pdev->dev, "online testing starting\n"); |
1824 | 1824 | ||
1825 | /* PHY is powered down when interface is down */ | 1825 | /* PHY is powered down when interface is down */ |
1826 | if (!netif_carrier_ok(netdev)) { | 1826 | if (if_running && igb_link_test(adapter, &data[4])) |
1827 | eth_test->flags |= ETH_TEST_FL_FAILED; | ||
1828 | else | ||
1827 | data[4] = 0; | 1829 | data[4] = 0; |
1828 | } else { | ||
1829 | if (igb_link_test(adapter, &data[4])) | ||
1830 | eth_test->flags |= ETH_TEST_FL_FAILED; | ||
1831 | } | ||
1832 | 1830 | ||
1833 | /* Online tests aren't run; pass by default */ | 1831 | /* Online tests aren't run; pass by default */ |
1834 | data[0] = 0; | 1832 | data[0] = 0; |