summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/cdc_ether.c
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2009-12-03 15:31:18 -0800
committerDavid S. Miller <davem@davemloft.net>2009-12-03 15:31:18 -0800
commit69ee472f2706371ca639de49b06df91615c07d8d (patch)
tree3f6de524e96679a2e54b55bb0ba9d1fd71c8222c /drivers/net/usb/cdc_ether.c
parent7f515790274d26d710303b7a1f23571ca93a6288 (diff)
downloadlinux-69ee472f2706371ca639de49b06df91615c07d8d.tar.gz
linux-69ee472f2706371ca639de49b06df91615c07d8d.tar.bz2
linux-69ee472f2706371ca639de49b06df91615c07d8d.zip
usbnet & cdc-ether: Autosuspend for online devices
Using remote wakeup and delayed transmission to allow online device to go into usb autosuspend. Minimal alternate support for devices that don't support remote wakeup. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/cdc_ether.c')
-rw-r--r--drivers/net/usb/cdc_ether.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 197912d9c04a..21e183a83b99 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -411,6 +411,12 @@ static int cdc_bind(struct usbnet *dev, struct usb_interface *intf)
return 0;
}
+static int cdc_manage_power(struct usbnet *dev, int on)
+{
+ dev->intf->needs_remote_wakeup = on;
+ return 0;
+}
+
static const struct driver_info cdc_info = {
.description = "CDC Ethernet Device",
.flags = FLAG_ETHER | FLAG_LINK_INTR,
@@ -418,6 +424,7 @@ static const struct driver_info cdc_info = {
.bind = cdc_bind,
.unbind = usbnet_cdc_unbind,
.status = cdc_status,
+ .manage_power = cdc_manage_power,
};
static const struct driver_info mbm_info = {
@@ -619,6 +626,7 @@ static struct usb_driver cdc_driver = {
.suspend = usbnet_suspend,
.resume = usbnet_resume,
.reset_resume = usbnet_resume,
+ .supports_autosuspend = 1,
};