Commit eb9ad088 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

lan78xx: Check for supported Wake-on-LAN modes

The driver supports a fair amount of Wake-on-LAN modes, but is not
checking that the user specified one that is supported.

Fixes: 55d7de9d ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarWoojung Huh <Woojung.Huh@Microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5ba6b4aa
...@@ -1401,19 +1401,10 @@ static int lan78xx_set_wol(struct net_device *netdev, ...@@ -1401,19 +1401,10 @@ static int lan78xx_set_wol(struct net_device *netdev,
if (ret < 0) if (ret < 0)
return ret; return ret;
pdata->wol = 0; if (wol->wolopts & ~WAKE_ALL)
if (wol->wolopts & WAKE_UCAST) return -EINVAL;
pdata->wol |= WAKE_UCAST;
if (wol->wolopts & WAKE_MCAST) pdata->wol = wol->wolopts;
pdata->wol |= WAKE_MCAST;
if (wol->wolopts & WAKE_BCAST)
pdata->wol |= WAKE_BCAST;
if (wol->wolopts & WAKE_MAGIC)
pdata->wol |= WAKE_MAGIC;
if (wol->wolopts & WAKE_PHY)
pdata->wol |= WAKE_PHY;
if (wol->wolopts & WAKE_ARP)
pdata->wol |= WAKE_ARP;
device_set_wakeup_enable(&dev->udev->dev, (bool)wol->wolopts); device_set_wakeup_enable(&dev->udev->dev, (bool)wol->wolopts);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment