kernel: add support MeigLink SLM828 modem
authorDaniel Golle <daniel@makrotopia.org>
Thu, 26 Oct 2023 02:46:44 +0000 (03:46 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 13 Nov 2023 00:58:08 +0000 (00:58 +0000)
Another Qualcomm-based USB-connected modem, offering endpoints
 0 : rndis_host (link to voip subsystem listening on 169.254.5.100)
 1 : rndis_host (?)
 2 : option (?)
 3 : option (at)
 4 : option (at)
 5 : option (?)
 6 : GobiNet (qmi)
 7 : ?

Add support for this modem in rndis_host, option and qmi_wwan driver
which allows the modem to be used with ModemManager.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit f32baf6a65fbe294b9eb7b93f39b2aea1c3402ae)

target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch
target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch [new file with mode: 0644]

index e5667c17438d24e2e56305615204f2cdd4cf13d8..304f5480a3febf900f8b4e3e523fc21ba3f0f016 100644 (file)
@@ -10,26 +10,52 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
 
 --- a/drivers/net/usb/qmi_wwan.c
 +++ b/drivers/net/usb/qmi_wwan.c
-@@ -1086,6 +1086,7 @@ static const struct usb_device_id produc
+@@ -1080,12 +1080,18 @@ static const struct usb_device_id produc
+               USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
+               .driver_info = (unsigned long)&qmi_wwan_info,
+       },
++      {       /* Meiglink SGM828 */
++              USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49, USB_CLASS_VENDOR_SPEC, 0x10, 0x05),
++              .driver_info = (unsigned long)&qmi_wwan_info,
++      },
++
+       {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)},   /* Quectel EC25, EC20 R2.0  Mini PCIe */
+       {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)},   /* Quectel EP06/EG06/EM06 */
+       {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, 0x0801)},   /* Quectel RM520N */
-+      {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)},   /* MeigLink SLM750 */
++      {QMI_MATCH_FF_FF_FF(0x05c6, 0xf601)},   /* MeigLink SLM750 */
  
        /* 3. Combined interface devices matching on interface number */
        {QMI_FIXED_INTF(0x0408, 0xea42, 4)},    /* Yota / Megafon M100-1 */
 --- a/drivers/usb/serial/option.c
 +++ b/drivers/usb/serial/option.c
-@@ -247,6 +247,8 @@ static void option_instat_callback(struc
+@@ -247,6 +247,11 @@ static void option_instat_callback(struc
  #define UBLOX_PRODUCT_R410M                   0x90b2
  /* These Yuga products use Qualcomm's vendor ID */
  #define YUGA_PRODUCT_CLM920_NC5                       0x9625
 +/* These MeigLink products use Qualcomm's vendor ID */
 +#define MEIGLINK_PRODUCT_SLM750                       0xf601
++
++#define MEIGLINK_VENDOR_ID                    0x2dee
++#define MEIGLINK_PRODUCT_SLM828                       0x4d49
  
  #define QUECTEL_VENDOR_ID                     0x2c7c
  /* These Quectel products use Quectel's vendor ID */
-@@ -1185,6 +1187,11 @@ static const struct usb_device_id option
+@@ -1144,6 +1149,11 @@ static const struct usb_device_id option
+       { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
+       { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */
+         .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) },
++      /* MeiG */
++      { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x01) },
++      { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x02) },
++      { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x03) },
++      { USB_DEVICE_AND_INTERFACE_INFO(MEIGLINK_VENDOR_ID, MEIGLINK_PRODUCT_SLM828, USB_CLASS_VENDOR_SPEC, 0x10, 0x04) },
+       /* Quectel products using Qualcomm vendor ID */
+       { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
+       { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
+@@ -1185,6 +1195,11 @@ static const struct usb_device_id option
          .driver_info = ZLP },
        { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
          .driver_info = RSVD(4) },
diff --git a/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch b/target/linux/generic/hack-5.15/781-usb-net-rndis-support-asr.patch
new file mode 100644 (file)
index 0000000..9934bb8
--- /dev/null
@@ -0,0 +1,56 @@
+--- a/drivers/net/usb/rndis_host.c
++++ b/drivers/net/usb/rndis_host.c
+@@ -630,6 +630,16 @@ static const struct driver_info   zte_rndi
+       .tx_fixup =     rndis_tx_fixup,
+ };
++static const struct driver_info asr_rndis_info = {
++      .description =  "Asr RNDIS device",
++      .flags =        FLAG_WWAN | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT | FLAG_NOARP,
++      .bind =         rndis_bind,
++      .unbind =       rndis_unbind,
++      .status =       rndis_status,
++      .rx_fixup =     rndis_rx_fixup,
++      .tx_fixup =     rndis_tx_fixup,
++};
++
+ /*-------------------------------------------------------------------------*/
+ static const struct usb_device_id     products [] = {
+@@ -666,6 +676,36 @@ static const struct usb_device_id produc
+       USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
+       .driver_info = (unsigned long) &rndis_info,
+ }, {
++      /* Quectel EG060V rndis device */
++      USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6004,
++                                    USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
++      .driver_info = (unsigned long) &asr_rndis_info,
++}, {
++      /* Quectel EC200A rndis device */
++      USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6005,
++                                    USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
++      .driver_info = (unsigned long) &asr_rndis_info,
++}, {
++      /* Quectel EC200T rndis device */
++      USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x6026,
++                                    USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
++      .driver_info = (unsigned long) &asr_rndis_info,
++}, {
++      /* Simcom A7906E rndis device */
++      USB_DEVICE_AND_INTERFACE_INFO(0x1e0e, 0x9011,
++                                    USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
++      .driver_info = (unsigned long) &asr_rndis_info,
++}, {
++      /* Meig SLM770A */
++      USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d57,
++                                    USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
++      .driver_info = (unsigned long) &asr_rndis_info,
++}, {
++      /* Meig SLM828 */
++      USB_DEVICE_AND_INTERFACE_INFO(0x2dee, 0x4d49,
++                                    USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
++      .driver_info = (unsigned long) &asr_rndis_info,
++}, {
+       /* Novatel Verizon USB730L */
+       USB_INTERFACE_INFO(USB_CLASS_MISC, 4, 1),
+       .driver_info = (unsigned long) &rndis_info,