@@ -2,6 +2,7 @@
#define _BACKPORT_LINUX_ETHERDEVICE_H
#include_next <linux/etherdevice.h>
#include <linux/version.h>
+#include <linux/property.h>
/* This was backported to 4.19.291, but we do not support such high minor numbers use 255 instead. */
#if LINUX_VERSION_IS_LESS(5,15,0) && \
@@ -20,4 +21,15 @@ static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
}
#endif /* LINUX_VERSION_IS_LESS(5,15,0) */
+#if LINUX_VERSION_IS_LESS(5,16,0)
+static inline int backport_device_get_mac_address(struct device *dev, char *addr)
+{
+ if (!device_get_mac_address(dev, addr, ETH_ALEN))
+ return -ENOENT;
+
+ return 0;
+}
+#define device_get_mac_address LINUX_BACKPORT(device_get_mac_address)
+#endif /* LINUX_VERSION_IS_LESS(5,16,0) */
+
#endif /* _BACKPORT_LINUX_ETHERDEVICE_H */