aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy-core.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-core.c
parentnet: ethernet: Convert phydev advertize and supported from u32 to link mode (diff)
downloadlinux-dev-c0ec3c2736774c69bf5c641aea7712132c0f0eba.tar.xz
linux-dev-c0ec3c2736774c69bf5c641aea7712132c0f0eba.zip
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-core.c')
-rw-r--r--drivers/net/phy/phy-core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index 9d192b660b07..2c3a13d1c421 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -199,11 +199,8 @@ size_t phy_speeds(unsigned int *speeds, size_t size,
void phy_resolve_aneg_linkmode(struct phy_device *phydev)
{
__ETHTOOL_DECLARE_LINK_MODE_MASK(common);
- __ETHTOOL_DECLARE_LINK_MODE_MASK(lp);
- ethtool_convert_legacy_u32_to_link_mode(lp, phydev->lp_advertising);
-
- linkmode_and(common, lp, phydev->advertising);
+ linkmode_and(common, phydev->lp_advertising, phydev->advertising);
if (linkmode_test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, common)) {
phydev->speed = SPEED_10000;
@@ -235,9 +232,11 @@ void phy_resolve_aneg_linkmode(struct phy_device *phydev)
}
if (phydev->duplex == DUPLEX_FULL) {
- phydev->pause = !!(phydev->lp_advertising & ADVERTISED_Pause);
- phydev->asym_pause = !!(phydev->lp_advertising &
- ADVERTISED_Asym_Pause);
+ phydev->pause = linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
+ phydev->lp_advertising);
+ phydev->asym_pause = linkmode_test_bit(
+ ETHTOOL_LINK_MODE_Asym_Pause_BIT,
+ phydev->lp_advertising);
}
}
EXPORT_SYMBOL_GPL(phy_resolve_aneg_linkmode);