diff options
-rw-r--r-- | recipes-kernel/linux/linux-at91-4.9.87/linux-4.9-quectel_qmi_wwan_support.patch | 69 |
1 files changed, 4 insertions, 65 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 index d0b5fe0..6c78c81 100644 --- 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 @@ -2,72 +2,11 @@ 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 @@ +@@ -945,6 +945,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */ + {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ ++ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */ {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 */ |