aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch
diff options
context:
space:
mode:
authorLech Perczak <lech.perczak@gmail.com>2022-04-01 22:05:08 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-04-17 21:31:02 +0200
commit19c65d36d776b4f9e2a19f0f487fc9bc8fcc2858 (patch)
treef7896af96d5472f5858ecc204a615a39d91fac6f /target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch
parent835454661d69aa8a031e320602ad359381812c98 (diff)
downloadupstream-19c65d36d776b4f9e2a19f0f487fc9bc8fcc2858.tar.gz
upstream-19c65d36d776b4f9e2a19f0f487fc9bc8fcc2858.tar.bz2
upstream-19c65d36d776b4f9e2a19f0f487fc9bc8fcc2858.zip
kernel: backport ZTE RNDIS bogus MAC address fix
This is required to support built-in modem of ZTE MF286R, in addition to other external modems, such as MF831, MF910, MF920, which refuse to reconfigure their remote MAC address, even if "locally administered" bit is set, leading to dropped traffic towards the host. Add a workaround for that issue already present in cdc_ether to rndis_host driver as well. Signed-off-by: Lech Perczak <lech.perczak@gmail.com> (cherry picked from commit c99013e242682a71051619806f9cc4f4e51a58fa)
Diffstat (limited to 'target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch')
-rw-r--r--target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch b/target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch
new file mode 100644
index 0000000000..b5a226181e
--- /dev/null
+++ b/target/linux/generic/backport-5.10/880-v5.19-cdc_ether-export-usbnet_cdc_zte_rx_fixup.patch
@@ -0,0 +1,58 @@
+From d91a03b72c5f9c25e5b976f8f67bcf279601d644 Mon Sep 17 00:00:00 2001
+From: Lech Perczak <lech.perczak@gmail.com>
+Date: Fri, 1 Apr 2022 22:03:55 +0200
+Subject: [PATCH 1/3] cdc_ether: export usbnet_cdc_zte_rx_fixup
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit bfe9b9d2df66 ("cdc_ether: Improve ZTE MF823/831/910 handling")
+introduces a workaround for certain ZTE modems reporting invalid MAC
+addresses over CDC-ECM.
+The same issue was present on their RNDIS interface,which was fixed in
+commit a5a18bdf7453 ("rndis_host: Set valid random MAC on buggy devices").
+
+However, internal modem of ZTE MF286R router, on its RNDIS interface, also
+exhibits a second issue fixed already in CDC-ECM, of the device not
+respecting configured random MAC address. In order to share the fixup for
+this with rndis_host driver, export the workaround function, which will
+be re-used in the following commit in rndis_host.
+
+Cc: Kristian Evensen <kristian.evensen@gmail.com>
+Cc: Bjørn Mork <bjorn@mork.no>
+Cc: Oliver Neukum <oliver@neukum.org>
+Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
+---
+ drivers/net/usb/cdc_ether.c | 3 ++-
+ include/linux/usb/usbnet.h | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/usb/cdc_ether.c
++++ b/drivers/net/usb/cdc_ether.c
+@@ -466,7 +466,7 @@ static int usbnet_cdc_zte_bind(struct us
+ * device MAC address has been updated). Always set MAC address to that of the
+ * device.
+ */
+-static int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
++int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
+ {
+ if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02))
+ return 1;
+@@ -476,6 +476,7 @@ static int usbnet_cdc_zte_rx_fixup(struc
+
+ return 1;
+ }
++EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup);
+
+ /* Ensure correct link state
+ *
+--- a/include/linux/usb/usbnet.h
++++ b/include/linux/usb/usbnet.h
+@@ -215,6 +215,7 @@ extern int usbnet_ether_cdc_bind(struct
+ extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *);
+ extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *);
+ extern void usbnet_cdc_status(struct usbnet *, struct urb *);
++extern int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb);
+
+ /* CDC and RNDIS support the same host-chosen packet filters for IN transfers */
+ #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \