aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/pegasus.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-01-18 20:32:01 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-20 23:11:57 -0500
commit4fbc5b20e2715997a1b5e634543e8cac9aa36d4c (patch)
tree2725ff67837bcac30cefdf3e7e763d52eda62d41 /drivers/net/usb/pegasus.c
parent546bfedbe604baeb5a03736593bb95c9aa56bcfa (diff)
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 <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>
Diffstat (limited to 'drivers/net/usb/pegasus.c')
-rw-r--r--drivers/net/usb/pegasus.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 3c02f950a3d2..8ee5ab0db127 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)
1097{ 1097{
1098 pegasus_t *pegasus = netdev_priv(dev); 1098 pegasus_t *pegasus = netdev_priv(dev);
1099 u8 reg78 = 0x04; 1099 u8 reg78 = 0x04;
1100 int ret;
1100 1101
1101 if (wol->wolopts & ~WOL_SUPPORTED) 1102 if (wol->wolopts & ~WOL_SUPPORTED)
1102 return -EINVAL; 1103 return -EINVAL;
@@ -1111,7 +1112,12 @@ pegasus_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
1111 else 1112 else
1112 pegasus->eth_regs[0] &= ~0x10; 1113 pegasus->eth_regs[0] &= ~0x10;
1113 pegasus->wolopts = wol->wolopts; 1114 pegasus->wolopts = wol->wolopts;
1114 return set_register(pegasus, WakeupControl, reg78); 1115
1116 ret = set_register(pegasus, WakeupControl, reg78);
1117 if (!ret)
1118 ret = device_set_wakeup_enable(&pegasus->usb->dev,
1119 wol->wolopts);
1120 return ret;
1115} 1121}
1116 1122
1117static inline void pegasus_reset_wol(struct net_device *dev) 1123static inline void pegasus_reset_wol(struct net_device *dev)