diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2013-09-28 01:46:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-28 18:23:58 -0400 |
commit | bd8e012b5d369933f50842294372ed580f5d9605 (patch) | |
tree | b4758e15d9dc09e26a929cf80888295008d60a45 /drivers/net | |
parent | aa6615814533c634190019ee3a5b10490026d545 (diff) |
bnx2x: Test nvram when interface is down
Since commit 3fb43eb ("bnx2x: Change to D3hot only on removal") nvram
is accessible whenever the driver is loaded - Thus it is possible to
test it during self-test even if the interface is down
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 324de5f05332..120966c5f1cf 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -2900,9 +2900,16 @@ static void bnx2x_self_test(struct net_device *dev, | |||
2900 | 2900 | ||
2901 | memset(buf, 0, sizeof(u64) * BNX2X_NUM_TESTS(bp)); | 2901 | memset(buf, 0, sizeof(u64) * BNX2X_NUM_TESTS(bp)); |
2902 | 2902 | ||
2903 | if (bnx2x_test_nvram(bp) != 0) { | ||
2904 | if (!IS_MF(bp)) | ||
2905 | buf[4] = 1; | ||
2906 | else | ||
2907 | buf[0] = 1; | ||
2908 | etest->flags |= ETH_TEST_FL_FAILED; | ||
2909 | } | ||
2910 | |||
2903 | if (!netif_running(dev)) { | 2911 | if (!netif_running(dev)) { |
2904 | DP(BNX2X_MSG_ETHTOOL, | 2912 | DP(BNX2X_MSG_ETHTOOL, "Interface is down\n"); |
2905 | "Can't perform self-test when interface is down\n"); | ||
2906 | return; | 2913 | return; |
2907 | } | 2914 | } |
2908 | 2915 | ||
@@ -2964,13 +2971,7 @@ static void bnx2x_self_test(struct net_device *dev, | |||
2964 | /* wait until link state is restored */ | 2971 | /* wait until link state is restored */ |
2965 | bnx2x_wait_for_link(bp, link_up, is_serdes); | 2972 | bnx2x_wait_for_link(bp, link_up, is_serdes); |
2966 | } | 2973 | } |
2967 | if (bnx2x_test_nvram(bp) != 0) { | 2974 | |
2968 | if (!IS_MF(bp)) | ||
2969 | buf[4] = 1; | ||
2970 | else | ||
2971 | buf[0] = 1; | ||
2972 | etest->flags |= ETH_TEST_FL_FAILED; | ||
2973 | } | ||
2974 | if (bnx2x_test_intr(bp) != 0) { | 2975 | if (bnx2x_test_intr(bp) != 0) { |
2975 | if (!IS_MF(bp)) | 2976 | if (!IS_MF(bp)) |
2976 | buf[5] = 1; | 2977 | buf[5] = 1; |