Skip to content

Commit 00b022f

Browse files
jlintonarmkuba-moo
authored andcommitted
net: bcmgenet: Don't claim WOL when its not available
Some of the bcmgenet platforms don't correctly support WOL, yet ethtool returns: "Supports Wake-on: gsf" which is false. Ideally if there isn't a wol_irq, or there is something else that keeps the device from being able to wakeup it should display: "Supports Wake-on: d" This patch checks whether the device can wakup, before using the hard-coded supported flags. This corrects the ethtool reporting, as well as the WOL configuration because ethtool verifies that the mode is supported before attempting it. Fixes: c51de7f ("net: bcmgenet: add Wake-on-LAN support code") Signed-off-by: Jeremy Linton <[email protected]> Tested-by: Peter Robinson <[email protected]> Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bc0e610 commit 00b022f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
4141
{
4242
struct bcmgenet_priv *priv = netdev_priv(dev);
43+
struct device *kdev = &priv->pdev->dev;
44+
45+
if (!device_can_wakeup(kdev)) {
46+
wol->supported = 0;
47+
wol->wolopts = 0;
48+
return;
49+
}
4350

4451
wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;
4552
wol->wolopts = priv->wolopts;

0 commit comments

Comments
 (0)