gl-infra-builder-FUjr/patches-21.02.2/0017-ipq40xx-support-EM160R-EM060K-EM120K-RM520N-modem.patch
GL.iNet-XiBao.Lu 67fafe9cc6 modem: ipq40xx-support-EM160R-EM060K-EM120K-RM520N-modem
A1300 modem support

Signed-off-by: GL.iNet-XiBao.Lu <xibao.lu@gl-inet.com>
2023-06-15 19:02:47 -07:00

75 lines
3.3 KiB
Diff
Executable File

From 58a8f0af8b80e6b3a8dceaca95d8eeb355645d59 Mon Sep 17 00:00:00 2001
From: "GL.iNet-XiBao.Lu" <xibao.lu@gl-inet.com>
Date: Tue, 13 Jun 2023 00:13:08 -0700
Subject: [PATCH] modem: support-EM160R-EM060K-EM120K-RM520N-modem
A1300 modem support
Signed-off-by: GL.iNet-XiBao.Lu <xibao.lu@gl-inet.com>
---
...rt-EM160R-EM060K-EM120K-RM520N-modem.patch | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 target/linux/ipq40xx/patches-5.4/701-support-EM160R-EM060K-EM120K-RM520N-modem.patch
diff --git a/target/linux/ipq40xx/patches-5.4/701-support-EM160R-EM060K-EM120K-RM520N-modem.patch b/target/linux/ipq40xx/patches-5.4/701-support-EM160R-EM060K-EM120K-RM520N-modem.patch
new file mode 100644
index 0000000000..bacc96fb84
--- /dev/null
+++ b/target/linux/ipq40xx/patches-5.4/701-support-EM160R-EM060K-EM120K-RM520N-modem.patch
@@ -0,0 +1,52 @@
+Index: b/drivers/net/usb/qmi_wwan.c
+===================================================================
+--- a/drivers/net/usb/qmi_wwan.c 2023-06-12 23:55:25.983433059 -0700
++++ b/drivers/net/usb/qmi_wwan.c 2023-06-12 23:59:23.589471858 -0700
+@@ -1093,6 +1093,8 @@ 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-GL */
+
+ /* 3. Combined interface devices matching on interface number */
+ {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
+Index: b/drivers/usb/serial/option.c
+===================================================================
+--- a/drivers/usb/serial/option.c 2023-06-12 23:55:25.983433059 -0700
++++ b/drivers/usb/serial/option.c 2023-06-13 00:03:45.340353269 -0700
+@@ -614,6 +614,9 @@ 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*/
++ { USB_DEVICE(0x2C7C, 0x0620) }, /* Quectel EM160R-GL */
++ { USB_DEVICE(0x2C7C, 0x0801) }, /* Quectel RM520N-GL */
+ #endif
+ { USB_DEVICE(0x19d2, 0x0536) },/* MZ386 */
+ { USB_DEVICE(0x19d2, 0x0117) },
+@@ -2251,6 +2254,24 @@ 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 0 //Added by Quectel
+ //For USB Auto Suspend
--
2.25.1