From: Kyson Lok Date: Mon, 28 May 2018 05:58:48 +0000 (+0800) Subject: kernel: fix add modem driver patch fail to apply X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42ff68c8f791052b66e24aa05299d64427bfda18;p=thirdparty%2Fopenwrt.git kernel: fix add modem driver patch fail to apply --- diff --git a/target/linux/ar71xx/patches-4.9/742-add-modem-driver.patch b/target/linux/ar71xx/patches-4.9/742-add-modem-driver.patch index fd710cbbe0f..2c7f689ec49 100644 --- a/target/linux/ar71xx/patches-4.9/742-add-modem-driver.patch +++ b/target/linux/ar71xx/patches-4.9/742-add-modem-driver.patch @@ -76,7 +76,7 @@ /* 1. CDC ECM like devices match on the control interface */ { /* Huawei E392, E398 and possibly others sharing both device id and more... */ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9), -@@ -980,7 +1026,6 @@ static const struct usb_device_id produc +@@ -981,7 +1027,6 @@ static const struct usb_device_id produc {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */ {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ @@ -86,7 +86,7 @@ {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -550,6 +550,23 @@ static void option_instat_callback(struc +@@ -553,6 +553,22 @@ static void option_instat_callback(struc #define WETELECOM_PRODUCT_6802 0x6802 #define WETELECOM_PRODUCT_WMD300 0x6803 @@ -106,12 +106,11 @@ +#define NEOWAY_VENDOR_ID 0x2949 + +#define NEOWAY_PRODUCT_N720 0x8243 -+ - struct option_blacklist_info { - /* bitmask of interface numbers blacklisted for send_setup */ - const unsigned long sendsetup; -@@ -693,6 +710,23 @@ static const struct option_blacklist_inf - }; + + /* Device flags */ + +@@ -564,6 +580,23 @@ static void option_instat_callback(struc + static const struct usb_device_id option_ids[] = { +#if 1 //Added by Quectel @@ -134,7 +133,7 @@ { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, -@@ -2099,6 +2133,9 @@ static struct usb_serial_driver option_1 +@@ -1972,6 +2005,9 @@ static struct usb_serial_driver option_1 #ifdef CONFIG_PM .suspend = usb_wwan_suspend, .resume = usb_wwan_resume, @@ -144,43 +143,48 @@ #endif }; -@@ -2138,9 +2175,63 @@ static int option_probe(struct usb_seria - iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) +@@ -2005,12 +2041,67 @@ static int option_probe(struct usb_seria + * a separate module. + */ + if (dev_desc->idVendor == cpu_to_le16(SAMSUNG_VENDOR_ID) && +- dev_desc->idProduct == cpu_to_le16(SAMSUNG_PRODUCT_GT_B3730) && +- iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) ++ dev_desc->idProduct == cpu_to_le16(SAMSUNG_PRODUCT_GT_B3730) && ++ iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) return -ENODEV; -- /* Store the blacklist info so we can use it during attach. */ -- usb_set_serial_data(serial, (void *)blacklist); -- +- /* Store the device flags so we can use them during attach. */ +- usb_set_serial_data(serial, (void *)device_flags); +#if 1 //Added by Quectel + //Quectel UC20's interface 4 can be used as USB network device + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \ -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003) \ -+ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003) \ ++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) + return -ENODEV; + //Quectel EC20's interface 4 can be used as USB network device + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && \ -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215) \ -+ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215) \ ++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) + return -ENODEV; + //Quectel EC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96/AG35's interface 4 can be used as USB network device + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C) \ -+ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) -+ return -ENODEV; ++ && serial->interface->cur_altsetting->desc.bInterfaceNumber >= 4) ++ return -ENODEV; +#endif +#if 1 //Added by Quectel + //For USB Auto Suspend + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); + usb_enable_autosuspend(serial->dev); + } + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); + usb_enable_autosuspend(serial->dev); + } + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); + usb_set_serial_data(serial, (void *)blacklist); + usb_enable_autosuspend(serial->dev); @@ -188,29 +192,29 @@ + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { + pm_runtime_set_autosuspend_delay(&serial->dev->dev, 3000); + usb_enable_autosuspend(serial->dev); -+ } ++ } +#endif +#if 1 //Added by Quectel + //For USB Remote Wakeup + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9090)) { + device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup + } + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9003)) { + device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup + } + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x05C6) && -+ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { ++ serial->dev->descriptor.idProduct == cpu_to_le16(0x9215)) { + device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup + } + if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) { -+ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup ++ device_init_wakeup(&serial->dev->dev, 1); //usb remote wakeup + } +#endif + return 0; } - --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -92,7 +92,6 @@ static const struct usb_device_id id_tab