--- zzzz-none-000/linux-3.10.107/include/linux/etherdevice.h 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/include/linux/etherdevice.h 2021-11-10 11:53:56.000000000 +0000 @@ -198,8 +198,33 @@ eth_random_addr(dev->dev_addr); } +/* AVM: backported from 3.15, + * + * commit 286ab723d4b83d37deb4017008ef1444a95cfb0d etherdevice: Use ether_addr_copy to copy an Ethernet address + */ /** - * compare_ether_addr - Compare two Ethernet addresses + * ether_addr_copy - Copy an Ethernet address + * @dst: Pointer to a six-byte array Ethernet address destination + * @src: Pointer to a six-byte array Ethernet address source + * + * Please note: dst & src must both be aligned to u16. + */ +static inline void ether_addr_copy(u8 *dst, const u8 *src) +{ +#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) + *(u32 *)dst = *(const u32 *)src; + *(u16 *)(dst + 4) = *(const u16 *)(src + 4); +#else + u16 *a = (u16 *)dst; + const u16 *b = (const u16 *)src; + + a[0] = b[0]; + a[1] = b[1]; + a[2] = b[2]; +#endif +} + +/** * compare_ether_addr - Compare two Ethernet addresses * @addr1: Pointer to a six-byte array containing the Ethernet address * @addr2: Pointer other six-byte array containing the Ethernet address *