aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2018-09-28 19:18:50 -0400
committerDavid S. Miller <davem@davemloft.net>2018-09-29 14:31:29 -0400
commitc4ce446e33d7a0e978256ac6fea4c80e59d9de5f (patch)
tree0339448adb913db070464114eb725f4409fd1488
parent982d608f0f6a9f2700f1a2b35538d686898f78ae (diff)
asix: Check for supported Wake-on-LAN modes
The driver currently silently accepts unsupported Wake-on-LAN modes (other than WAKE_PHY or WAKE_MAGIC) without reporting that to the user, which is confusing. Fixes: 2e55cc7210fe ("[PATCH] USB: usbnet (3/9) module for ASIX Ethernet adapters") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/asix_common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c
index e95dd12edec4..023b8d0bf175 100644
--- a/drivers/net/usb/asix_common.c
+++ b/drivers/net/usb/asix_common.c
@@ -607,6 +607,9 @@ int asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
607 struct usbnet *dev = netdev_priv(net); 607 struct usbnet *dev = netdev_priv(net);
608 u8 opt = 0; 608 u8 opt = 0;
609 609
610 if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC))
611 return -EINVAL;
612
610 if (wolinfo->wolopts & WAKE_PHY) 613 if (wolinfo->wolopts & WAKE_PHY)
611 opt |= AX_MONITOR_LINK; 614 opt |= AX_MONITOR_LINK;
612 if (wolinfo->wolopts & WAKE_MAGIC) 615 if (wolinfo->wolopts & WAKE_MAGIC)