OpenCloudOS-Kernel/drivers/usb/serial
Bjørn Mork 2bb70f0a4b USB: serial: option: support dynamic Quectel USB compositions
The USB composition, defining the set of exported functions, is dynamic
in newer Quectel modems.  Default functions can be disabled and
alternative functions can be enabled instead.  The alternatives
includes class functions using interface pairs, which should be
handled by the respective class drivers.

Active interfaces are numbered consecutively, so static
blacklisting based on interface numbers will fail when the
composition changes.  An example of such an error, where the
option driver has bound to the CDC ECM data interface,
preventing cdc_ether from handling this function:

 T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
 P: Vendor=2c7c ProdID=0125 Rev= 3.18
 S: Manufacturer=Quectel
 S: Product=EC25-AF
 C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
 A: FirstIf#= 4 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
 E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
 E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
 E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
 E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
 E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
 E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
 E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 4 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=(none)
 E: Ad=89(I) Atr=03(Int.) MxPS= 16 Ivl=32ms
 I:* If#= 5 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=option
 I: If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=option
 E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Another device with the same id gets correct drivers, since the
interface of the network function happens to be blacklisted by option:

 T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
 P: Vendor=2c7c ProdID=0125 Rev= 3.18
 S: Manufacturer=Android
 S: Product=Android
 C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
 E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
 E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
 E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
 E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
 E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
 E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
 E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
 E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
 E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Change rules for EC21, EC25, BG96 and EG95 to match vendor specific
serial functions only, to prevent binding to class functions. Require
2 endpoints on ff/ff/ff functions, avoiding the 3 endpoint QMI/RMNET
network functions.

