diff --git a/hal/rtl8723d/rtl8723d_hal_init.c b/hal/rtl8723d/rtl8723d_hal_init.c index b7454b3..8c91b0e 100644 --- a/hal/rtl8723d/rtl8723d_hal_init.c +++ b/hal/rtl8723d/rtl8723d_hal_init.c @@ -5250,7 +5250,7 @@ void SetHwReg8723D(PADAPTER padapter, u8 variable, u8 *val) val32 |= RCR_CBSSID_DATA | RCR_CBSSID_BCN; else val32 &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN); - rtw_write32(padapter, REG_RCR, val32); + rtw_write32(padapter, REG_RCR, val32); } break; @@ -5339,7 +5339,7 @@ void SetHwReg8723D(PADAPTER padapter, u8 variable, u8 *val) regTmp = 0; if (bShortPreamble) regTmp |= 0x80; - rtw_write8(padapter, REG_RRSR + 2, regTmp); + rtw_write8(padapter, REG_RRSR + 2, regTmp); } break; diff --git a/hal/rtl8723d/sdio/rtl8723ds_recv.c b/hal/rtl8723d/sdio/rtl8723ds_recv.c index 2ff8f5a..54f1144 100644 --- a/hal/rtl8723d/sdio/rtl8723ds_recv.c +++ b/hal/rtl8723d/sdio/rtl8723ds_recv.c @@ -421,7 +421,7 @@ s32 rtl8723ds_init_recv_priv(PADAPTER padapter) /* 3 2. init tasklet */ tasklet_init(&precvpriv->recv_tasklet, - (void(*)(unsigned long))rtl8723ds_recv_tasklet, + (void *)rtl8723ds_recv_tasklet, (unsigned long)padapter); goto exit; diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h index 919d581..6f27da2 100644 --- a/include/osdep_service_linux.h +++ b/include/osdep_service_linux.h @@ -175,7 +175,11 @@ typedef void *_thread_hdl_; typedef int thread_return; typedef void *thread_context; +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) #define thread_exit() complete_and_exit(NULL, 0) +#else +#define thread_exit() kthread_complete_and_exit(NULL, 0) +#endif typedef void timer_hdl_return; typedef void *timer_hdl_context; diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index b9d5cf9..62494a8 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -10213,7 +10213,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) _rtw_memcpy(padapter->pnetdev->dev_addr, get_hal_mac_addr(padapter), ETH_ALEN); /* set mac addr to net_device */ +#else + dev_addr_set(padapter->pnetdev, get_hal_mac_addr(padapter)); /* set mac addr to net_device */ +#endif #ifdef CONFIG_P2P rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter)); diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index f4ba3b1..d87438e 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -982,7 +982,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) _rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */ +#else + dev_addr_set(pnetdev, sa->sa_data); /* set mac addr to net_device */ +#endif #if 0 if (rtw_is_hw_init_completed(padapter)) { @@ -1386,7 +1390,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) _rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN); +#else + dev_addr_set(ndev, adapter_mac_addr(adapter)); +#endif /* Tell the network stack we exist */ @@ -2212,7 +2220,11 @@ int _netdev_vir_if_open(struct net_device *pnetdev) rtw_mbid_camid_alloc(padapter, adapter_mac_addr(padapter)); #endif rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN); +#else + dev_addr_set(pnetdev, adapter_mac_addr(padapter); +#endif } #endif /*CONFIG_PLATFORM_INTEL_BYT*/ @@ -2715,7 +2727,11 @@ int _netdev_open(struct net_device *pnetdev) rtw_mbid_camid_alloc(padapter, adapter_mac_addr(padapter)); #endif rtw_init_wifidirect_addrs(padapter, adapter_mac_addr(padapter), adapter_mac_addr(padapter)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN); +#else + dev_addr_set(pnetdev, adapter_mac_addr(padapter)); +#endif #endif /* CONFIG_PLATFORM_INTEL_BYT */ rtw_clr_surprise_removed(padapter); diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c index eb3d8ce..a3df06a 100644 --- a/os_dep/linux/rtw_proc.c +++ b/os_dep/linux/rtw_proc.c @@ -193,7 +193,11 @@ const int drv_proc_hdls_num = sizeof(drv_proc_hdls) / sizeof(struct rtw_proc_hdl static int rtw_drv_proc_open(struct inode *inode, struct file *file) { /* struct net_device *dev = proc_get_parent_data(inode); */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(inode); +#else + ssize_t index = (ssize_t)pde_data(inode); +#endif const struct rtw_proc_hdl *hdl = drv_proc_hdls + index; void *private = NULL; @@ -215,7 +219,11 @@ static int rtw_drv_proc_open(struct inode *inode, struct file *file) static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(file_inode(file)); +#else + ssize_t index = (ssize_t)pde_data(file_inode(file)); +#endif const struct rtw_proc_hdl *hdl = drv_proc_hdls + index; ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write; @@ -2319,7 +2327,11 @@ const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(struct rtw_ static int rtw_adapter_proc_open(struct inode *inode, struct file *file) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(inode); +#else + ssize_t index = (ssize_t)pde_data(inode); +#endif const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index; void *private = proc_get_parent_data(inode); @@ -2341,7 +2353,11 @@ static int rtw_adapter_proc_open(struct inode *inode, struct file *file) static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(file_inode(file)); +#else + ssize_t index = (ssize_t)pde_data(file_inode(file)); +#endif const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index; ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write; @@ -2674,7 +2690,11 @@ const int odm_proc_hdls_num = sizeof(odm_proc_hdls) / sizeof(struct rtw_proc_hdl static int rtw_odm_proc_open(struct inode *inode, struct file *file) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(inode); +#else + ssize_t index = (ssize_t)pde_data(inode); +#endif const struct rtw_proc_hdl *hdl = odm_proc_hdls + index; void *private = proc_get_parent_data(inode); @@ -2696,7 +2716,11 @@ static int rtw_odm_proc_open(struct inode *inode, struct file *file) static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(file_inode(file)); +#else + ssize_t index = (ssize_t)pde_data(file_inode(file)); +#endif const struct rtw_proc_hdl *hdl = odm_proc_hdls + index; ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write; @@ -2833,7 +2857,11 @@ const int mcc_proc_hdls_num = sizeof(mcc_proc_hdls) / sizeof(struct rtw_proc_hdl static int rtw_mcc_proc_open(struct inode *inode, struct file *file) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(inode); +#else + ssize_t index = (ssize_t)pde_data(inode); +#endif const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index; void *private = proc_get_parent_data(inode); @@ -2855,7 +2883,11 @@ static int rtw_mcc_proc_open(struct inode *inode, struct file *file) static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) ssize_t index = (ssize_t)PDE_DATA(file_inode(file)); +#else + ssize_t index = (ssize_t)pde_data(file_inode(file)); +#endif const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index; ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write; diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index a65e6f9..26ec88e 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1558,7 +1558,11 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname) rtw_init_netdev_name(pnetdev, ifname); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) _rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN); +#else + dev_addr_set(pnetdev, adapter_mac_addr(padapter)); +#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)) if (!rtnl_is_locked())