diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-26 13:47:04 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-26 13:47:04 -0800 |
commit | 2ef3068e6c40ec44d27f6f8027616e284d1b0466 (patch) | |
tree | f4aaf6d442f7dbbe64a7744c111707680893862b /drivers/net/sfc/ethtool.c | |
parent | a5692e49cd9e6512c48ebf61e52991cbe643c12d (diff) |
sfc: Merge top-level functions for self-tests
Pass in ethtool test flags to determine which tests to run.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 3aaece6b12cc..7fa28443c7bc 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c @@ -487,7 +487,7 @@ static void efx_ethtool_self_test(struct net_device *net_dev, { struct efx_nic *efx = netdev_priv(net_dev); struct efx_self_tests efx_tests; - int offline, already_up; + int already_up; int rc; ASSERT_RTNL(); @@ -507,24 +507,15 @@ static void efx_ethtool_self_test(struct net_device *net_dev, } memset(&efx_tests, 0, sizeof(efx_tests)); - offline = (test->flags & ETH_TEST_FL_OFFLINE); - /* Perform online self tests first */ - rc = efx_online_test(efx, &efx_tests); - if (rc) - goto out; - - /* Perform offline tests only if online tests passed */ - if (offline) - rc = efx_offline_test(efx, &efx_tests, - efx->loopback_modes); + rc = efx_selftest(efx, &efx_tests, test->flags); - out: if (!already_up) dev_close(efx->net_dev); - EFX_LOG(efx, "%s all %sline self-tests\n", - rc == 0 ? "passed" : "failed", offline ? "off" : "on"); + EFX_LOG(efx, "%s %sline self-tests\n", + rc == 0 ? "passed" : "failed", + (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on"); fail2: fail1: |