Skip to content

Commit

Permalink
usbnet: pegasus: set wakeup enable in set_wol
Browse files Browse the repository at this point in the history
This patch calls device_set_wakeup_enable() inside set_wol
callback, so that turning on WOL from user mode utility
can make the 'wakeup' of pegasus device to be enabled, then
remote wakeup may be enabled before putting into sleep.

Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Petko Manolov <petkan@users.sourceforge.net>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ming Lei authored and David S. Miller committed Jan 21, 2013
1 parent 546bfed commit 4fbc5b2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
pegasus_t *pegasus = netdev_priv(dev);
u8 reg78 = 0x04;
int ret;

if (wol->wolopts & ~WOL_SUPPORTED)
return -EINVAL;
Expand All @@ -1111,7 +1112,12 @@ pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
else
pegasus->eth_regs[0] &= ~0x10;
pegasus->wolopts = wol->wolopts;
return set_register(pegasus, WakeupControl, reg78);

ret = set_register(pegasus, WakeupControl, reg78);
if (!ret)
ret = device_set_wakeup_enable(&pegasus->usb->dev,
wol->wolopts);
return ret;
}

static inline void pegasus_reset_wol(struct net_device *dev)
Expand Down

0 comments on commit 4fbc5b2

Please sign in to comment.