Xilinx / open-nic-driver

AMD OpenNIC driver includes the Linux kernel driver
GNU General Public License v2.0
55 stars 40 forks source link

eth_hw_addr_set #49

Open lglgdouble opened 1 year ago

lglgdouble commented 1 year ago

/data/open-nic/dpdk/open-nic-driver/onic_netdev.c: In function ‘onic_set_mac_address’: /data/open-nic/dpdk/open-nic-driver/onic_netdev.c:755:2: error: implicit declaration of function ‘eth_hw_addr_set’; did you mean ‘eth_addr_dec’? [-Werror=implicit-function-declaration] eth_hw_addr_set(dev, dev_addr); ^~~~~~~ eth_addr_dec

slahmer97 commented 11 months ago

your $(uname -r) < 5.15 you can get around it by adding the following into onic_netdev.c


#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
{
    memcpy(dev->dev_addr, addr, ETH_ALEN);
}
#endif