Commit d4c89767 authored by Divya Koppera's avatar Divya Koppera Committed by Jakub Kicinski

net: phy: Add phy library support to check supported list when autoneg is enabled

Adds support in phy library to accept autoneg configuration only when
feature is enabled in supported list.
Signed-off-by: default avatarDivya Koppera <divya.koppera@microchip.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20240821055906.27717-2-Divya.Koppera@microchip.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e540e3bc
......@@ -1089,7 +1089,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
if (autoneg != AUTONEG_ENABLE && autoneg != AUTONEG_DISABLE)
return -EINVAL;
if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising))
if (autoneg == AUTONEG_ENABLE &&
(linkmode_empty(advertising) ||
!linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
phydev->supported)))
return -EINVAL;
if (autoneg == AUTONEG_DISABLE &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment