net: phy: Convert u32 phydev->lp_advertising to linkmode

Convert phy drivers to report the link partner advertised modes using
a linkmode bitmap. This allows them to report the higher speeds which
don't fit in a u32.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrew Lunn
2018-11-10 23:43:34 +01:00
committed by David S. Miller
parent 3c1bcc8614
commit c0ec3c2736
10 changed files with 72 additions and 41 deletions

View File

@@ -1702,7 +1702,7 @@ int genphy_read_status(struct phy_device *phydev)
if (err)
return err;
phydev->lp_advertising = 0;
linkmode_zero(phydev->lp_advertising);
if (AUTONEG_ENABLE == phydev->autoneg) {
if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
@@ -1725,8 +1725,8 @@ int genphy_read_status(struct phy_device *phydev)
return -ENOLINK;
}
phydev->lp_advertising =
mii_stat1000_to_ethtool_lpa_t(lpagb);
mii_stat1000_to_linkmode_lpa_t(phydev->lp_advertising,
lpagb);
common_adv_gb = lpagb & adv << 2;
}
@@ -1734,7 +1734,7 @@ int genphy_read_status(struct phy_device *phydev)
if (lpa < 0)
return lpa;
phydev->lp_advertising |= mii_lpa_to_ethtool_lpa_t(lpa);
mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising, lpa);
adv = phy_read(phydev, MII_ADVERTISE);
if (adv < 0)