forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/drivers/usb/serial/option.c
....@@ -197,9 +197,6 @@
197197 #define DELL_PRODUCT_5804_MINICARD_ATT 0x819b /* Novatel E371 */
198198
199199 #define DELL_PRODUCT_5821E 0x81d7
200
-#define DELL_PRODUCT_5821E_ESIM 0x81e0
201
-#define DELL_PRODUCT_5829E_ESIM 0x81e4
202
-#define DELL_PRODUCT_5829E 0x81e6
203200
204201 #define KYOCERA_VENDOR_ID 0x0c88
205202 #define KYOCERA_PRODUCT_KPC650 0x17da
....@@ -240,7 +237,6 @@
240237 #define QUECTEL_PRODUCT_UC15 0x9090
241238 /* These u-blox products use Qualcomm's vendor ID */
242239 #define UBLOX_PRODUCT_R410M 0x90b2
243
-#define UBLOX_PRODUCT_R6XX 0x90fa
244240 /* These Yuga products use Qualcomm's vendor ID */
245241 #define YUGA_PRODUCT_CLM920_NC5 0x9625
246242
....@@ -248,14 +244,9 @@
248244 /* These Quectel products use Quectel's vendor ID */
249245 #define QUECTEL_PRODUCT_EC21 0x0121
250246 #define QUECTEL_PRODUCT_EC25 0x0125
251
-#define QUECTEL_PRODUCT_EG91 0x0191
252
-#define QUECTEL_PRODUCT_EG95 0x0195
253247 #define QUECTEL_PRODUCT_BG96 0x0296
254248 #define QUECTEL_PRODUCT_EP06 0x0306
255249 #define QUECTEL_PRODUCT_EM12 0x0512
256
-#define QUECTEL_PRODUCT_RM500Q 0x0800
257
-#define QUECTEL_PRODUCT_EC200S_CN 0x6002
258
-#define QUECTEL_PRODUCT_EC200T 0x6026
259250
260251 #define CMOTECH_VENDOR_ID 0x16d8
261252 #define CMOTECH_PRODUCT_6001 0x6001
....@@ -424,14 +415,10 @@
424415 #define CINTERION_PRODUCT_PH8 0x0053
425416 #define CINTERION_PRODUCT_AHXX 0x0055
426417 #define CINTERION_PRODUCT_PLXX 0x0060
427
-#define CINTERION_PRODUCT_EXS82 0x006c
428418 #define CINTERION_PRODUCT_PH8_2RMNET 0x0082
429419 #define CINTERION_PRODUCT_PH8_AUDIO 0x0083
430420 #define CINTERION_PRODUCT_AHXX_2RMNET 0x0084
431421 #define CINTERION_PRODUCT_AHXX_AUDIO 0x0085
432
-#define CINTERION_PRODUCT_CLS8 0x00b0
433
-#define CINTERION_PRODUCT_MV31_MBIM 0x00b3
434
-#define CINTERION_PRODUCT_MV31_RMNET 0x00b7
435422
436423 /* Olivetti products */
437424 #define OLIVETTI_VENDOR_ID 0x0b3c
....@@ -537,7 +524,6 @@
537524 /* Cellient products */
538525 #define CELLIENT_VENDOR_ID 0x2692
539526 #define CELLIENT_PRODUCT_MEN200 0x9005
540
-#define CELLIENT_PRODUCT_MPL200 0x9025
541527
542528 /* Hyundai Petatel Inc. products */
543529 #define PETATEL_VENDOR_ID 0x1ff4
....@@ -570,9 +556,6 @@
570556
571557 /* Device flags */
572558
573
-/* Highest interface number which can be used with NCTRL() and RSVD() */
574
-#define FLAG_IFNUM_MAX 7
575
-
576559 /* Interface does not support modem-control requests */
577560 #define NCTRL(ifnum) ((BIT(ifnum) & 0xff) << 8)
578561
....@@ -582,12 +565,34 @@
582565 /* Interface must have two endpoints */
583566 #define NUMEP2 BIT(16)
584567
585
-/* Device needs ZLP */
586
-#define ZLP BIT(17)
587
-
588568
589569 static const struct usb_device_id option_ids[] = {
590
- { USB_DEVICE(0x1286, 0x4e3c) },
570
+#if 1 //Added by Quectel
571
+ { USB_DEVICE(0x05C6, 0x9090) }, /* Quectel UC15 */
572
+ { USB_DEVICE(0x05C6, 0x9003) }, /* Quectel UC20 */
573
+ { USB_DEVICE(0x05C6, 0x9215) }, /* Quectel EC20(MDM9215) */
574
+ { USB_DEVICE(0x2C7C, 0x0125) }, /* Quectel EC20(MDM9x07)/EC25/EG25 */
575
+ { USB_DEVICE(0x2C7C, 0x0121) }, /* Quectel EC21 */
576
+ { USB_DEVICE(0x2C7C, 0x0191) }, /* Quectel EG91 */
577
+ { USB_DEVICE(0x2C7C, 0x0195) }, /* Quectel EG95 */
578
+ { USB_DEVICE(0x2C7C, 0x0306) }, /* Quectel EG06/EP06/EM06 */
579
+ { USB_DEVICE(0x2C7C, 0x030B) }, /* Quectel EG065K/EG060K */
580
+ { USB_DEVICE(0x2C7C, 0x0514) }, /* Quectel BL EG060K RNDIS Only */
581
+ { USB_DEVICE(0x2C7C, 0x0512) }, /* Quectel EG12/EP12/EM12/EG16/EG18 */
582
+ { USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG96 */
583
+ { USB_DEVICE(0x2C7C, 0x0700) }, /* Quectel BG95/BG77/BG600L-M3/BC69 */
584
+ { USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */
585
+ { USB_DEVICE(0x2C7C, 0x0415) }, /* Quectel AG15 */
586
+ { USB_DEVICE(0x2C7C, 0x0452) }, /* Quectel AG520 */
587
+ { USB_DEVICE(0x2C7C, 0x0455) }, /* Quectel AG550 */
588
+ { USB_DEVICE(0x2C7C, 0x0620) }, /* Quectel EG20 */
589
+ { USB_DEVICE(0x2C7C, 0x0800) }, /* Quectel RG500/RM500/RG510/RM510 */
590
+ { USB_DEVICE(0x2C7C, 0x0801) }, /* Quectel RG520/RM520/SG520 */
591
+ { USB_DEVICE(0x2C7C, 0x6026) }, /* Quectel EC200 */
592
+ { USB_DEVICE(0x2C7C, 0x6120) }, /* Quectel UC200 */
593
+ { USB_DEVICE(0x2C7C, 0x6000) }, /* Quectel EC200/UC200 */
594
+ { .match_flags = USB_DEVICE_ID_MATCH_VENDOR, .idVendor = 0x2C7C }, /* Match All Quectel Modules */
595
+#endif
591596 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
592597 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
593598 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },
....@@ -989,11 +994,6 @@
989994 { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7B) },
990995 { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7C) },
991996
992
- /* Motorola devices */
993
- { USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x2a70, 0xff, 0xff, 0xff) }, /* mdm6600 */
994
- { USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x2e0a, 0xff, 0xff, 0xff) }, /* mdm9600 */
995
- { USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x4281, 0x0a, 0x00, 0xfc) }, /* mdm ram dl */
996
- { USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x900e, 0xff, 0xff, 0xff) }, /* mdm qc dl */
997997
998998 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
999999 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
....@@ -1064,12 +1064,6 @@
10641064 { USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) },
10651065 { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E),
10661066 .driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
1067
- { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E_ESIM),
1068
- .driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
1069
- { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5829E),
1070
- .driver_info = RSVD(0) | RSVD(6) },
1071
- { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5829E_ESIM),
1072
- .driver_info = RSVD(0) | RSVD(6) },
10731067 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
10741068 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
10751069 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
....@@ -1111,21 +1105,11 @@
11111105 /* u-blox products using Qualcomm vendor ID */
11121106 { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
11131107 .driver_info = RSVD(1) | RSVD(3) },
1114
- { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R6XX),
1115
- .driver_info = RSVD(3) },
11161108 /* Quectel products using Quectel vendor ID */
1117
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff),
1118
- .driver_info = NUMEP2 },
1119
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0, 0) },
1120
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0xff, 0xff),
1121
- .driver_info = NUMEP2 },
1122
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0, 0) },
1123
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0xff, 0xff),
1124
- .driver_info = NUMEP2 },
1125
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0, 0) },
1126
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff),
1127
- .driver_info = NUMEP2 },
1128
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) },
1109
+ { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
1110
+ .driver_info = RSVD(4) },
1111
+ { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25),
1112
+ .driver_info = RSVD(4) },
11291113 { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
11301114 .driver_info = RSVD(4) },
11311115 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
....@@ -1134,15 +1118,6 @@
11341118 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
11351119 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
11361120 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1137
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0xff, 0x30) }, /* EM160R-GL */
1138
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, 0x0620, 0xff, 0, 0) },
1139
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) },
1140
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
1141
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
1142
- .driver_info = ZLP },
1143
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
1144
- { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
1145
-
11461121 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
11471122 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
11481123 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
....@@ -1190,10 +1165,6 @@
11901165 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) },
11911166 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) },
11921167 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) },
1193
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1031, 0xff), /* Telit LE910C1-EUX */
1194
- .driver_info = NCTRL(0) | RSVD(3) },
1195
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1033, 0xff), /* Telit LE910C1-EUX (ECM) */
1196
- .driver_info = NCTRL(0) },
11971168 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0),
11981169 .driver_info = RSVD(0) | RSVD(1) | NCTRL(2) | RSVD(3) },
11991170 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG1),
....@@ -1204,52 +1175,14 @@
12041175 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
12051176 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff),
12061177 .driver_info = RSVD(0) | RSVD(1) | NCTRL(2) | RSVD(3) },
1207
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1050, 0xff), /* Telit FN980 (rmnet) */
1208
- .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1209
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1051, 0xff), /* Telit FN980 (MBIM) */
1210
- .driver_info = NCTRL(0) | RSVD(1) },
1211
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1052, 0xff), /* Telit FN980 (RNDIS) */
1212
- .driver_info = NCTRL(2) | RSVD(3) },
1213
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */
1214
- .driver_info = NCTRL(0) | RSVD(1) },
1215
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */
1216
- .driver_info = NCTRL(2) | RSVD(3) },
1217
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1055, 0xff), /* Telit FN980 (PCIe) */
1218
- .driver_info = NCTRL(0) | RSVD(1) },
1219
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */
1220
- .driver_info = NCTRL(2) | RSVD(3) },
1221
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1060, 0xff), /* Telit LN920 (rmnet) */
1222
- .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1223
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1061, 0xff), /* Telit LN920 (MBIM) */
1224
- .driver_info = NCTRL(0) | RSVD(1) },
1225
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1062, 0xff), /* Telit LN920 (RNDIS) */
1226
- .driver_info = NCTRL(2) | RSVD(3) },
1227
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1063, 0xff), /* Telit LN920 (ECM) */
1228
- .driver_info = NCTRL(0) | RSVD(1) },
1229
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1070, 0xff), /* Telit FN990 (rmnet) */
1230
- .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1231
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1071, 0xff), /* Telit FN990 (MBIM) */
1232
- .driver_info = NCTRL(0) | RSVD(1) },
1233
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1072, 0xff), /* Telit FN990 (RNDIS) */
1234
- .driver_info = NCTRL(2) | RSVD(3) },
1235
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */
1236
- .driver_info = NCTRL(0) | RSVD(1) },
12371178 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
12381179 .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
12391180 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
12401181 .driver_info = NCTRL(0) | RSVD(3) },
12411182 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1102, 0xff), /* Telit ME910 (ECM) */
12421183 .driver_info = NCTRL(0) },
1243
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110a, 0xff), /* Telit ME910G1 */
1244
- .driver_info = NCTRL(0) | RSVD(3) },
1245
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110b, 0xff), /* Telit ME910G1 (ECM) */
1246
- .driver_info = NCTRL(0) },
12471184 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
12481185 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1249
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1203, 0xff), /* Telit LE910Cx (RNDIS) */
1250
- .driver_info = NCTRL(2) | RSVD(3) },
1251
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1204, 0xff), /* Telit LE910Cx (MBIM) */
1252
- .driver_info = NCTRL(0) | RSVD(1) },
12531186 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
12541187 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
12551188 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
....@@ -1264,32 +1197,10 @@
12641197 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1213, 0xff) },
12651198 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920A4_1214),
12661199 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) },
1267
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1230, 0xff), /* Telit LE910Cx (rmnet) */
1268
- .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1269
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE910Cx (RNDIS) */
1270
- .driver_info = NCTRL(2) | RSVD(3) },
1271
- { USB_DEVICE(TELIT_VENDOR_ID, 0x1260),
1272
- .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1273
- { USB_DEVICE(TELIT_VENDOR_ID, 0x1261),
1274
- .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
12751200 { USB_DEVICE(TELIT_VENDOR_ID, 0x1900), /* Telit LN940 (QMI) */
12761201 .driver_info = NCTRL(0) | RSVD(1) },
12771202 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1901, 0xff), /* Telit LN940 (MBIM) */
12781203 .driver_info = NCTRL(0) },
1279
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x7010, 0xff), /* Telit LE910-S1 (RNDIS) */
1280
- .driver_info = NCTRL(2) },
1281
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x7011, 0xff), /* Telit LE910-S1 (ECM) */
1282
- .driver_info = NCTRL(2) },
1283
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x701a, 0xff), /* Telit LE910R1 (RNDIS) */
1284
- .driver_info = NCTRL(2) },
1285
- { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x701b, 0xff), /* Telit LE910R1 (ECM) */
1286
- .driver_info = NCTRL(2) },
1287
- { USB_DEVICE(TELIT_VENDOR_ID, 0x9010), /* Telit SBL FN980 flashing device */
1288
- .driver_info = NCTRL(0) | ZLP },
1289
- { USB_DEVICE(TELIT_VENDOR_ID, 0x9200), /* Telit LE910S1 flashing device */
1290
- .driver_info = NCTRL(0) | ZLP },
1291
- { USB_DEVICE(TELIT_VENDOR_ID, 0x9201), /* Telit LE910R1 flashing device */
1292
- .driver_info = NCTRL(0) | ZLP },
12931204 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */
12941205 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0002, 0xff, 0xff, 0xff),
12951206 .driver_info = RSVD(1) },
....@@ -1454,7 +1365,6 @@
14541365 .driver_info = RSVD(4) },
14551366 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) },
14561367 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) },
1457
- { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x0601, 0xff) }, /* GosunCn ZTE WeLink ME3630 (RNDIS mode) */
14581368 { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x0602, 0xff) }, /* GosunCn ZTE WeLink ME3630 (MBIM mode) */
14591369 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff),
14601370 .driver_info = RSVD(4) },
....@@ -1617,8 +1527,7 @@
16171527 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) },
16181528 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) },
16191529 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1274, 0xff, 0xff, 0xff) },
1620
- { USB_DEVICE(ZTE_VENDOR_ID, 0x1275), /* ZTE P685M */
1621
- .driver_info = RSVD(3) | RSVD(4) },
1530
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1275, 0xff, 0xff, 0xff) },
16221531 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1276, 0xff, 0xff, 0xff) },
16231532 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1277, 0xff, 0xff, 0xff) },
16241533 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1278, 0xff, 0xff, 0xff) },
....@@ -1661,9 +1570,6 @@
16611570 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff), /* Telewell TW-LTE 4G v2 */
16621571 .driver_info = RSVD(2) },
16631572 { USB_DEVICE_INTERFACE_CLASS(ZTE_VENDOR_ID, 0x1476, 0xff) }, /* GosunCn ZTE WeLink ME3630 (ECM/NCM mode) */
1664
- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0x00, 0x00) }, /* ZTE MF871A */
1665
- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff), /* ZTE MF286D */
1666
- .driver_info = RSVD(5) },
16671573 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1533, 0xff, 0xff, 0xff) },
16681574 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1534, 0xff, 0xff, 0xff) },
16691575 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1535, 0xff, 0xff, 0xff) },
....@@ -1691,6 +1597,7 @@
16911597 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) },
16921598 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
16931599 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
1600
+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
16941601 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff),
16951602 .driver_info = RSVD(1) },
16961603 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff),
....@@ -1891,10 +1798,6 @@
18911798 { USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E),
18921799 .driver_info = RSVD(5) | RSVD(6) },
18931800 { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */
1894
- { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */
1895
- .driver_info = RSVD(7) },
1896
- { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9205, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT+ECM mode */
1897
- { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9206, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT-only mode */
18981801 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),
18991802 .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) },
19001803 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
....@@ -1957,19 +1860,12 @@
19571860 .driver_info = RSVD(4) },
19581861 { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX_2RMNET, 0xff) },
19591862 { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX_AUDIO, 0xff) },
1960
- { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_CLS8, 0xff),
1961
- .driver_info = RSVD(0) | RSVD(4) },
1962
- { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EXS82, 0xff) },
19631863 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) },
19641864 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
19651865 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) },
19661866 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) },
19671867 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */
19681868 { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
1969
- { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_MBIM, 0xff),
1970
- .driver_info = RSVD(3)},
1971
- { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff),
1972
- .driver_info = RSVD(0)},
19731869 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
19741870 .driver_info = RSVD(4) },
19751871 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
....@@ -2057,8 +1953,6 @@
20571953 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
20581954 { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
20591955 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
2060
- { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200),
2061
- .driver_info = RSVD(1) | RSVD(4) },
20621956 { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
20631957 { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
20641958 { USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */
....@@ -2077,20 +1971,10 @@
20771971 .driver_info = RSVD(4) },
20781972 { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e35, 0xff), /* D-Link DWM-222 */
20791973 .driver_info = RSVD(4) },
2080
- { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7e3d, 0xff), /* D-Link DWM-222 A2 */
2081
- .driver_info = RSVD(4) },
20821974 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e01, 0xff, 0xff, 0xff) }, /* D-Link DWM-152/C1 */
20831975 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x3e02, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/C1 */
20841976 { USB_DEVICE_AND_INTERFACE_INFO(0x07d1, 0x7e11, 0xff, 0xff, 0xff) }, /* D-Link DWM-156/A3 */
2085
- { USB_DEVICE_INTERFACE_CLASS(0x1435, 0xd191, 0xff), /* Wistron Neweb D19Q1 */
2086
- .driver_info = RSVD(1) | RSVD(4) },
2087
- { USB_DEVICE_INTERFACE_CLASS(0x1690, 0x7588, 0xff), /* ASKEY WWHC050 */
2088
- .driver_info = RSVD(1) | RSVD(4) },
20891977 { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x2031, 0xff), /* Olicard 600 */
2090
- .driver_info = RSVD(4) },
2091
- { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x2033, 0xff), /* BroadMobi BM806U */
2092
- .driver_info = RSVD(4) },
2093
- { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x2060, 0xff), /* BroadMobi BM818 */
20941978 .driver_info = RSVD(4) },
20951979 { USB_DEVICE_INTERFACE_CLASS(0x2020, 0x4000, 0xff) }, /* OLICARD300 - MT6225 */
20961980 { USB_DEVICE(INOVIA_VENDOR_ID, INOVIA_SEW858) },
....@@ -2104,28 +1988,12 @@
21041988 { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x13) },
21051989 { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x14) },
21061990 { USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0xa31d, 0xff, 0x06, 0x1b) },
2107
- { USB_DEVICE(0x0489, 0xe0b4), /* Foxconn T77W968 */
2108
- .driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
2109
- { USB_DEVICE(0x0489, 0xe0b5), /* Foxconn T77W968 ESIM */
2110
- .driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
2111
- { USB_DEVICE_INTERFACE_CLASS(0x0489, 0xe0db, 0xff), /* Foxconn T99W265 MBIM */
2112
- .driver_info = RSVD(3) },
2113
- { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */
1991
+ { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 */
21141992 .driver_info = RSVD(4) | RSVD(5) | RSVD(6) },
21151993 { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */
21161994 .driver_info = RSVD(4) | RSVD(5) },
21171995 { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
21181996 .driver_info = RSVD(6) },
2119
- { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */
2120
- { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */
2121
- { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
2122
- { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
2123
- { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */
2124
- .driver_info = RSVD(4) },
2125
- { USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */
2126
- { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
2127
- { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
2128
- { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
21291997 { } /* Terminating entry */
21301998 };
21311999 MODULE_DEVICE_TABLE(usb, option_ids);
....@@ -2134,7 +2002,26 @@
21342002 * recognizes separately, thus num_port=1.
21352003 */
21362004
2005
+#if 1 //Added by Quectel
2006
+static void cfmakeraw(struct ktermios *t)
2007
+{
2008
+ t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
2009
+ t->c_oflag &= ~OPOST;
2010
+ t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
2011
+ t->c_cflag &= ~(CSIZE|PARENB);
2012
+ t->c_cflag |= CS8;
2013
+ t->c_cc[VMIN] = 1;
2014
+ t->c_cc[VTIME] = 0;
2015
+}
2016
+
2017
+static void option_init_termios(struct tty_struct *tty)
2018
+{
2019
+ cfmakeraw(&tty->termios);
2020
+}
2021
+#endif
2022
+
21372023 static struct usb_serial_driver option_1port_device = {
2024
+ .init_termios = option_init_termios,
21382025 .driver = {
21392026 .owner = THIS_MODULE,
21402027 .name = "option1",
....@@ -2151,7 +2038,8 @@
21512038 .chars_in_buffer = usb_wwan_chars_in_buffer,
21522039 .tiocmget = usb_wwan_tiocmget,
21532040 .tiocmset = usb_wwan_tiocmset,
2154
- .ioctl = usb_wwan_ioctl,
2041
+ .get_serial = usb_wwan_get_serial_info,
2042
+ .set_serial = usb_wwan_set_serial_info,
21552043 .attach = option_attach,
21562044 .release = option_release,
21572045 .port_probe = usb_wwan_port_probe,
....@@ -2160,6 +2048,9 @@
21602048 #ifdef CONFIG_PM
21612049 .suspend = usb_wwan_suspend,
21622050 .resume = usb_wwan_resume,
2051
+#if 1 //Added by Quectel
2052
+ .reset_resume = usb_wwan_resume,
2053
+#endif
21632054 #endif
21642055 };
21652056
....@@ -2169,20 +2060,41 @@
21692060
21702061 module_usb_serial_driver(serial_drivers, option_ids);
21712062
2172
-static bool iface_is_reserved(unsigned long device_flags, u8 ifnum)
2173
-{
2174
- if (ifnum > FLAG_IFNUM_MAX)
2175
- return false;
2176
-
2177
- return device_flags & RSVD(ifnum);
2178
-}
2179
-
21802063 static int option_probe(struct usb_serial *serial,
21812064 const struct usb_device_id *id)
21822065 {
21832066 struct usb_interface_descriptor *iface_desc =
21842067 &serial->interface->cur_altsetting->desc;
21852068 unsigned long device_flags = id->driver_info;
2069
+
2070
+#if 1 //Added by Quectel
2071
+ //Quectel UC20's interface 4 can be used as USB Network device
2072
+ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)
2073
+ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
2074
+ return -ENODEV;
2075
+
2076
+ //Quectel EC20(MDM9215)'s interface 4 can be used as USB Network device
2077
+ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)
2078
+ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4)
2079
+ return -ENODEV;
2080
+
2081
+ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) {
2082
+ __u16 idProduct = le16_to_cpu(serial->dev->descriptor.idProduct);
2083
+ struct usb_interface_descriptor *intf = &serial->interface->cur_altsetting->desc;
2084
+
2085
+ if (intf->bInterfaceClass != 0xFF || intf->bInterfaceSubClass == 0x42) {
2086
+ //ECM, RNDIS, NCM, MBIM, ACM, UAC, ADB
2087
+ return -ENODEV;
2088
+ }
2089
+
2090
+ if ((idProduct&0xF000) == 0x0000) {
2091
+ //MDM interface 4 is QMI
2092
+ if (intf->bInterfaceNumber == 4 && intf->bNumEndpoints == 3
2093
+ && intf->bInterfaceSubClass == 0xFF && intf->bInterfaceProtocol == 0xFF)
2094
+ return -ENODEV;
2095
+ }
2096
+ }
2097
+#endif
21862098
21872099 /* Never bind to the CD-Rom emulation interface */
21882100 if (iface_desc->bInterfaceClass == USB_CLASS_MASS_STORAGE)
....@@ -2193,7 +2105,7 @@
21932105 * the same class/subclass/protocol as the serial interfaces. Look at
21942106 * the Windows driver .INF files for reserved interface numbers.
21952107 */
2196
- if (iface_is_reserved(device_flags, iface_desc->bInterfaceNumber))
2108
+ if (device_flags & RSVD(iface_desc->bInterfaceNumber))
21972109 return -ENODEV;
21982110
21992111 /*
....@@ -2207,14 +2119,6 @@
22072119 usb_set_serial_data(serial, (void *)device_flags);
22082120
22092121 return 0;
2210
-}
2211
-
2212
-static bool iface_no_modem_control(unsigned long device_flags, u8 ifnum)
2213
-{
2214
- if (ifnum > FLAG_IFNUM_MAX)
2215
- return false;
2216
-
2217
- return device_flags & NCTRL(ifnum);
22182122 }
22192123
22202124 static int option_attach(struct usb_serial *serial)
....@@ -2232,11 +2136,8 @@
22322136
22332137 iface_desc = &serial->interface->cur_altsetting->desc;
22342138
2235
- if (!iface_no_modem_control(device_flags, iface_desc->bInterfaceNumber))
2139
+ if (!(device_flags & NCTRL(iface_desc->bInterfaceNumber)))
22362140 data->use_send_setup = 1;
2237
-
2238
- if (device_flags & ZLP)
2239
- data->use_zlp = 1;
22402141
22412142 spin_lock_init(&data->susp_lock);
22422143
....@@ -2298,7 +2199,7 @@
22982199 dev_dbg(dev, "%s: error %d\n", __func__, status);
22992200
23002201 /* Resubmit urb so we continue receiving IRQ data */
2301
- if (status != -ESHUTDOWN && status != -ENOENT) {
2202
+ if (status != -ESHUTDOWN && status != -ENOENT && status != -EPROTO) {
23022203 usb_mark_last_busy(port->serial->dev);
23032204 err = usb_submit_urb(urb, GFP_ATOMIC);
23042205 if (err)