looking for testers for CDC EEM runtime power management
Subsystems (6)
Hi,
this patch implements runtime power management for CDC EEM. I lack the hardware and need testers.
Regards
Oliver
Quoted 1 line
From
b9e2ecb3a81c122d37528af4283d9e2ebbb43d23Mon Sep 17 00:00:00 2001
From: Oliver Neukum <[email protected]>
Date: Sat, 25 Dec 2010 14:25:45 +0100
Subject: [PATCH] cdc_eem: runtime power management
This patch grants CDC EEM devices which request to be suspended their wish.
Signed-off-by Oliver Neukum <[email protected]>
--- drivers/net/usb/cdc_eem.c | 2 ++ drivers/net/usb/usbnet.c | 20 ++++++++++++++++++++ include/linux/usb/usbnet.h | 2 ++ 3 files changed, 24 insertions(+), 0 deletions(-)
drivers/net/usb/cdc_eem.c +2 -0
@@ -245,6 +245,8 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)* - response complete: suggest N sec polling */ case 2 :/* Suspend hint */ +usbnet_notify_idle (dev); +continue ;case 3 :/* Response hint */ case 4 :/* Response complete hint */ continue ;
drivers/net/usb/usbnet.c +20 -0
@@ -1201,6 +1201,24 @@ static void usbnet_bh (unsigned long param) } } +/*-------------------------------------------------------------------------*/ + +/* +* Some devices notify the host of an idle condition +* this makes use of this information +*/ + +void usbnet_notify_idle (struct usbnet *dev) +{ +int r; + +if (!test_and_set_bit (EVENT_REP_IDLE , &dev->flags)) { + r =usb_autopm_get_interface_async (dev->intf); +if (r <0 ) +clear_bit (EVENT_REP_IDLE , &dev->flags); + } +} +EXPORT_SYMBOL_GPL (usbnet_notify_idle);/*------------------------------------------------------------------------- *
@@ -1495,6 +1513,8 @@ int usbnet_resume (struct usb_interface *intf)spin_unlock_irq (&dev->txq.lock);if (!(dev->txq.qlen >=TX_QLEN (dev)))netif_start_queue (dev->net); +if (test_and_clear_bit (EVENT_REP_IDLE , &dev->flags)) +usb_autopm_get_interface_no_resume (intf);tasklet_schedule (&dev->bh); }return 0 ;
include/linux/usb/usbnet.h +2 -0
@@ -68,6 +68,7 @@ struct usbnet {# define EVENT_RX_PAUSED 5# define EVENT_DEV_WAKING 6# define EVENT_DEV_ASLEEP 7 +# define EVENT_REP_IDLE 8 };static inline struct usb_driver *driver_of (struct usb_interface *intf)
@@ -205,6 +206,7 @@ extern void usbnet_unlink_rx_urbs(struct usbnet *);extern void usbnet_pause_rx (struct usbnet *);extern void usbnet_resume_rx (struct usbnet *);extern void usbnet_purge_paused_rxq (struct usbnet *); +extern void usbnet_notify_idle (struct usbnet *);extern int usbnet_get_settings (struct net_device *net,struct ethtool_cmd *cmd);
Signature · 6 lines
1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html