提交 bd8e012b 编写于 作者: Y Yuval Mintz 提交者: David S. Miller

bnx2x: Test nvram when interface is down

Since commit 3fb43eb2 ("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: NYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: NAriel Elior <ariele@broadcom.com>
Signed-off-by: NEilon Greenstein <eilong@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 aa661581
...@@ -2900,9 +2900,16 @@ static void bnx2x_self_test(struct net_device *dev, ...@@ -2900,9 +2900,16 @@ static void bnx2x_self_test(struct net_device *dev,
memset(buf, 0, sizeof(u64) * BNX2X_NUM_TESTS(bp)); memset(buf, 0, sizeof(u64) * BNX2X_NUM_TESTS(bp));
if (bnx2x_test_nvram(bp) != 0) {
if (!IS_MF(bp))
buf[4] = 1;
else
buf[0] = 1;
etest->flags |= ETH_TEST_FL_FAILED;
}
if (!netif_running(dev)) { if (!netif_running(dev)) {
DP(BNX2X_MSG_ETHTOOL, DP(BNX2X_MSG_ETHTOOL, "Interface is down\n");
"Can't perform self-test when interface is down\n");
return; return;
} }
...@@ -2964,13 +2971,7 @@ static void bnx2x_self_test(struct net_device *dev, ...@@ -2964,13 +2971,7 @@ static void bnx2x_self_test(struct net_device *dev,
/* wait until link state is restored */ /* wait until link state is restored */
bnx2x_wait_for_link(bp, link_up, is_serdes); bnx2x_wait_for_link(bp, link_up, is_serdes);
} }
if (bnx2x_test_nvram(bp) != 0) {
if (!IS_MF(bp))
buf[4] = 1;
else
buf[0] = 1;
etest->flags |= ETH_TEST_FL_FAILED;
}
if (bnx2x_test_intr(bp) != 0) { if (bnx2x_test_intr(bp) != 0) {
if (!IS_MF(bp)) if (!IS_MF(bp))
buf[5] = 1; buf[5] = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册