summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/genet/bcmgenet.c
diff options
context:
space:
mode:
authorDoug Berger <opendmb@gmail.com>2020-04-29 13:02:06 -0700
committerDavid S. Miller <davem@davemloft.net>2020-04-29 16:55:22 -0700
commitf50932cca632fb87ab4de678ecc7c3b41116140b (patch)
treed63fb5a41d1119191c34da30b03f8595d11906b2 /drivers/net/ethernet/broadcom/genet/bcmgenet.c
parent3e370952287c55e5fd240cb8bb41ef8acff8829d (diff)
downloadlinux-f50932cca632fb87ab4de678ecc7c3b41116140b.tar.bz2
net: bcmgenet: add WAKE_FILTER support
This commit enables support for the WAKE_FILTER method of Wake on LAN for the GENET driver. The method can be enabled by adding 'f' to the interface 'wol' setting specified by ethtool. Rx network flow rules can be specified using ethtool. Rules that define a flow-type with the RX_CLS_FLOW_WAKE action (i.e. -2) can wake the system from the 'standby' power state when the WAKE_FILTER WoL method is enabled. Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/genet/bcmgenet.c')
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 5ef1ea7e5312..ad614d7201bd 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -724,7 +724,7 @@ static int bcmgenet_hfb_create_rxnfc_filter(struct bcmgenet_priv *priv,
break;
}
- if (!fs->ring_cookie) {
+ if (!fs->ring_cookie || fs->ring_cookie == RX_CLS_FLOW_WAKE) {
/* Ring 0 flows can be handled by the default Descriptor Ring
* We'll map them to ring 0, but don't enable the filter
*/
@@ -1499,7 +1499,8 @@ static int bcmgenet_insert_flow(struct net_device *dev,
return -EINVAL;
}
- if (cmd->fs.ring_cookie > priv->hw_params->rx_queues) {
+ if (cmd->fs.ring_cookie > priv->hw_params->rx_queues &&
+ cmd->fs.ring_cookie != RX_CLS_FLOW_WAKE) {
netdev_err(dev, "rxnfc: Unsupported action (%llu)\n",
cmd->fs.ring_cookie);
return -EINVAL;