]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: phylink: set the autoneg state in phylink_phy_change
authorIoana Ciornei <ioana.ciornei@nxp.com>
Thu, 13 Jun 2019 06:37:51 +0000 (09:37 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Jun 2019 20:29:32 +0000 (13:29 -0700)
The phy_state field of phylink should carry only valid information
especially when this can be passed to the .mac_config callback.
Update the an_enabled field with the autoneg state in the
phylink_phy_change function.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c

index 4c0616ba314d37048baba87bfdec125d9abd1114..c638e13fbf81d5c447b1751823baebb65a634929 100644 (file)
@@ -635,6 +635,7 @@ static void phylink_phy_change(struct phy_device *phydev, bool up,
                pl->phy_state.pause |= MLO_PAUSE_ASYM;
        pl->phy_state.interface = phydev->interface;
        pl->phy_state.link = up;
+       pl->phy_state.an_enabled = phydev->autoneg;
        mutex_unlock(&pl->state_mutex);
 
        phylink_run_resolve(pl);