Skip to content

Commit 4994047

Browse files
jhovoldgregkh
authored andcommitted
Revert "USB: option,zte_ev: move most ZTE CDMA devices to zte_ev"
commit 63a901c upstream. This reverts commit 73228a0 ("USB: option,zte_ev: move most ZTE CDMA devices to zte_ev"). Move the IDs of the devices that were previously driven by the option driver back to that driver. As several users have reported, the zte_ev driver is causing random disconnects as well as reconnect failures. A closer analysis of the zte_ev setup code reveals that it consists of standard CDC requests (SET/GET_LINE_CODING and SET_CONTROL_LINE_STATE) but unfortunately fails to get some of those right. In particular, as reported by Liu Lei, it fails to lower DTR/RTS on close. It also appears that the control requests lack the interface argument. Note that the zte_ev driver is based on code (once) distributed by ZTE that still appears to originally have been reverse-engineered and bolted onto the generic driver. Since line control is already handled properly by the option driver, and the SET/GET_LINE_CODING requests appears to be redundant (amounts to a SET 9600 8N1), this is a first step in ultimately removing the redundant zte_ev driver. Note that AC2726 had already been moved back to option, and that some IDs were in the device table of both drivers prior to the commit being reverted. Reported-by: Lei Liu <liu.lei78@zte.com.cn> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 434d821 commit 4994047

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎drivers/usb/serial/option.c‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,12 @@ static void option_instat_callback(struct urb *urb);
275275
#define ZTE_PRODUCT_MF622 0x0001
276276
#define ZTE_PRODUCT_MF628 0x0015
277277
#define ZTE_PRODUCT_MF626 0x0031
278-
#define ZTE_PRODUCT_MC2718 0xffe8
279278
#define ZTE_PRODUCT_AC2726 0xfff1
279+
#define ZTE_PRODUCT_CDMA_TECH 0xfffe
280+
#define ZTE_PRODUCT_AC8710T 0xffff
281+
#define ZTE_PRODUCT_MC2718 0xffe8
282+
#define ZTE_PRODUCT_AD3812 0xffeb
283+
#define ZTE_PRODUCT_MC2716 0xffed
280284

281285
#define BENQ_VENDOR_ID 0x04a5
282286
#define BENQ_PRODUCT_H10 0x4068
@@ -531,10 +535,18 @@ static const struct option_blacklist_info zte_k3765_z_blacklist = {
531535
.reserved = BIT(4),
532536
};
533537

538+
static const struct option_blacklist_info zte_ad3812_z_blacklist = {
539+
.sendsetup = BIT(0) | BIT(1) | BIT(2),
540+
};
541+
534542
static const struct option_blacklist_info zte_mc2718_z_blacklist = {
535543
.sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4),
536544
};
537545

546+
static const struct option_blacklist_info zte_mc2716_z_blacklist = {
547+
.sendsetup = BIT(1) | BIT(2) | BIT(3),
548+
};
549+
538550
static const struct option_blacklist_info huawei_cdc12_blacklist = {
539551
.reserved = BIT(1) | BIT(2),
540552
};
@@ -1074,6 +1086,7 @@ static const struct usb_device_id option_ids[] = {
10741086
{ USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) },
10751087
{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) },
10761088
{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
1089+
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */
10771090
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
10781091
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
10791092
{ USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */
@@ -1548,13 +1561,18 @@ static const struct usb_device_id option_ids[] = {
15481561
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff93, 0xff, 0xff, 0xff) },
15491562
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff94, 0xff, 0xff, 0xff) },
15501563

1551-
/* NOTE: most ZTE CDMA devices should be driven by zte_ev, not option */
1564+
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
1565+
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
1566+
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) },
15521567
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff),
15531568
.driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist },
1569+
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff),
1570+
.driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist },
1571+
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff),
1572+
.driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist },
15541573
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) },
15551574
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) },
15561575
{ USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
1557-
{ USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
15581576

15591577
{ USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
15601578
{ USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },

‎drivers/usb/serial/zte_ev.c‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -272,27 +272,9 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port)
272272
}
273273

274274
static const struct usb_device_id id_table[] = {
275-
/* AC8710, AC8710T */
276-
{ USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffff, 0xff, 0xff, 0xff) },
277-
/* AC8700 */
278-
{ USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfffe, 0xff, 0xff, 0xff) },
279275
/* MG880 */
280276
{ USB_DEVICE(0x19d2, 0xfffd) },
281-
{ USB_DEVICE(0x19d2, 0xfffc) },
282-
{ USB_DEVICE(0x19d2, 0xfffb) },
283-
/* AC8710_V3 */
284-
{ USB_DEVICE(0x19d2, 0xfff6) },
285-
{ USB_DEVICE(0x19d2, 0xfff7) },
286-
{ USB_DEVICE(0x19d2, 0xfff8) },
287-
{ USB_DEVICE(0x19d2, 0xfff9) },
288-
{ USB_DEVICE(0x19d2, 0xffee) },
289-
/* AC2716, MC2716 */
290-
{ USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffed, 0xff, 0xff, 0xff) },
291-
/* AD3812 */
292-
{ USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffeb, 0xff, 0xff, 0xff) },
293-
{ USB_DEVICE(0x19d2, 0xffec) },
294277
{ USB_DEVICE(0x05C6, 0x3197) },
295-
{ USB_DEVICE(0x05C6, 0x6000) },
296278
{ USB_DEVICE(0x05C6, 0x9008) },
297279
{ },
298280
};

0 commit comments

Comments
 (0)