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:

committed by
David S. Miller

parent
3c1bcc8614
commit
c0ec3c2736
@@ -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)
|
||||
|
Reference in New Issue
Block a user