summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/usb-wwan.h
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2014-05-26 17:23:20 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-27 22:04:06 (GMT)
commitc1c0180340aa73e747744abd7e06239f261d4ade (patch)
treeb2ee0e51075b1394ad96288af1d3082cda43b18e /drivers/usb/serial/usb-wwan.h
parent7436f41283ef2a45f8320ad482edd0aba1bd5843 (diff)
downloadlinux-c1c0180340aa73e747744abd7e06239f261d4ade.tar.xz
USB: usb_wwan: fix remote wakeup
Make sure that needs_remote_wake up is always set when there are open ports. Currently close() would unconditionally set needs_remote_wakeup to 0 even though there might still be open ports. This could lead to blocked input and possibly dropped data on devices that do not support remote wakeup (and which must therefore not be runtime suspended while open). Add an open_ports counter (protected by the susp_lock) and only clear needs_remote_wakeup when the last port is closed. Note that there are currently no multi-port drivers using the usb_wwan implementation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/usb-wwan.h')
-rw-r--r--drivers/usb/serial/usb-wwan.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-wwan.h b/drivers/usb/serial/usb-wwan.h
index 684739b..aca45ef 100644
--- a/drivers/usb/serial/usb-wwan.h
+++ b/drivers/usb/serial/usb-wwan.h
@@ -39,6 +39,7 @@ struct usb_wwan_intf_private {
spinlock_t susp_lock;
unsigned int suspended:1;
int in_flight;
+ unsigned int open_ports;
int (*send_setup) (struct usb_serial_port *port);
void *private;
};