mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
net: stmmac: convert to phylink managed WoL PHY speed
Convert stmmac to use phylink's management of the PHY speed when Wake-on-Lan is enabled. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1vBrRH-0000000BLzm-3JjF@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6911308d7d
commit
d65cb2e27e
|
|
@ -380,11 +380,6 @@ enum stmmac_state {
|
|||
|
||||
extern const struct dev_pm_ops stmmac_simple_pm_ops;
|
||||
|
||||
static inline bool stmmac_wol_enabled_phy(struct stmmac_priv *priv)
|
||||
{
|
||||
return !priv->plat->pmt && device_may_wakeup(priv->device);
|
||||
}
|
||||
|
||||
int stmmac_mdio_unregister(struct net_device *ndev);
|
||||
int stmmac_mdio_register(struct net_device *ndev);
|
||||
int stmmac_mdio_reset(struct mii_bus *mii);
|
||||
|
|
|
|||
|
|
@ -730,13 +730,8 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
|||
static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
||||
{
|
||||
struct stmmac_priv *priv = netdev_priv(dev);
|
||||
int ret;
|
||||
|
||||
ret = phylink_ethtool_set_wol(priv->phylink, wol);
|
||||
if (!ret)
|
||||
device_set_wakeup_enable(priv->device, !!wol->wolopts);
|
||||
|
||||
return ret;
|
||||
return phylink_ethtool_set_wol(priv->phylink, wol);
|
||||
}
|
||||
|
||||
static int stmmac_ethtool_op_get_eee(struct net_device *dev,
|
||||
|
|
|
|||
|
|
@ -1205,14 +1205,6 @@ static int stmmac_init_phy(struct net_device *dev)
|
|||
phylink_ethtool_set_eee(priv->phylink, &eee);
|
||||
}
|
||||
|
||||
if (!priv->plat->pmt) {
|
||||
struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
|
||||
|
||||
phylink_ethtool_get_wol(priv->phylink, &wol);
|
||||
device_set_wakeup_capable(priv->device, !!wol.supported);
|
||||
device_set_wakeup_enable(priv->device, !!wol.wolopts);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1281,6 +1273,7 @@ static int stmmac_phylink_setup(struct stmmac_priv *priv)
|
|||
config->eee_enabled_default = true;
|
||||
}
|
||||
|
||||
config->wol_phy_speed_ctrl = true;
|
||||
if (priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL) {
|
||||
config->wol_phy_legacy = true;
|
||||
} else {
|
||||
|
|
@ -7795,9 +7788,6 @@ int stmmac_suspend(struct device *dev)
|
|||
mutex_unlock(&priv->lock);
|
||||
|
||||
rtnl_lock();
|
||||
if (stmmac_wol_enabled_phy(priv))
|
||||
phylink_speed_down(priv->phylink, false);
|
||||
|
||||
phylink_suspend(priv->phylink, !!priv->wolopts);
|
||||
rtnl_unlock();
|
||||
|
||||
|
|
@ -7936,9 +7926,6 @@ int stmmac_resume(struct device *dev)
|
|||
* workqueue thread, which will race with initialisation.
|
||||
*/
|
||||
phylink_resume(priv->phylink);
|
||||
if (stmmac_wol_enabled_phy(priv))
|
||||
phylink_speed_up(priv->phylink);
|
||||
|
||||
rtnl_unlock();
|
||||
|
||||
netif_device_attach(ndev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user