diff options
author | Dan Williams <dcbw@redhat.com> | 2013-05-06 07:29:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-08 16:13:29 -0400 |
commit | 6eecdc5f95a393cb558503123eae9a9a6642e835 (patch) | |
tree | 80898f0029def8f64ce43837cc6c60010ba17efe /include/linux/usb | |
parent | 7fdb7846c9ca6fc06e380de0976a1228703b498a (diff) |
usbnet: allow status interrupt URB to always be active
Some drivers (sierra_net) need the status interrupt URB
active even when the device is closed, because they receive
custom indications from firmware. Add functions to refcount
the status interrupt URB submit/kill operation so that
sub-drivers and the generic driver don't fight over whether
the status interrupt URB is active or not.
A sub-driver can call usbnet_status_start() at any time, but
the URB is only submitted the first time the function is
called. Likewise, when the sub-driver is done with the URB,
it calls usbnet_status_stop() but the URB is only killed when
all users have stopped it. The URB is still killed and
re-submitted for suspend/resume, as before, with the same
refcount it had at suspend.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/usbnet.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index da46327fca17..f18d64129f99 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -56,6 +56,8 @@ struct usbnet { | |||
56 | struct sk_buff_head done; | 56 | struct sk_buff_head done; |
57 | struct sk_buff_head rxq_pause; | 57 | struct sk_buff_head rxq_pause; |
58 | struct urb *interrupt; | 58 | struct urb *interrupt; |
59 | unsigned interrupt_count; | ||
60 | struct mutex interrupt_mutex; | ||
59 | struct usb_anchor deferred; | 61 | struct usb_anchor deferred; |
60 | struct tasklet_struct bh; | 62 | struct tasklet_struct bh; |
61 | 63 | ||
@@ -248,4 +250,7 @@ extern int usbnet_nway_reset(struct net_device *net); | |||
248 | extern int usbnet_manage_power(struct usbnet *, int); | 250 | extern int usbnet_manage_power(struct usbnet *, int); |
249 | extern void usbnet_link_change(struct usbnet *, bool, bool); | 251 | extern void usbnet_link_change(struct usbnet *, bool, bool); |
250 | 252 | ||
253 | extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags); | ||
254 | extern void usbnet_status_stop(struct usbnet *dev); | ||
255 | |||
251 | #endif /* __LINUX_USB_USBNET_H */ | 256 | #endif /* __LINUX_USB_USBNET_H */ |