Cc: AceLan Kao <acelan.kao@canonical.com>
Cc: Sebastian Sjoholm <ssjoholm@mac.com>
Cc: Dan Williams <dcbw@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Johan Hovold <johan@kernel.org>
2020-08-31 08:37:17 +02:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile-keyspan_pda_fw USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
aircable.c USB: serial: drop redundant transfer-buffer casts 2020-07-09 09:20:17 +02:00
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 USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
bus.c USB: serial: use tty_port_register_device() 2018-05-17 11:22:00 +02:00
ch341.c USB-serial updates for 5.9-rc1 2020-07-28 17:33:10 +02:00
console.c USB: serial: console: add support for flow control 2020-07-02 10:38:45 +02:00
cp210x.c USB: serial: cp210x: use in-kernel types in port data 2020-07-14 11:50:45 +02:00
cyberjack.c USB: serial: cyberjack: fix spelling mistake "To" -> "Too" 2020-01-23 09:14:52 +01:00
cypress_m8.c USB-serial updates for 5.9-rc1 2020-07-28 17:33:10 +02:00
cypress_m8.h USB: serial: cypress_m8: enable Simply Automated UPB PIM 2020-06-23 09:56:17 +02:00
digi_acceleport.c USB: serial: digi_acceleport: remove redundant assignment to pointer priv 2020-02-10 10:38:54 +01: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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
f81232.c USB: serial: only set sysrq timestamp for consoles 2020-07-09 09:19:54 +02:00
f81534.c USB: serial: only set sysrq timestamp for consoles 2020-07-09 09:19:54 +02:00
ftdi_sio.c USB: serial: ftdi_sio: add IDs for Xsens Mti USB converter 2020-08-24 10:18:30 +02:00
ftdi_sio.h USB: Fix up terminology 2020-07-01 14:04:04 +02:00
ftdi_sio_ids.h USB: serial: ftdi_sio: add IDs for Xsens Mti USB converter 2020-08-24 10:18:30 +02:00
garmin_gps.c USB: serial: garmin_gps: don't compile unused packet definitions 2020-07-02 10:38:30 +02:00
generic.c USB: serial: drop redundant transfer-buffer casts 2020-07-09 09:20:17 +02:00
io_16654.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
io_edgeport.c USB: serial: use fallthrough pseudo-keyword 2020-07-08 14:55:35 +02:00
io_edgeport.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
io_ionsp.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
io_ti.c io_ti: switch to ->get_serial() 2018-10-13 00:50:38 -04:00
io_ti.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
io_usbvend.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
ipaq.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
ipw.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
ir-usb.c USB: serial: ir-usb: Silence harmless uninitialized variable warning 2020-02-10 10:06:51 +01:00
iuu_phoenix.c USB-serial updates for 5.9-rc1 2020-07-28 17:33:10 +02:00
iuu_phoenix.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
keyspan.c USB: serial: keyspan: handle unbound ports 2020-01-17 16:22:58 +01:00
keyspan_pda.c USB: serial: keyspan_pda: drop unused firmware reset status 2020-07-02 10:38:42 +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: remove KLSI device id 2018-07-11 10:11:29 +02:00
kl5kusb105.h USB: serial: kl5kusb105: remove KLSI device id 2018-07-11 10:11:29 +02:00
kobil_sct.c USB: serial: use fallthrough pseudo-keyword 2020-07-08 14:55:35 +02:00
kobil_sct.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mct_u232.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
mct_u232.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
metro-usb.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
mos7720.c USB: serial: mos7720: fix remote wakeup 2019-11-12 09:53:07 +01:00
mos7840.c USB: serial: mos7840: drop port open flag 2019-11-12 09:57:32 +01:00
mxuport.c USB: serial: only set sysrq timestamp for consoles 2020-07-09 09:19:54 +02:00
navman.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
omninet.c docs: usb: rename files to .rst and add them to drivers-api 2019-06-20 14:28:36 +02:00
opticon.c Here are the USB-serial updates for 5.6-rc1, including: 2020-01-27 10:21:22 +01:00
option.c USB: serial: option: support dynamic Quectel USB compositions 2020-08-31 08:37:17 +02: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 USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
pl2303.c USB: serial: only set sysrq timestamp for consoles 2020-07-09 09:19:54 +02:00
pl2303.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
qcaux.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00
qcserial.c USB: serial: qcserial: add EM7305 QDL product ID 2020-07-21 09:25:52 +02:00
quatech2.c USB: serial: quatech2: drop two stub functions 2020-07-02 10:38:44 +02:00
safe_serial.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
sierra.c USB: serial: sierra: clean up special-interface handling 2020-07-14 11:50:57 +02:00
spcp8x5.c USB: serial: spcp8x5: simplify init_termios 2019-04-26 08:38:02 +02:00
ssu100.c USB: serial: drop redundant transfer-buffer casts 2020-07-09 09:20:17 +02:00
symbolserial.c USB: serial: symbolserial: use irqsave() in USB's complete callback 2018-06-26 15:25:01 +02:00
ti_usb_3410_5052.c USB: Replace zero-length array with flexible-array member 2020-02-23 19:24:51 +01:00
upd78f0730.c USB: serial: use fallthrough pseudo-keyword 2020-07-08 14:55:35 +02:00
usb-serial-simple.c USB: serial: simple: Add Motorola Solutions TETRA MTP3xxx and MTP85xx 2020-01-13 15:04:35 +01:00
usb-serial.c USB: serial: fix tty cleanup-op kernel-doc 2020-03-11 09:39:01 +01:00
usb-wwan.h USB: serial: option: add ZLP support for 0x1bc7/0x9010 2019-12-20 12:07:12 +01:00
usb_debug.c USB: serial: usb_debug: add new USB device id 2017-11-28 09:54:11 +01:00
usb_wwan.c USB: serial: usb_wwan: do not resubmit rx urb on fatal errors 2020-05-19 09:46:06 +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 USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
whiteheat.c USB: serial: whiteheat: fix line-speed endianness 2019-10-30 10:06:32 +01:00
whiteheat.h USB: serial: Use the correct style for SPDX License Identifier 2020-04-22 09:26:47 +02:00
wishbone-serial.c USB: serial: Remove redundant license text 2017-11-04 11:55:38 +01:00
xsens_mt.c USB: serial: fix module-license macros 2017-11-04 11:58:00 +01:00