Commit 4276e47e authored by Sarveshwar Bandi's avatar Sarveshwar Bandi Committed by David S. Miller

be2net: Add link test to list of ethtool self tests.

Signed-off-by: default avatarSarveshwar Bandi <sarveshwarb@serverengines.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f47afe0
...@@ -112,6 +112,7 @@ static const char et_self_tests[][ETH_GSTRING_LEN] = { ...@@ -112,6 +112,7 @@ static const char et_self_tests[][ETH_GSTRING_LEN] = {
"PHY Loopback test", "PHY Loopback test",
"External Loopback test", "External Loopback test",
"DDR DMA test" "DDR DMA test"
"Link test"
}; };
#define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests) #define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests)
...@@ -529,6 +530,9 @@ static void ...@@ -529,6 +530,9 @@ static void
be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data) be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
{ {
struct be_adapter *adapter = netdev_priv(netdev); struct be_adapter *adapter = netdev_priv(netdev);
bool link_up;
u8 mac_speed = 0;
u16 qos_link_speed = 0;
memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM); memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);
...@@ -552,6 +556,13 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data) ...@@ -552,6 +556,13 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
test->flags |= ETH_TEST_FL_FAILED; test->flags |= ETH_TEST_FL_FAILED;
} }
if (be_cmd_link_status_query(adapter, &link_up, &mac_speed,
&qos_link_speed) != 0) {
test->flags |= ETH_TEST_FL_FAILED;
data[4] = -1;
} else if (mac_speed) {
data[4] = 1;
}
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment