[PATCH 21/38] backports: add eth_hw_addr_set()

Johannes Berg <[email protected]> Tue, 11 Oct 2022 23:04:29 +0200
Newsgroups org.kernel.vger.backports
Message-ID <20221011230356.8f08adab3cba.I04584880e09adbe7318583f88d24358005f95ccf@changeid>
From: Johannes Berg <[email protected]>

Signed-off-by: Johannes Berg <[email protected]>
---
 backport/backport-include/linux/etherdevice.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 55672f69ddaa..f6fa51f3829c 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -38,4 +38,18 @@ static inline void u64_to_ether_addr(u64 u, u8 *addr)
 }
 #endif /* LINUX_VERSION_IS_LESS(4,11,0) */
 
+#if LINUX_VERSION_IS_LESS(5,15,0)
+/**
+ * eth_hw_addr_set - Assign Ethernet address to a net_device
+ * @dev: pointer to net_device structure
+ * @addr: address to assign
+ *
+ * Assign given address to the net_device, addr_assign_type is not changed.
+ */
+static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
+{
+	ether_addr_copy(dev->dev_addr, addr);
+}
+#endif /* LINUX_VERSION_IS_LESS(5,15,0) */
+
 #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in