Commit 9db299c7 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: phy: Fix ioctl handler when modifing MII_ADVERTISE

When the MII_ADVERTISE register is modified by the IOCTL handler,
phydev->advertising needs recalculating. Use the _mod_ variant of
mii_adv_to_linkmode_adv_t so that bits outside of the advertise
registers are not cleared.

Fixes: c0ec3c27 ("net: phy: Convert u32 phydev->lp_advertising to linkmode")
Reported-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6dbd0090
...@@ -437,8 +437,8 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd) ...@@ -437,8 +437,8 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
} }
break; break;
case MII_ADVERTISE: case MII_ADVERTISE:
mii_adv_to_linkmode_adv_t(phydev->advertising, mii_adv_mod_linkmode_adv_t(phydev->advertising,
val); val);
change_autoneg = true; change_autoneg = true;
break; break;
default: default:
......
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