mirror of
https://github.com/cilynx/rtl88x2bu
synced 2025-08-29 13:28:14 +00:00
Fix build since dev_addr constification
Since commit adeef3e32146 ("net: constify netdev->dev_addr") the driver no longer builds with various complaints about discarded const classifiers. This is fixed by switching to the helper directly.
This commit is contained in:
parent
e8ad266af8
commit
d5ca8f06ac
@ -9813,7 +9813,11 @@ static int rtw_mp_efuse_set(struct net_device *dev,
|
||||
rtw_hal_read_chip_info(padapter);
|
||||
/* set mac addr*/
|
||||
rtw_macaddr_cfg(adapter_mac_addr(padapter), get_hal_mac_addr(padapter));
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
|
||||
eth_hw_addr_set(padapter->pnetdev, get_hal_mac_addr(padapter));
|
||||
#else
|
||||
_rtw_memcpy(padapter->pnetdev->dev_addr, get_hal_mac_addr(padapter), ETH_ALEN); /* set mac addr to net_device */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter));
|
||||
|
@ -1477,7 +1477,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)) {
|
||||
@ -1915,7 +1919,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
|
||||
#if defined(CONFIG_NET_NS)
|
||||
dev_net_set(ndev, wiphy_net(adapter_to_wiphy(adapter)));
|
||||
#endif //CONFIG_NET_NS
|
||||
|
@ -2561,7 +2561,12 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
|
||||
|
||||
rtw_init_netdev_name(pnetdev, ifname);
|
||||
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
|
||||
eth_hw_addr_set(pnetdev, adapter_mac_addr(padapter));
|
||||
#else
|
||||
_rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
#endif
|
||||
|
||||
if (rtnl_lock_needed)
|
||||
ret = register_netdev(pnetdev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user