Skip to content

Commit d4c8976

Browse files
Divya-Kopperakuba-moo
authored andcommitted
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: Divya Koppera <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e540e3b commit d4c8976

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/phy/phy.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,10 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
10891089
if (autoneg != AUTONEG_ENABLE && autoneg != AUTONEG_DISABLE)
10901090
return -EINVAL;
10911091

1092-
if (autoneg == AUTONEG_ENABLE && linkmode_empty(advertising))
1092+
if (autoneg == AUTONEG_ENABLE &&
1093+
(linkmode_empty(advertising) ||
1094+
!linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
1095+
phydev->supported)))
10931096
return -EINVAL;
10941097

10951098
if (autoneg == AUTONEG_DISABLE &&

0 commit comments

Comments
 (0)