Skip to content

Commit efb3ecd

Browse files
committed
Merge tag 'usb-serial-5.5-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus
Johan writes: USB-serial fixes for 5.5-rc5 Here's a couple of new modem device ids, including a new quirk for devices that expect zero-length packets. Due to the holidays, only the first one has been in linux-next and with no reported issues. Signed-off-by: Johan Hovold <[email protected]> * tag 'usb-serial-5.5-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add ZLP support for 0x1bc7/0x9010 USB: serial: option: add Telit ME910G1 0x110a composition
2 parents 5041a58 + 2438c3a commit efb3ecd

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

drivers/usb/serial/option.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ static void option_instat_callback(struct urb *urb);
567567
/* Interface must have two endpoints */
568568
#define NUMEP2 BIT(16)
569569

570+
/* Device needs ZLP */
571+
#define ZLP BIT(17)
572+
570573

571574
static const struct usb_device_id option_ids[] = {
572575
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
@@ -1172,6 +1175,8 @@ static const struct usb_device_id option_ids[] = {
11721175
.driver_info = NCTRL(0) | RSVD(3) },
11731176
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1102, 0xff), /* Telit ME910 (ECM) */
11741177
.driver_info = NCTRL(0) },
1178+
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110a, 0xff), /* Telit ME910G1 */
1179+
.driver_info = NCTRL(0) | RSVD(3) },
11751180
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
11761181
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
11771182
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
@@ -1196,6 +1201,8 @@ static const struct usb_device_id option_ids[] = {
11961201
.driver_info = NCTRL(0) | RSVD(1) },
11971202
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff), /* Telit LN940 (MBIM) */
11981203
.driver_info = NCTRL(0) },
1204+
{ USB_DEVICE(TELIT_VENDOR_ID, 0x9010), /* Telit SBL FN980 flashing device */
1205+
.driver_info = NCTRL(0) | ZLP },
11991206
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
12001207
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff),
12011208
.driver_info = RSVD(1) },
@@ -2097,6 +2104,9 @@ static int option_attach(struct usb_serial *serial)
20972104
if (!(device_flags & NCTRL(iface_desc->bInterfaceNumber)))
20982105
data->use_send_setup = 1;
20992106

2107+
if (device_flags & ZLP)
2108+
data->use_zlp = 1;
2109+
21002110
spin_lock_init(&data->susp_lock);
21012111

21022112
usb_set_serial_data(serial, data);

drivers/usb/serial/usb-wwan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct usb_wwan_intf_private {
3838
spinlock_t susp_lock;
3939
unsigned int suspended:1;
4040
unsigned int use_send_setup:1;
41+
unsigned int use_zlp:1;
4142
int in_flight;
4243
unsigned int open_ports;
4344
void *private;

drivers/usb/serial/usb_wwan.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port,
461461
void (*callback) (struct urb *))
462462
{
463463
struct usb_serial *serial = port->serial;
464+
struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
464465
struct urb *urb;
465466

466467
urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
@@ -471,6 +472,9 @@ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port,
471472
usb_sndbulkpipe(serial->dev, endpoint) | dir,
472473
buf, len, callback, ctx);
473474

475+
if (intfdata->use_zlp && dir == USB_DIR_OUT)
476+
urb->transfer_flags |= URB_ZERO_PACKET;
477+
474478
return urb;
475479
}
476480

0 commit comments

Comments
 (0)