87eed649ec37f4f82015da1b17a05fc94fb14e22
[openwrt/staging/xback.git] /
1 From 6420a569504e212d618d4a4736e2c59ed80a8478 Mon Sep 17 00:00:00 2001
2 From: Lech Perczak <lech.perczak@gmail.com>
3 Date: Sun, 7 Feb 2021 01:54:43 +0100
4 Subject: USB: serial: option: update interface mapping for ZTE P685M
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This patch prepares for qmi_wwan driver support for the device.
10 Previously "option" driver mapped itself to interfaces 0 and 3 (matching
11 ff/ff/ff), while interface 3 is in fact a QMI port.
12 Interfaces 1 and 2 (matching ff/00/00) expose AT commands,
13 and weren't supported previously at all.
14 Without this patch, a possible conflict would exist if device ID was
15 added to qmi_wwan driver for interface 3.
16
17 Update and simplify device ID to match interfaces 0-2 directly,
18 to expose QCDM (0), PCUI (1), and modem (2) ports and avoid conflict
19 with QMI (3), and ADB (4).
20
21 The modem is used inside ZTE MF283+ router and carriers identify it as
22 such.
23 Interface mapping is:
24 0: QCDM, 1: AT (PCUI), 2: AT (Modem), 3: QMI, 4: ADB
25
26 T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 3 Spd=480 MxCh= 0
27 D: Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
28 P: Vendor=19d2 ProdID=1275 Rev=f0.00
29 S: Manufacturer=ZTE,Incorporated
30 S: Product=ZTE Technologies MSM
31 S: SerialNumber=P685M510ZTED0000CP&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&0
32 C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
33 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
34 E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
35 E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
36 I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
37 E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
38 E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
39 E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
40 I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
41 E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
42 E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
43 E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
44 I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
45 E: Ad=87(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
46 E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
47 E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
48 I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
49 E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
50 E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
51
52 Cc: Johan Hovold <johan@kernel.org>
53 Cc: Bjørn Mork <bjorn@mork.no>
54 Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
55 Link: https://lore.kernel.org/r/20210207005443.12936-1-lech.perczak@gmail.com
56 Cc: stable@vger.kernel.org
57 Signed-off-by: Johan Hovold <johan@kernel.org>
58 ---
59 drivers/usb/serial/option.c | 3 ++-
60 1 file changed, 2 insertions(+), 1 deletion(-)
61
62 --- a/drivers/usb/serial/option.c
63 +++ b/drivers/usb/serial/option.c
64 @@ -1569,7 +1569,8 @@ static const struct usb_device_id option
65 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) },
66 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) },
67 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1274, 0xff, 0xff, 0xff) },
68 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1275, 0xff, 0xff, 0xff) },
69 + { USB_DEVICE(ZTE_VENDOR_ID, 0x1275), /* ZTE P685M */
70 + .driver_info = RSVD(3) | RSVD(4) },
71 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1276, 0xff, 0xff, 0xff) },
72 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1277, 0xff, 0xff, 0xff) },
73 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1278, 0xff, 0xff, 0xff) },