Netdev List
 help / color / mirror / Atom feed
* [PATCHv2 net-next 1/7] net: usb: centralize usbnet_cdc_zte_rx_fixup in usbnet
@ 2026-07-09 12:01 Oliver Neukum
  2026-07-09 12:01 ` [PATCHv2 net-next 2/7] net: usb: usbnet: add cdc_state to struct usbnet Oliver Neukum
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Oliver Neukum @ 2026-07-09 12:01 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, netdev, linux-usb,
	linux-kernel, manuelebner
  Cc: Oliver Neukum

This helper is used by multiple drivers using usbnet.
It is better to be provided by usbnet than one of them.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---

v2:
- spelling issues
- issue with lost synchronization with SPLIT packets

 drivers/net/usb/cdc_ether.c | 19 -------------------
 drivers/net/usb/usbnet.c    | 19 +++++++++++++++++++
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index b4df32e18461..e688fb99c61d 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -404,25 +404,6 @@ static int usbnet_cdc_zte_bind(struct usbnet *dev, struct usb_interface *intf)
 	return status;
 }
 
-/* Make sure packets have correct destination MAC address
- *
- * A firmware bug observed on some devices (ZTE MF823/831/910) is that the
- * device sends packets with a static, bogus, random MAC address (event if
- * device MAC address has been updated). Always set MAC address to that of the
- * device.
- */
-int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
-{
-	if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02))
-		return 1;
-
-	skb_reset_mac_header(skb);
-	ether_addr_copy(eth_hdr(skb)->h_dest, dev->net->dev_addr);
-
-	return 1;
-}
-EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup);
-
 /* Ensure correct link state
  *
  * Some devices (ZTE MF823/831/910) export two carrier on notifications when
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 21c55d70f27c..14e9f1b1e0a2 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -2350,6 +2350,25 @@ void usbnet_cdc_status(struct usbnet *dev, struct urb *urb)
 	}
 }
 EXPORT_SYMBOL_GPL(usbnet_cdc_status);
+
+/* Make sure packets have correct destination MAC address
+ *
+ * A firmware bug observed on some devices (ZTE MF823/831/910) is that the
+ * device sends packets with a static, bogus, random MAC address (event if
+ * device MAC address has been updated). Always set MAC address to that of the
+ * device.
+ */
+int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
+{
+	if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02))
+		return 1;
+
+	skb_reset_mac_header(skb);
+	ether_addr_copy(eth_hdr(skb)->h_dest, dev->net->dev_addr);
+
+	return 1;
+}
+EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup);
 /*-------------------------------------------------------------------------*/
 
 static int __init usbnet_init(void)
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-07-09 18:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09 12:01 [PATCHv2 net-next 1/7] net: usb: centralize usbnet_cdc_zte_rx_fixup in usbnet Oliver Neukum
2026-07-09 12:01 ` [PATCHv2 net-next 2/7] net: usb: usbnet: add cdc_state to struct usbnet Oliver Neukum
2026-07-09 13:49   ` Andrew Lunn
2026-07-09 12:01 ` [PATCHv2 net-next 3/7] net: usb: use cdc_state in " Oliver Neukum
2026-07-09 13:49   ` Andrew Lunn
2026-07-09 12:01 ` [PATCHv2 net-next 4/7] net: usb: int51x1: drop dependency on cdc_ether Oliver Neukum
2026-07-09 13:50   ` Andrew Lunn
2026-07-09 12:01 ` [PATCHv2 net-next 5/7] net: usb: move exported symbols from cdc_ether to usbnet Oliver Neukum
2026-07-09 13:51   ` Andrew Lunn
2026-07-09 12:01 ` [PATCHv2 net-next 6/7] net: usb: remove dependencies on cdc_ether Oliver Neukum
2026-07-09 13:52   ` Andrew Lunn
2026-07-09 18:08   ` Sergey Shtylyov
2026-07-09 12:01 ` [PATCHv2 net-next 7/7] net: usb: usbnet: remove outdated sanity check Oliver Neukum
2026-07-09 13:56   ` Andrew Lunn
2026-07-09 12:37 ` [PATCHv2 net-next 1/7] net: usb: centralize usbnet_cdc_zte_rx_fixup in usbnet Manuel Ebner
2026-07-09 13:55   ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox