aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarveshwar Bandi <sarveshwarb@serverengines.com>2010-01-19 00:15:36 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-22 01:49:51 -0500
commit4276e47e2d1c85a2477caf0d22b91c4f2377fba8 (patch)
treec69c198c067ffd559e68adb66441eeb1fea370c3
parent8f47afe080df450eedda7b29873512c2a9a9adcb (diff)
be2net: Add link test to list of ethtool self tests.
Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/benet/be_ethtool.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 2f2ebbd678f2..09d8899b2de9 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -112,6 +112,7 @@ static const char et_self_tests[][ETH_GSTRING_LEN] = {
112 "PHY Loopback test", 112 "PHY Loopback test",
113 "External Loopback test", 113 "External Loopback test",
114 "DDR DMA test" 114 "DDR DMA test"
115 "Link test"
115}; 116};
116 117
117#define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests) 118#define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests)
@@ -529,6 +530,9 @@ static void
529be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data) 530be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
530{ 531{
531 struct be_adapter *adapter = netdev_priv(netdev); 532 struct be_adapter *adapter = netdev_priv(netdev);
533 bool link_up;
534 u8 mac_speed = 0;
535 u16 qos_link_speed = 0;
532 536
533 memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM); 537 memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);
534 538
@@ -552,6 +556,13 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
552 test->flags |= ETH_TEST_FL_FAILED; 556 test->flags |= ETH_TEST_FL_FAILED;
553 } 557 }
554 558
559 if (be_cmd_link_status_query(adapter, &link_up, &mac_speed,
560 &qos_link_speed) != 0) {
561 test->flags |= ETH_TEST_FL_FAILED;
562 data[4] = -1;
563 } else if (mac_speed) {
564 data[4] = 1;
565 }
555} 566}
556 567
557static int 568static int