1
0
Fork 0
alistair23-linux/drivers/usb/serial
Bjørn Mork 013d2d0465 USB: serial: option: fix Quectel BG96 matching
commit c98fff7332 upstream.

This is a partial revert of commit 2bb70f0a4b ("USB: serial:
option: support dynamic Quectel USB compositions")

The Quectel BG96 is different from most other modern Quectel modems,
having serial functions with 3 endpoints using ff/ff/ff and ff/fe/ff
class/subclass/protocol. Including it in the change to accommodate
dynamic function mapping was incorrect.

Revert to interface number matching for the BG96, assuming static
layout of the RMNET function on interface 4. This restores support
for the serial functions on interfaces 2 and 3.

Full lsusb output for the BG96:

Bus 002 Device 003: ID 2c7c:0296
Device Descriptor:
 bLength                18
 bDescriptorType         1
 bcdUSB               2.00
 bDeviceClass            0 (Defined at Interface level)
 bDeviceSubClass         0
 bDeviceProtocol         0
 bMaxPacketSize0        64
 idVendor           0x2c7c
 idProduct          0x0296
 bcdDevice            0.00
 iManufacturer           3 Qualcomm, Incorporated
 iProduct                2 Qualcomm CDMA Technologies MSM
 iSerial                 4 d1098243
 bNumConfigurations      1
 Configuration Descriptor:
   bLength                 9
   bDescriptorType         2
   wTotalLength          145
   bNumInterfaces          5
   bConfigurationValue     1
   iConfiguration          1 Qualcomm Configuration
   bmAttributes         0xe0
     Self Powered
     Remote Wakeup
   MaxPower              500mA
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        0
     bAlternateSetting       0
     bNumEndpoints           2
     bInterfaceClass       255 Vendor Specific Class
     bInterfaceSubClass    255 Vendor Specific Subclass
     bInterfaceProtocol    255 Vendor Specific Protocol
     iInterface              0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x81  EP 1 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x01  EP 1 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        1
     bAlternateSetting       0
     bNumEndpoints           2
     bInterfaceClass       255 Vendor Specific Class
     bInterfaceSubClass    255 Vendor Specific Subclass
     bInterfaceProtocol    255 Vendor Specific Protocol
     iInterface              0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x82  EP 2 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x02  EP 2 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        2
     bAlternateSetting       0
     bNumEndpoints           3
     bInterfaceClass       255 Vendor Specific Class
     bInterfaceSubClass    255 Vendor Specific Subclass
     bInterfaceProtocol    255 Vendor Specific Protocol
     iInterface              0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x83  EP 3 IN
       bmAttributes            3
         Transfer Type            Interrupt
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               5
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x84  EP 4 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x03  EP 3 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        3
     bAlternateSetting       0
     bNumEndpoints           3
     bInterfaceClass       255 Vendor Specific Class
     bInterfaceSubClass    254
     bInterfaceProtocol    255
     iInterface              0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x85  EP 5 IN
       bmAttributes            3
         Transfer Type            Interrupt
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               5
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x86  EP 6 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x04  EP 4 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
   Interface Descriptor:
     bLength                 9
     bDescriptorType         4
     bInterfaceNumber        4
     bAlternateSetting       0
     bNumEndpoints           3
     bInterfaceClass       255 Vendor Specific Class
     bInterfaceSubClass    255 Vendor Specific Subclass
     bInterfaceProtocol    255 Vendor Specific Protocol
     iInterface              0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x87  EP 7 IN
       bmAttributes            3
         Transfer Type            Interrupt
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0040  1x 64 bytes
       bInterval               5
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x88  EP 8 IN
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
     Endpoint Descriptor:
       bLength                 7
       bDescriptorType         5
       bEndpointAddress     0x05  EP 5 OUT
       bmAttributes            2
         Transfer Type            Bulk
         Synch Type               None
         Usage Type               Data
       wMaxPacketSize     0x0200  1x 512 bytes
       bInterval               0
Device Qualifier (for other device speed):
 bLength                10
 bDescriptorType         6
 bcdUSB               2.00
 bDeviceClass            0 (Defined at Interface level)
 bDeviceSubClass         0
 bDeviceProtocol         0
 bMaxPacketSize0        64
 bNumConfigurations      1
Device Status:     0x0000
 (Bus Powered)

Cc: Sebastian Sjoholm <sebastian.sjoholm@gmail.com>
Fixes: 2bb70f0a4b ("USB: serial: option: support dynamic Quectel USB compositions")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-11 13:23:28 +01:00
..
Kconfig docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
Makefile
Makefile-keyspan_pda_fw
aircable.c
ark3116.c USB: serial: ark3116: drop redundant init_termios 2019-04-26 08:37:53 +02:00
belkin_sa.c docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
belkin_sa.h docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
bus.c
ch341.c USB: serial: ch341: sort device-id entries 2020-12-11 13:23:27 +01:00
console.c USB: serial: console: fix reported terminal settings 2018-12-05 11:29:10 +01:00
cp210x.c USB: serial: cp210x: enable usb generic throttle/unthrottle 2020-08-19 08:16:23 +02:00
cyberjack.c USB: serial: cyberjack: fix write-URB completion race 2020-11-10 12:37:32 +01:00
cypress_m8.c USB: serial: cypress_m8: enable Simply Automated UPB PIM 2020-07-22 09:33:10 +02:00
cypress_m8.h USB: serial: cypress_m8: enable Simply Automated UPB PIM 2020-07-22 09:33:10 +02:00
digi_acceleport.c USB: serial: digi_acceleport: clean up set_termios 2019-04-21 14:24:12 +02:00
empeg.c docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
ezusb_convert.pl
f81232.c USB: serial: f81232: implement break control 2019-05-03 09:19:55 +02:00
f81534.c USB: serial: f81534: fix reading old/new IC config 2018-11-20 18:25:44 +01:00
ftdi_sio.c USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters 2020-10-17 10:11:23 +02:00
ftdi_sio.h USB: serial: ftdi_sio: add support for FT232R CBUS gpios 2018-10-05 08:57:06 +02:00
ftdi_sio_ids.h USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters 2020-10-17 10:11:23 +02:00
garmin_gps.c USB: serial: garmin_gps: add sanity checking for data length 2020-05-14 07:58:25 +02:00
generic.c USB: serial: drop unnecessary goto 2019-04-30 10:25:04 +02:00
io_16654.h
io_edgeport.c USB: serial: io_edgeport: fix slab-out-of-bounds read in edge_interrupt_callback 2020-04-01 11:02:15 +02:00
io_edgeport.h
io_ionsp.h
io_ti.c io_ti: switch to ->get_serial() 2018-10-13 00:50:38 -04:00
io_ti.h
io_usbvend.h
ipaq.c
ipw.c
ir-usb.c USB: serial: ir-usb: fix IrLAP framing 2020-02-01 09:34:32 +00:00
iuu_phoenix.c USB: serial: iuu_phoenix: fix led-activity helpers 2020-08-19 08:16:14 +02:00
iuu_phoenix.h
keyspan.c USB: serial: keyspan: handle unbound ports 2020-01-23 08:22:34 +01:00
keyspan_pda.c docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
keyspan_usa26msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa28msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa49msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa67msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
keyspan_usa90msg.h USB: serial: keyspan_usa: add proper SPDX lines for .h files 2019-01-18 11:09:32 +01:00
kl5kusb105.c USB: serial: kl5kusb105: fix memleak on open 2020-12-11 13:23:27 +01:00
kl5kusb105.h
kobil_sct.c
kobil_sct.h
mct_u232.c
mct_u232.h
metro-usb.c
mos7720.c USB: serial: mos7720: fix remote wakeup 2019-11-29 10:10:26 +01:00
mos7840.c USB: serial: mos7840: fix remote wakeup 2019-11-29 10:10:27 +01:00
mxuport.c
navman.c
omninet.c docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
opticon.c USB: serial: opticon: fix control-message timeouts 2020-01-23 08:22:34 +01:00
option.c USB: serial: option: fix Quectel BG96 matching 2020-12-11 13:23:28 +01:00
oti6858.c docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
oti6858.h
pl2303.c USB: serial: pl2303: add device-id for HP GC device 2020-10-17 10:11:23 +02:00
pl2303.h USB: serial: pl2303: add device-id for HP GC device 2020-10-17 10:11:23 +02:00
qcaux.c
qcserial.c USB: serial: qcserial: add EM7305 QDL product ID 2020-08-11 15:33:32 +02:00
quatech2.c USB: serial: quatech2: handle unbound ports 2020-01-23 08:22:35 +01:00
safe_serial.c
sierra.c
spcp8x5.c USB: serial: spcp8x5: simplify init_termios 2019-04-26 08:38:02 +02:00
ssu100.c ssu100: switch to ->get_serial() 2018-10-13 00:50:41 -04:00
symbolserial.c
ti_usb_3410_5052.c USB: serial: ti_usb_3410_5052: clean up serial data access 2019-10-16 10:29:23 +02:00
upd78f0730.c
usb-serial-simple.c USB: serial: simple: Add Motorola Solutions TETRA MTP3xxx and MTP85xx 2020-01-23 08:22:33 +01:00
usb-serial.c USB: serial: suppress driver bind attributes 2020-01-23 08:22:34 +01:00
usb-wwan.h USB: serial: option: add ZLP support for 0x1bc7/0x9010 2020-01-14 20:08:30 +01:00
usb_debug.c
usb_wwan.c USB: serial: usb_wwan: do not resubmit rx urb on fatal errors 2020-06-10 20:24:55 +02:00
visor.c docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
visor.h docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
whiteheat.c USB: serial: whiteheat: fix line-speed endianness 2019-10-30 10:06:32 +01:00
whiteheat.h USB: serial: whiteheat: fix line-speed endianness 2019-10-30 10:06:32 +01:00
wishbone-serial.c
xsens_mt.c