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: c0ec3c2736 ("net: phy: Convert u32 phydev->lp_advertising to linkmode")
Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrew Lunn 2018-12-05 21:49:45 +01:00 committed by David S. Miller
parent 6dbd0090f9
commit 9db299c736
1 changed files with 2 additions and 2 deletions

View File

@ -437,8 +437,8 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd)
}
break;
case MII_ADVERTISE:
mii_adv_to_linkmode_adv_t(phydev->advertising,
val);
mii_adv_mod_linkmode_adv_t(phydev->advertising,
val);
change_autoneg = true;
break;
default: