aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2018-12-05 21:49:45 +0100
committerDavid S. Miller <davem@davemloft.net>2018-12-05 16:26:16 -0800
commit9db299c736eea35ea97dbc9d80a58befc067bcd8 (patch)
treef0d724457dd46954952c7db156d267beed5e1545 /drivers/net/phy/phy.c
parentnet: mii: mii_lpa_mod_linkmode_lpa_t: Make use of linkmode_mod_bit helper (diff)
downloadlinux-dev-9db299c736eea35ea97dbc9d80a58befc067bcd8.tar.xz
linux-dev-9db299c736eea35ea97dbc9d80a58befc067bcd8.zip
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: c0ec3c273677 ("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>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e1a1e54baac2..e24708f1fc16 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -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: