openwrt22.03: support EM060K

Signed-off-by: Yin Ni <yin.ni@gl-inet.com>
This commit is contained in:
Yin Ni 2023-04-11 01:26:30 -07:00
parent 8576c5d3f0
commit cc62d944fa

View File

@ -0,0 +1,68 @@
From 5b31725ed990ad41ef7b4dd1bf101a66ccb95e53 Mon Sep 17 00:00:00 2001
From: Yin Ni <yin.ni@gl-inet.com>
Date: Tue, 11 Apr 2023 01:22:22 -0700
Subject: [PATCH] Kernel: support-EM060K
Signed-off-by: Yin Ni <yin.ni@gl-inet.com>
---
.../hack-5.10/921-support-EM060K-modem.patch | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 target/linux/generic/hack-5.10/921-support-EM060K-modem.patch
diff --git a/target/linux/generic/hack-5.10/921-support-EM060K-modem.patch b/target/linux/generic/hack-5.10/921-support-EM060K-modem.patch
new file mode 100644
index 0000000000..b46e016e8a
--- /dev/null
+++ b/target/linux/generic/hack-5.10/921-support-EM060K-modem.patch
@@ -0,0 +1,48 @@
+Index: b/drivers/net/usb/qmi_wwan.c
+===================================================================
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -1070,6 +1070,7 @@ static const struct usb_device_id produc
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
++ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x030b)}, /* Quectel Quectel EM060K-GL EM120K-GL */
+ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */
+ {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)}, /* MeigLink SLM750 */
+
+Index: b/drivers/usb/serial/option.c
+===================================================================
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -633,6 +633,7 @@ static const struct usb_device_id option
+ { USB_DEVICE(0x2C7C, 0x0296) }, /* Quectel BG96 */
+ { USB_DEVICE(0x2C7C, 0x0435) }, /* Quectel AG35 */
+ { USB_DEVICE(0x2C7C, 0x6026) }, /* Quectel EC200t */
++ { USB_DEVICE(0x2C7C, 0x030b) }, /* Quectel EM060K-GL EM120K-GL*/
+ #endif
+ { USB_DEVICE(0x19d2, 0x0536) },/* MZ386 */
+ { USB_DEVICE(0x19d2, 0x0117) },
+@@ -2325,6 +2326,23 @@ static int option_probe(struct usb_seria
+ serial->dev->descriptor.idProduct == cpu_to_le16(0x6026) \
+ && serial->interface->cur_altsetting->desc.bInterfaceNumber<= 1)
+ return -ENODEV;
++ if (serial->dev->descriptor.idVendor == cpu_to_le16(0x2C7C)) {
++ __u16 idProduct = le16_to_cpu(serial->dev->descriptor.idProduct);
++ struct usb_interface_descriptor *intf = &serial->interface->cur_altsetting->desc;
++
++ if (intf->bInterfaceClass != 0xFF || intf->bInterfaceSubClass == 0x42) {
++ //ECM, RNDIS, NCM, MBIM, ACM, UAC, ADB
++ return -ENODEV;
++ }
++
++ if ((idProduct&0xF000) == 0x0000) {
++ //MDM interface 4 is QMI
++ if (intf->bInterfaceNumber == 4 && intf->bNumEndpoints == 3
++ && intf->bInterfaceSubClass == 0xFF && intf->bInterfaceProtocol == 0xFF)
++ return -ENODEV;
++
++ }
++ }
+ #endif
+ #if 1 //Added by Quectel
+ //For USB Auto Suspend
--
2.25.1