]> xenbits.xensource.com Git - people/pauldu/linux.git/commitdiff
cdc_ether: export usbnet_cdc_zte_rx_fixup
authorLech Perczak <lech.perczak@gmail.com>
Wed, 13 Apr 2022 01:44:14 +0000 (03:44 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 14 Apr 2022 13:08:12 +0000 (15:08 +0200)
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>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/usb/cdc_ether.c
include/linux/usb/usbnet.h

index 9b4dfa3001d6eaca41cf072126e228f8b46ee794..2de09ad5bac0318d0ec0edda7231a50e062e05c0 100644 (file)
@@ -479,7 +479,7 @@ static int usbnet_cdc_zte_bind(struct usbnet *dev, struct usb_interface *intf)
  * 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;
@@ -489,6 +489,7 @@ static int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 
        return 1;
 }
+EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup);
 
 /* Ensure correct link state
  *
index 8336e86ce606e7935bb8f2e434829e60f592d23c..1b4d72d5e8913ebd95513edf5bdbdefe0f736ed2 100644 (file)
@@ -214,6 +214,7 @@ extern int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 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 \