Skip to content

Commit 4276e47

Browse files
Sarveshwar Bandidavem330
authored andcommitted
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>
1 parent 8f47afe commit 4276e47

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/net/benet/be_ethtool.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ static const char et_self_tests[][ETH_GSTRING_LEN] = {
112112
"PHY Loopback test",
113113
"External Loopback test",
114114
"DDR DMA test"
115+
"Link test"
115116
};
116117

117118
#define ETHTOOL_TESTS_NUM ARRAY_SIZE(et_self_tests)
@@ -529,6 +530,9 @@ static void
529530
be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
530531
{
531532
struct be_adapter *adapter = netdev_priv(netdev);
533+
bool link_up;
534+
u8 mac_speed = 0;
535+
u16 qos_link_speed = 0;
532536

533537
memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);
534538

@@ -552,6 +556,13 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data)
552556
test->flags |= ETH_TEST_FL_FAILED;
553557
}
554558

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+
}
555566
}
556567

557568
static int

0 commit comments

Comments
 (0)