Skip to content

Commit 9c02ea5

Browse files
Niklas Söderlundkuba-moo
authored andcommitted
net: sh_eth: Disable WoL if system can not suspend
The MAC can't facilitate WoL if the system can't go to sleep. Gate the WoL support callbacks in ethtool at compile time using CONFIG_PM_SLEEP. Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 38611e5 commit 9c02ea5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,6 +2360,7 @@ static int sh_eth_set_ringparam(struct net_device *ndev,
23602360
return 0;
23612361
}
23622362

2363+
#ifdef CONFIG_PM_SLEEP
23632364
static void sh_eth_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
23642365
{
23652366
struct sh_eth_private *mdp = netdev_priv(ndev);
@@ -2386,6 +2387,7 @@ static int sh_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
23862387

23872388
return 0;
23882389
}
2390+
#endif
23892391

23902392
static const struct ethtool_ops sh_eth_ethtool_ops = {
23912393
.get_regs_len = sh_eth_get_regs_len,
@@ -2401,8 +2403,10 @@ static const struct ethtool_ops sh_eth_ethtool_ops = {
24012403
.set_ringparam = sh_eth_set_ringparam,
24022404
.get_link_ksettings = phy_ethtool_get_link_ksettings,
24032405
.set_link_ksettings = phy_ethtool_set_link_ksettings,
2406+
#ifdef CONFIG_PM_SLEEP
24042407
.get_wol = sh_eth_get_wol,
24052408
.set_wol = sh_eth_set_wol,
2409+
#endif
24062410
};
24072411

24082412
/* network device open function */

0 commit comments

Comments
 (0)