summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-10-23 20:44:33 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2013-10-23 23:17:10 +0200
commit8972091cf673249ec81cb1adf94af3351daca3d0 (patch)
tree552ccdb888223852a11d11bd0fe297e7b2eff539
parent4f84b99aa0141d83be69c8e408480c26b58f7df4 (diff)
backports: add eth_hw_addr_inherit()
This is needed by drivers/net/wireless/libertas/mesh.c Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/etherdevice.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 6aff2449..bbdee102 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -135,4 +135,23 @@ extern int eth_validate_addr(struct net_device *dev);
#define netdev_hw_addr dev_mc_list
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)
+/**
+ * eth_hw_addr_inherit - Copy dev_addr from another net_device
+ * @dst: pointer to net_device to copy dev_addr to
+ * @src: pointer to net_device to copy dev_addr from
+ *
+ * Copy the Ethernet address from one net_device to another along with
+ * the address attributes (addr_assign_type).
+ */
+static inline void eth_hw_addr_inherit(struct net_device *dst,
+ struct net_device *src)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ dst->addr_assign_type = src->addr_assign_type;
+#endif
+ memcpy(dst->dev_addr, src->dev_addr, ETH_ALEN);
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) */
+
#endif /* _BACKPORT_LINUX_ETHERDEVICE_H */