summaryrefslogtreecommitdiff
path: root/drivers/net/usb/asix_common.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-09-29 21:31:30 +0300
committerDavid S. Miller <davem@davemloft.net>2018-09-29 21:31:30 +0300
commit418b9a353a821f5d1787fd310d2af31232e9ff32 (patch)
tree99eb3b37a0ed4201fb5ec88b0d78f07f5de92efb /drivers/net/usb/asix_common.c
parent982d608f0f6a9f2700f1a2b35538d686898f78ae (diff)
parentc530c471ba37bdd9fe1c7185b01455c00ae606fb (diff)
downloadlinux-418b9a353a821f5d1787fd310d2af31232e9ff32.tar.xz
Merge branch 'net-usb-Check-for-Wake-on-LAN-modes'
Florian Fainelli says: ==================== net: usb: Check for Wake-on-LAN modes Most of our USB Ethernet drivers don't seem to be checking properly whether the user is supplying a correct Wake-on-LAN mode to enter, so the experience as an user could be confusing, since it would generally lead to either no wake-up, or the device not being marked for wake-up. Please review! Changes in v2: - fixed lan78xx handling, thanks Woojung! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/asix_common.c')
-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)
struct usbnet *dev = netdev_priv(net);
u8 opt = 0;
+ if (wolinfo->wolopts & ~(WAKE_PHY | WAKE_MAGIC))
+ return -EINVAL;
+
if (wolinfo->wolopts & WAKE_PHY)
opt |= AX_MONITOR_LINK;
if (wolinfo->wolopts & WAKE_MAGIC)