]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: remove redundant WoL option validation
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 15 Aug 2025 11:32:00 +0000 (12:32 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Aug 2025 01:10:11 +0000 (18:10 -0700)
The core ethtool API validates the WoL options passed from userspace
against the support which the driver reports from its get_wol() method,
returning EINVAL if an unsupported mode is requested.

Therefore, there is no need for stmmac to implement its own validation.
Remove this unnecessary code.

See ethnl_set_wol() in net/ethtool/wol.c and ethtool_set_wol() in
net/ethtool/ioctl.c.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1umsfA-008vKW-H1@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index dda7ba1f524d995d8e4725d261fe1929527c7100..cd2fb92ac84cc2926876f3f2348fb51d7214cddb 100644 (file)
@@ -803,7 +803,6 @@ 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);
-       u32 support = WAKE_MAGIC | WAKE_UCAST;
 
        if (!device_can_wakeup(priv->device))
                return -EOPNOTSUPP;
@@ -816,15 +815,6 @@ static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
                return ret;
        }
 
-       /* By default almost all GMAC devices support the WoL via
-        * magic frame but we can disable it if the HW capability
-        * register shows no support for pmt_magic_frame. */
-       if ((priv->hw_cap_support) && (!priv->dma_cap.pmt_magic_frame))
-               wol->wolopts &= ~WAKE_MAGIC;
-
-       if (wol->wolopts & ~support)
-               return -EINVAL;
-
        if (wol->wolopts) {
                pr_info("stmmac: wakeup enable\n");
                device_set_wakeup_enable(priv->device, 1);