diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-26 13:47:25 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-26 13:47:25 -0800 |
commit | 1796721a5a691a5d392abf8070ad40a0b787b667 (patch) | |
tree | 16ed5a5a8c77db9e8f70c9b23f6b26cde491c336 /drivers/net/sfc/selftest.c | |
parent | 2ef3068e6c40ec44d27f6f8027616e284d1b0466 (diff) | |
download | talos-op-linux-1796721a5a691a5d392abf8070ad40a0b787b667.tar.gz talos-op-linux-1796721a5a691a5d392abf8070ad40a0b787b667.zip |
sfc: Add support for multiple PHY self-tests
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/selftest.c')
-rw-r--r-- | drivers/net/sfc/selftest.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index d10f6fbbb5ce..dba0d64d50cd 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c @@ -247,17 +247,20 @@ static int efx_test_eventq_irq(struct efx_channel *channel, return 0; } -static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests) +static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests, + unsigned flags) { int rc; - if (!efx->phy_op->test) + if (!efx->phy_op->run_tests) return 0; + EFX_BUG_ON_PARANOID(efx->phy_op->num_tests == 0 || + efx->phy_op->num_tests > EFX_MAX_PHY_TESTS); + mutex_lock(&efx->mac_lock); - rc = efx->phy_op->test(efx); + rc = efx->phy_op->run_tests(efx, tests->phy, flags); mutex_unlock(&efx->mac_lock); - tests->phy = rc ? -1 : 1; return rc; } @@ -691,7 +694,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, return rc_test; if (!(flags & ETH_TEST_FL_OFFLINE)) - return 0; + return efx_test_phy(efx, tests, flags); /* Offline (i.e. disruptive) testing * This checks MAC and PHY loopback on the specified port. */ @@ -739,7 +742,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, return rc_reset; } - rc = efx_test_phy(efx, tests); + rc = efx_test_phy(efx, tests, flags); if (rc && !rc_test) rc_test = rc; |