diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 35d6c1e..df56d31 100755 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -1483,11 +1483,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO , pattr_content, (uint *)&attr_contentlen); -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) _rtw_memcpy(psta->dev_addr, pattr_content, ETH_ALEN);/* P2P Device Address */ -#else - dev_addr_set(psta, pattr_content); -#endif pattr_content += ETH_ALEN; _rtw_memcpy(&psta->config_methods, pattr_content, 2);/* Config Methods */ diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h index 8a3f15e..faab0d3 100755 --- a/include/osdep_service_linux.h +++ b/include/osdep_service_linux.h @@ -484,7 +484,11 @@ static inline void rtw_thread_enter(char *name) static inline void rtw_thread_exit(_completion *comp) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) complete_and_exit(comp, 0); +#else + kthread_complete_and_exit(comp, 0); +#endif } static inline _thread_hdl_ rtw_thread_start(int (*threadfn)(void *data), diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c index 72d7ea1..219d62c 100755 --- a/os_dep/linux/rtw_proc.c +++ b/os_dep/linux/rtw_proc.c @@ -235,7 +235,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; @@ -264,7 +268,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; @@ -5119,7 +5127,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); @@ -5149,7 +5161,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; @@ -5380,7 +5396,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); @@ -5410,7 +5430,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; diff --git a/phl/pltfm_ops_linux.h b/phl/pltfm_ops_linux.h index 7a5feab..6817ac1 100755 --- a/phl/pltfm_ops_linux.h +++ b/phl/pltfm_ops_linux.h @@ -578,7 +578,7 @@ static inline u8 _os_tasklet_init(void *drv_priv, _os_tasklet *task, void (*call_back_func)(void* context), void *context) { rtw_tasklet_init(task, - (void(*)(unsigned long))call_back_func, + (void *)call_back_func, (unsigned long)task); return 0; }