aggressive power management for cdc-ether
Subsystems (6)
Oliver Neukum
maintainerHi,
this implements usb autosuspend for online cdc-ether devices that support remote wakeup? What do you think?
Regards
Oliver
--
commit 956c214d266fc1764ceb931b039c7aadded4eb24
Author: Oliver Neukum <[email protected]> Date: Mon Oct 19 15:07:54 2009 +0200
usb:usbnet&cdc-ether:full aggressive autosuspend
autosuspend for cdc-ether devices while online if the device supports remote wakeup
drivers/net/usb/cdc_ether.c +8 -0
@@ -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 ,
@@ -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, };/*-------------------------------------------------------------------------*/
@@ -570,6 +577,7 @@ static struct usb_driver cdc_driver = { .disconnect = usbnet_disconnect, .suspend = usbnet_suspend, .resume = usbnet_resume, + .supports_autosuspend = 1, };
drivers/net/usb/usbnet.c +100 -29
232 lines not on this page · raw message
include/linux/usb/usbnet.h +6 -0
@@ -55,6 +55,7 @@ struct usbnet {struct sk_buff_head done;struct sk_buff_head rxq_pause;struct urb *interrupt; +struct urb *deferred;struct tasklet_struct bh;struct work_struct kevent;
@@ -65,6 +66,8 @@ struct usbnet {# define EVENT_STS_SPLIT 3# define EVENT_LINK_RESET 4# define EVENT_RX_PAUSED 5 +# define EVENT_DEV_WAKING 6 +# define EVENT_DEV_ASLEEP 7 };static inline struct usb_driver *driver_of (struct usb_interface *intf)
@@ -107,6 +110,9 @@ struct driver_info {/* see if peer is connected ... can sleep */ int (*check_connect)(struct usbnet *); +/* (dis)activate runtime power management */ +int (*manage_power)(struct usbnet *,int ); +/* for status polling */ void (*status)(struct usbnet *,struct urb *);