diff mbox series

[55/75] header: Add dev_addr_mod()

Message ID 20240627234808.1253337-56-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:47 p.m. UTC
Add the dev_addr_mod() function.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/netdevice.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 530cbb07..1ec5b1d2 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -240,4 +240,14 @@  static inline void backport_netif_napi_add_tx(struct net_device *dev,
 #define netif_napi_add_tx LINUX_BACKPORT(netif_napi_add_tx)
 #endif /* < 6.1 */
 
+#if LINUX_VERSION_IS_LESS(5,15,0)
+#define dev_addr_mod LINUX_BACKPORT(dev_addr_mod)
+static inline void
+dev_addr_mod(struct net_device *dev, unsigned int offset,
+	const void *addr, size_t len)
+{
+	memcpy(&dev->dev_addr[offset], addr, len);
+}
+#endif /* < 5.15 */
+
 #endif /* __BACKPORT_NETDEVICE_H */