summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorElina Pasheva <epasheva@sierrawireless.com>2009-04-22 02:54:42 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-23 23:15:29 +0200
commit212b8f0c3f5a2280bfa1d6ab13a6fe98552becaa (patch)
tree08875427c9515dc0b22d515a94f1010c724eab71 /drivers
parentUSB: gadget: omap_udc uses platform_driver_probe() (diff)
downloadlinux-212b8f0c3f5a2280bfa1d6ab13a6fe98552becaa.tar.xz
linux-212b8f0c3f5a2280bfa1d6ab13a6fe98552becaa.zip
USB: serial: sierra driver bug fix for composite interface
This patch fixes a problem in sierra_send_setup() function when composite devices are used. One should not be sending ACM commands to interfaces that are OBEX. Doing this causes an apparent failure as the ACM command has to time out before the interface can start being used. Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/sierra.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index d9bf9a5c20ec..7da3775a097e 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -14,7 +14,7 @@
Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org>
*/
-#define DRIVER_VERSION "v.1.3.2"
+#define DRIVER_VERSION "v.1.3.3"
#define DRIVER_AUTHOR "Kevin Lloyd <klloyd@sierrawireless.com>"
#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
@@ -259,9 +259,21 @@ static int sierra_send_setup(struct tty_struct *tty,
val |= 0x02;
/* If composite device then properly report interface */
- if (serial->num_ports == 1)
+ if (serial->num_ports == 1) {
interface = sierra_calc_interface(serial);
+ /* Control message is sent only to interfaces with
+ * interrupt_in endpoints
+ */
+ if (port->interrupt_in_urb) {
+ /* send control message */
+ return usb_control_msg(serial->dev,
+ usb_rcvctrlpipe(serial->dev, 0),
+ 0x22, 0x21, val, interface,
+ NULL, 0, USB_CTRL_SET_TIMEOUT);
+ }
+ }
+
/* Otherwise the need to do non-composite mapping */
else {
if (port->bulk_out_endpointAddress == 2)
@@ -270,12 +282,13 @@ static int sierra_send_setup(struct tty_struct *tty,
interface = 1;
else if (port->bulk_out_endpointAddress == 5)
interface = 2;
- }
- return usb_control_msg(serial->dev,
+ return usb_control_msg(serial->dev,
usb_rcvctrlpipe(serial->dev, 0),
0x22, 0x21, val, interface,
NULL, 0, USB_CTRL_SET_TIMEOUT);
+
+ }
}
return 0;