mirror of https://gitee.com/openkylin/linux.git
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:
parent
6dbd0090f9
commit
9db299c736
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue