]> git.ipfire.org Git - thirdparty/linux.git/commit
net: stmmac: convert to phylink-managed Wake-on-Lan
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 23 Oct 2025 09:16:50 +0000 (10:16 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 25 Oct 2025 01:52:08 +0000 (18:52 -0700)
commit6911308d7d111a9c367293b52f2dc265819f2b60
tree6c2409ac2781d8f40a2dca77bb88b643088585ae
parentdc1a2a9ce5b2c80e02115ff6fb29b726ad9d7777
net: stmmac: convert to phylink-managed Wake-on-Lan

Convert stmmac to use phylink-managed Wake-on-Lan support. To achieve
this, we implement the .mac_wol_set() method, which simply configures
the driver model's struct device wakeup for stmmac, and sets the
priv->wolopts appropriately.

When STMMAC_FLAG_USE_PHY_WOL is set, in the stmmac world this means to
only use the PHY's WoL support and ignore the MAC's WoL capabilities.
To preserve this behaviour, we enable phylink's legacy mode, and avoid
telling phylink that the MAC has any WoL support. This achieves the
same functionality for this case.

When STMMAC_FLAG_USE_PHY_WOL is not set, we provide the MAC's WoL
capabilities to phylink, which then allows phylink to choose between
the PHY and MAC for WoL depending on their individual capabilities
as described in the phylink commit. This only augments the WoL
functionality with PHYs that declare to the driver model that they are
wake-up capable. Currently, very few PHY drivers support this.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vBrRC-0000000BLzg-2tA4@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c