summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2019-07-29 09:14:46 -0500
committerJohn Klug <john.klug@multitech.com>2019-11-11 09:30:13 -0600
commit992f5f7bfdd745e17fe84063f1b103d75d293b3a (patch)
tree32205818420ab835f8a5e49ce33a673230ef6b23
parent095f3fa2d32a9e870752bbcc89209128ef3fee69 (diff)
downloadmeta-multitech-992f5f7bfdd745e17fe84063f1b103d75d293b3a.tar.gz
meta-multitech-992f5f7bfdd745e17fe84063f1b103d75d293b3a.tar.bz2
meta-multitech-992f5f7bfdd745e17fe84063f1b103d75d293b3a.zip
Additional updates to qmi for Quectel radio support
-rw-r--r--recipes-kernel/linux/linux-at91-4.9.87/linux-4.9-quectel_qmi_wwan_support.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-at91-4.9.87/linux-4.9-quectel_qmi_wwan_support.patch b/recipes-kernel/linux/linux-at91-4.9.87/linux-4.9-quectel_qmi_wwan_support.patch
new file mode 100644
index 0000000..d0b5fe0
--- /dev/null
+++ b/recipes-kernel/linux/linux-at91-4.9.87/linux-4.9-quectel_qmi_wwan_support.patch
@@ -0,0 +1,73 @@
+Patch for QMI WWAN Driver to support the Quectel EG95 device.
+==================================================================================
+--- a/drivers/net/usb/qmi_wwan.c 2019-06-25 18:33:52.000000000 +0300
++++ b/drivers/net/usb/qmi_wwan.c 2019-06-25 18:38:06.858767868 +0300
+@@ -224,6 +224,23 @@
+ return 1;
+ }
+
++struct sk_buff *qmi_wwan_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
++{
++ if (dev->udev->descriptor.idVendor != cpu_to_le16(0x2c7c))
++ return skb;
++
++ // Skip Ethernet header from message
++ if (skb_pull(skb, ETH_HLEN)) {
++ return skb;
++ } else {
++ dev_err(&dev->intf->dev, "Packet Dropped ");
++ }
++
++ // Filter the packet out, release it
++ dev_kfree_skb_any(skb);
++ return NULL;
++}
++
+ /* very simplistic detection of IPv4 or IPv6 headers */
+ static bool possibly_iphdr(const char *data)
+ {
+@@ -445,6 +462,20 @@
+ }
+ dev->net->netdev_ops = &qmi_wwan_netdev_ops;
+ dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group;
++
++ if (dev->udev->descriptor.idVendor == cpu_to_le16(0x2c7c)) {
++ dev_info(&intf->dev, "Quectel EG95 work on RawIP mode\n");
++ dev->net->flags |= IFF_NOARP;
++
++ usb_control_msg(
++ interface_to_usbdev(intf),
++ usb_sndctrlpipe(interface_to_usbdev(intf), 0),
++ 0x22, //USB_CDC_REQ_SET_CONTROL_LINE_STATE
++ 0x21, //USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE
++ 1, //active CDC DTR
++ intf->cur_altsetting->desc.bInterfaceNumber,
++ NULL, 0, 100);
++ }
+ err:
+ return status;
+ }
+@@ -536,6 +567,7 @@
+ .unbind = qmi_wwan_unbind,
+ .manage_power = qmi_wwan_manage_power,
+ .rx_fixup = qmi_wwan_rx_fixup,
++ .tx_fixup = qmi_wwan_tx_fixup,
+ };
+
+ static const struct driver_info qmi_wwan_info_quirk_dtr = {
+@@ -545,6 +577,7 @@
+ .unbind = qmi_wwan_unbind,
+ .manage_power = qmi_wwan_manage_power,
+ .rx_fixup = qmi_wwan_rx_fixup,
++ .tx_fixup = qmi_wwan_tx_fixup,
+ .data = QMI_WWAN_QUIRK_DTR,
+ };
+
+@@ -947,6 +980,7 @@
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */
+ {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0306, 4)}, /* Quectel EP06 Mini PCIe */
++ {QMI_FIXED_INTF(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */
+
+ /* 4. Gobi 1000 devices */
+ {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */