From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: [PATCH ethtool 2/3] ethtool: Add support for WAKE_FILTER (WoL using filters) Date: Wed, 8 Aug 2018 11:22:10 -0700 Message-ID: <20180808182211.24921-3-f.fainelli@gmail.com> References: <20180808182211.24921-1-f.fainelli@gmail.com> Cc: linville@tuxdriver.com, andrew@lunn.ch, davem@davemloft.net, Florian Fainelli To: netdev@vger.kernel.org Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:55929 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729758AbeHHUnV (ORCPT ); Wed, 8 Aug 2018 16:43:21 -0400 Received: by mail-wm0-f68.google.com with SMTP id f21-v6so3693112wmc.5 for ; Wed, 08 Aug 2018 11:22:28 -0700 (PDT) In-Reply-To: <20180808182211.24921-1-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Add a new character 'f' which can be used to configure an Ethernet controller to support Wake-on-LAN using filters programmed with the ethtool::rxnfc and the special action -2 (wake-up filter). This is useful in particular in the context of devices that must support wake-up on more complex patterns such as multicast DNS packets. Signed-off-by: Florian Fainelli --- ethtool.8.in | 4 +++- ethtool.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ethtool.8.in b/ethtool.8.in index 0a366aa536ae..97c7330fd373 100644 --- a/ethtool.8.in +++ b/ethtool.8.in @@ -58,7 +58,7 @@ .\" .\" \(*WO - wol flags .\" -.ds WO \fBp\fP|\fBu\fP|\fBm\fP|\fBb\fP|\fBa\fP|\fBg\fP|\fBs\fP|\fBd\fP... +.ds WO \fBp\fP|\fBu\fP|\fBm\fP|\fBb\fP|\fBa\fP|\fBg\fP|\fBs\fP|\fBf|\fBd\fP... .\" .\" \(*FL - flow type values .\" @@ -679,6 +679,7 @@ b Wake on broadcast messages a Wake on ARP g Wake on MagicPacket\[tm] s Enable SecureOn\[tm] password for MagicPacket\[tm] +f Wake on filter(s) d T{ Disable (wake on nothing). This option clears all previous options. T} @@ -870,6 +871,7 @@ Specifies the Rx queue to send packets to, or some other action. nokeep; lB l. -1 Drop the matched flow +-2 Use the matched flow as a Wake-on-LAN filter 0 or higher Rx queue to route the flow .TE .TP diff --git a/ethtool.c b/ethtool.c index fb93ae898312..aa2bbe9e4c65 100644 --- a/ethtool.c +++ b/ethtool.c @@ -931,6 +931,9 @@ static int parse_wolopts(char *optstr, u32 *data) case 's': *data |= WAKE_MAGICSECURE; break; + case 'f': + *data |= WAKE_FILTER; + break; case 'd': *data = 0; break; @@ -964,6 +967,8 @@ static char *unparse_wolopts(int wolopts) *p++ = 'g'; if (wolopts & WAKE_MAGICSECURE) *p++ = 's'; + if (wolopts & WAKE_FILTER) + *p++ = 'f'; } else { *p = 'd'; } -- 2.17.1