From: Ming Lei Date: Sat, 19 Jan 2013 01:32:01 +0000 (+0000) Subject: usbnet: pegasus: set wakeup enable in set_wol X-Git-Tag: upstream/snapshot3+hdmi~5708^2~312 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fbc5b20e2715997a1b5e634543e8cac9aa36d4c;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git usbnet: pegasus: set wakeup enable in set_wol 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 Cc: Petko Manolov Signed-off-by: Ming Lei Signed-off-by: David S. Miller --- diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 3c02f95..8ee5ab0 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -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; @@ -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)