aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/cdc_ether.c
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2009-12-03 18:31:18 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-03 18:31:18 -0500
commit69ee472f2706371ca639de49b06df91615c07d8d (patch)
tree3f6de524e96679a2e54b55bb0ba9d1fd71c8222c /drivers/net/usb/cdc_ether.c
parent7f515790274d26d710303b7a1f23571ca93a6288 (diff)
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 197912d9c04..21e183a83b9 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)
411 return 0; 411 return 0;
412} 412}
413 413
414static int cdc_manage_power(struct usbnet *dev, int on)
415{
416 dev->intf->needs_remote_wakeup = on;
417 return 0;
418}
419
414static const struct driver_info cdc_info = { 420static const struct driver_info cdc_info = {
415 .description = "CDC Ethernet Device", 421 .description = "CDC Ethernet Device",
416 .flags = FLAG_ETHER | FLAG_LINK_INTR, 422 .flags = FLAG_ETHER | FLAG_LINK_INTR,
@@ -418,6 +424,7 @@ static const struct driver_info cdc_info = {
418 .bind = cdc_bind, 424 .bind = cdc_bind,
419 .unbind = usbnet_cdc_unbind, 425 .unbind = usbnet_cdc_unbind,
420 .status = cdc_status, 426 .status = cdc_status,
427 .manage_power = cdc_manage_power,
421}; 428};
422 429
423static const struct driver_info mbm_info = { 430static const struct driver_info mbm_info = {
@@ -619,6 +626,7 @@ static struct usb_driver cdc_driver = {
619 .suspend = usbnet_suspend, 626 .suspend = usbnet_suspend,
620 .resume = usbnet_resume, 627 .resume = usbnet_resume,
621 .reset_resume = usbnet_resume, 628 .reset_resume = usbnet_resume,
629 .supports_autosuspend = 1,
622}; 630};
623 631
624 632