aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/mdio_10g.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c
index f131ad2b6832..f6a16428113d 100644
--- a/drivers/net/sfc/mdio_10g.c
+++ b/drivers/net/sfc/mdio_10g.c
@@ -368,13 +368,16 @@ void mdio_clause45_get_settings_ext(struct efx_nic *efx,
368 } else 368 } else
369 ecmd->autoneg = AUTONEG_DISABLE; 369 ecmd->autoneg = AUTONEG_DISABLE;
370 370
371 /* If AN is enabled and complete, report best common mode */ 371 if (ecmd->autoneg) {
372 if (ecmd->autoneg && 372 /* If AN is complete, report best common mode,
373 (mdio_clause45_read(efx, phy_id, MDIO_MMD_AN, MDIO_MMDREG_STAT1) & 373 * otherwise report best advertised mode. */
374 (1 << MDIO_AN_STATUS_AN_DONE_LBN))) { 374 u32 common = ecmd->advertising;
375 u32 common, lpa; 375 if (mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
376 lpa = mdio_clause45_get_an(efx, MDIO_AN_LPA, xnp_lpa); 376 MDIO_MMDREG_STAT1) &
377 common = ecmd->advertising & lpa; 377 (1 << MDIO_AN_STATUS_AN_DONE_LBN)) {
378 common &= mdio_clause45_get_an(efx, MDIO_AN_LPA,
379 xnp_lpa);
380 }
378 if (common & ADVERTISED_10000baseT_Full) { 381 if (common & ADVERTISED_10000baseT_Full) {
379 ecmd->speed = SPEED_10000; 382 ecmd->speed = SPEED_10000;
380 ecmd->duplex = DUPLEX_FULL; 383 ecmd->duplex = DUPLEX_FULL;