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
@@ -368,9 +368,7 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev,
|
||||
{
|
||||
linkmode_copy(cmd->link_modes.supported, phydev->supported);
|
||||
linkmode_copy(cmd->link_modes.advertising, phydev->advertising);
|
||||
|
||||
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.lp_advertising,
|
||||
phydev->lp_advertising);
|
||||
linkmode_copy(cmd->link_modes.lp_advertising, phydev->lp_advertising);
|
||||
|
||||
cmd->base.speed = phydev->speed;
|
||||
cmd->base.duplex = phydev->duplex;
|
||||
@@ -549,7 +547,7 @@ int phy_start_aneg(struct phy_device *phydev)
|
||||
phy_sanitize_settings(phydev);
|
||||
|
||||
/* Invalidate LP advertising flags */
|
||||
phydev->lp_advertising = 0;
|
||||
linkmode_zero(phydev->lp_advertising);
|
||||
|
||||
err = phy_config_aneg(phydev);
|
||||
if (err < 0)
|
||||
@@ -610,7 +608,7 @@ int phy_speed_down(struct phy_device *phydev, bool sync)
|
||||
return 0;
|
||||
|
||||
linkmode_copy(adv_old, phydev->advertising);
|
||||
ethtool_convert_legacy_u32_to_link_mode(adv, phydev->lp_advertising);
|
||||
linkmode_copy(adv, phydev->lp_advertising);
|
||||
linkmode_and(adv, adv, phydev->supported);
|
||||
|
||||
if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, adv) ||
|
||||
|
Reference in New Issue
Block a user