diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index e9ed317..12bfb41 100644 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -416,7 +416,7 @@ static unsigned int rtw_classify8021d(struct sk_buff *skb) static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)) struct net_device *sb_dev -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)) struct net_device *sb_dev, select_queue_fallback_t fallback #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index ad7a7f3..a169ffc 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -905,7 +905,9 @@ static int isFileReadable(char *path) { struct file *fp; int ret = 0; +#ifdef set_fs mm_segment_t oldfs; +#endif char buf; fp=filp_open(path, O_RDONLY, 0); @@ -913,12 +915,16 @@ static int isFileReadable(char *path) ret = PTR_ERR(fp); } else { +#ifdef set_fs oldfs = get_fs(); set_fs(KERNEL_DS); +#endif if (1!=readFile(fp, &buf, 1)) ret = PTR_ERR(fp); +#ifdef set_fs set_fs(oldfs); +#endif filp_close(fp,NULL); } return ret; @@ -940,7 +946,9 @@ static int retriveFromFile(char *path, u8* buf, u32 sz) if ( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ) { DBG_88E("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp); +#ifdef set_fs set_fs(KERNEL_DS); +#endif ret=readFile(fp, buf, sz); closeFile(fp); @@ -972,7 +980,9 @@ static int storeToFile(char *path, u8* buf, u32 sz) if ( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) { DBG_88E("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp); +#ifdef set_fs set_fs(KERNEL_DS); +#endif ret=writeFile(fp, buf, sz); closeFile(fp); diff --git a/os_dep/rtw_android.c b/os_dep/rtw_android.c index ec62ddf..7c6bc9c 100644 --- a/os_dep/rtw_android.c +++ b/os_dep/rtw_android.c @@ -356,7 +356,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) goto exit; } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)) if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) { #else if (!access_ok(VERIFY_READ, (const void __user *)priv_cmd.buf,