Skip to content

Commit 212b8f0

Browse files
Elina Pashevagregkh
authored andcommitted
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>
1 parent 864e28b commit 212b8f0

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

‎drivers/usb/serial/sierra.c‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org>
1515
*/
1616

17-
#define DRIVER_VERSION "v.1.3.2"
17+
#define DRIVER_VERSION "v.1.3.3"
1818
#define DRIVER_AUTHOR "Kevin Lloyd <klloyd@sierrawireless.com>"
1919
#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
2020

@@ -259,9 +259,21 @@ static int sierra_send_setup(struct tty_struct *tty,
259259
val |= 0x02;
260260

261261
/* If composite device then properly report interface */
262-
if (serial->num_ports == 1)
262+
if (serial->num_ports == 1) {
263263
interface = sierra_calc_interface(serial);
264264

265+
/* Control message is sent only to interfaces with
266+
* interrupt_in endpoints
267+
*/
268+
if (port->interrupt_in_urb) {
269+
/* send control message */
270+
return usb_control_msg(serial->dev,
271+
usb_rcvctrlpipe(serial->dev, 0),
272+
0x22, 0x21, val, interface,
273+
NULL, 0, USB_CTRL_SET_TIMEOUT);
274+
}
275+
}
276+
265277
/* Otherwise the need to do non-composite mapping */
266278
else {
267279
if (port->bulk_out_endpointAddress == 2)
@@ -270,12 +282,13 @@ static int sierra_send_setup(struct tty_struct *tty,
270282
interface = 1;
271283
else if (port->bulk_out_endpointAddress == 5)
272284
interface = 2;
273-
}
274285

275-
return usb_control_msg(serial->dev,
286+
return usb_control_msg(serial->dev,
276287
usb_rcvctrlpipe(serial->dev, 0),
277288
0x22, 0x21, val, interface,
278289
NULL, 0, USB_CTRL_SET_TIMEOUT);
290+
291+
}
279292
}
280293

281294
return 0;

0 commit comments

Comments
 (0)