Skip to content

Commit 37a3317

Browse files
Added Kernel 5.17 support
1 parent 7f38c0c commit 37a3317

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

os_dep/linux/os_intfs.c

+8
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,11 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
16341634
}
16351635

16361636
_rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
1637+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
16371638
_rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
1639+
#else
1640+
dev_addr_set(pnetdev, sa->sa_data); /* set mac addr to net_device */
1641+
#endif
16381642

16391643
#if 0
16401644
if (rtw_is_hw_init_completed(padapter)) {
@@ -2170,7 +2174,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
21702174
/* alloc netdev name */
21712175
rtw_init_netdev_name(ndev, name);
21722176

2177+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
21732178
_rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
2179+
#else
2180+
dev_addr_set(ndev, adapter_mac_addr(adapter));
2181+
#endif
21742182

21752183
/* Tell the network stack we exist */
21762184

0 commit comments

Comments
 (0)