usbnet: generic manage_power()
authorOliver Neukum <oliver@neukum.org>
Tue, 18 Dec 2012 04:45:52 +0000 (04:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2012 20:46:40 +0000 (12:46 -0800)
Centralise common code for manage_power() in usbnet
by making a generic simple implementation

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/usbnet.c
include/linux/usb/usbnet.h

index 50ed7ab09c9f2628984727784a66d534db7ab153..3d4bf01641b49f0f7c5d820a547885806378c4e2 100644 (file)
@@ -1616,6 +1616,16 @@ void usbnet_device_suggests_idle(struct usbnet *dev)
 }
 EXPORT_SYMBOL(usbnet_device_suggests_idle);
 
+/*
+ * For devices that can do without special commands
+ */
+int usbnet_manage_power(struct usbnet *dev, int on)
+{
+       dev->intf->needs_remote_wakeup = on;
+       return 0;
+}
+EXPORT_SYMBOL(usbnet_manage_power);
+
 /*-------------------------------------------------------------------------*/
 static int __usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
                             u16 value, u16 index, void *data, u16 size)
index 288b32aadab29df211c53410af2e788a0f15d220..bd45eb7bedc8f365ab70704c552e93041af4ac94 100644 (file)
@@ -241,4 +241,6 @@ extern void usbnet_set_msglevel(struct net_device *, u32);
 extern void usbnet_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
 extern int usbnet_nway_reset(struct net_device *net);
 
+extern int usbnet_manage_power(struct usbnet *, int);
+
 #endif /* __LINUX_USB_USBNET_H */