Skip to content

Commit

Permalink
sfc: Fix conditions for MDIO self-test
Browse files Browse the repository at this point in the history
The MDIO self-test should not be run on boards without an MDIO PHY,
such as SFN5122F-R3 and later revisions.  It should also not try to
address a specific MMD in an MDIO clause 22 PHY.  Check the
mode_support field to decide which mode to use, if any.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Jan 14, 2010
1 parent 55029c1 commit f3766c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/sfc/selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ struct efx_loopback_state {
static int efx_test_mdio(struct efx_nic *efx, struct efx_self_tests *tests)
{
int rc = 0;
int devad = __ffs(efx->mdio.mmds);
int devad;
u16 physid1, physid2;

if (efx->phy_type == PHY_TYPE_NONE)
if (efx->mdio.mode_support & MDIO_SUPPORTS_C45)
devad = __ffs(efx->mdio.mmds);
else if (efx->mdio.mode_support & MDIO_SUPPORTS_C22)
devad = MDIO_DEVAD_NONE;
else
return 0;

mutex_lock(&efx->mac_lock);
Expand Down

0 comments on commit f3766c2

Please sign in to comment.