Skip to content

Commit

Permalink
Buildfix for Linux 5.17
Browse files Browse the repository at this point in the history
Buildfix for Linux 5.17
  • Loading branch information
kelebek333 committed Mar 9, 2022
1 parent 2c374f4 commit c5d940d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,11 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
}

_rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
eth_hw_addr_set(pnetdev, sa->sa_data);
#else
_rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
#endif

#if 0
if (rtw_is_hw_init_completed(padapter)) {
Expand Down Expand Up @@ -1841,7 +1845,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
/* alloc netdev name */
rtw_init_netdev_name(ndev, name);

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
eth_hw_addr_set(ndev, adapter_mac_addr(adapter));
#else
_rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
#endif

/* Tell the network stack we exist */

Expand Down Expand Up @@ -5366,3 +5374,4 @@ int rtw_vendor_ie_set_api(struct net_device *dev, char *extra)
EXPORT_SYMBOL(rtw_vendor_ie_set_api);

#endif

0 comments on commit c5d940d

Please sign in to comment.