Closed patbarron closed 3 years ago
Same here on Manjaro kernel 5.10.rc4 . So, either these API calls get removed or we are stuck on a LTS kernel eh?
Maybe this patch will help:
https://www.krauttranslate.de/~sauerland/Patches/rtl8821cu-kernel510.patch
It looks like this proposed patch just ifdef's out the calls to set_fs() and get_fs(), without replacing them with anything - does that actually work? If so, why bother using these APIs in the first place?
Change #ifdef set_fs to #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
But the old patch has also worked.
The old one was ported from here: https://github.com/Mange/rtl8192eu-linux-driver/pull/201 https://github.com/Mange/rtl8192eu-linux-driver/pull/201/commits/8ba6813bfd8c0d3a796dc0a441458d017ec9df15
5.10.1 is still error:
os_dep/osdep_service.c:2240:12: error: incompatible types when assigning to type ‘mm_segment_t’ from type ‘int’
2240 | oldfs = get_fs();
| ^~~~~~
Here it builds against kernel 5.10.1: https://build.opensuse.org/build/home:Sauerland/Kernel_HEAD/x86_64/rtl8821cu/_log https://build.opensuse.org/package/live_build_log/home:Sauerland/rtl8821cu/Kernel_stable/x86_64
So maybe a bug in your patch?
Fixed
The rtl8821CU driver doesn't build on kernel version 5.10.0-0.rc3.68.fc34.x86_64 (Fedora Rawhide) because the get_fs() and set_fs() APIs have been removed from the kernel. These kernel APIs are called from several places in the driver.
core/rtw_btcoex.c core/rtw_wlan_util.c os_dep/linux/os_intfs.c os_dep/linux/osdep_service.c
The use of these APIs has been discouraged for some time, and they were finally removed in kernel 5.10-rc1.
See https://www.zdnet.com/article/linux-5-10-finally-ditches-decades-old-tool-that-caused-security-bugs for some additional details.