summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-11-10 23:43:34 +0100
committerDavid S. Miller <davem@davemloft.net>2018-11-11 10:10:01 -0800
commitc0ec3c2736774c69bf5c641aea7712132c0f0eba (patch)
tree882122cf62a93a87d94036062c5fc5dcd4a7a606 /drivers/net/phy/phy.c
parent3c1bcc8614db10803f1f57ef0295363917448cb2 (diff)
downloadlinux-c0ec3c2736774c69bf5c641aea7712132c0f0eba.tar.bz2
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>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ecc8a7d5306c..d73873334e47 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -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) ||