diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2021-12-22 14:26:02 -0800 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2022-06-27 22:34:05 +0200 |
commit | d989124c02bf5662ccf638d361229bd5ea7bcd93 (patch) | |
tree | b175c0824593fb449bffe5a5935c46c97503f4bd /package/kernel/broadcom-wl/patches/917-fix-compilation-for-5_10.patch | |
parent | d8f8c78d967c4c0b83e3ff045a4340932af38e4e (diff) | |
download | upstream-d989124c02bf5662ccf638d361229bd5ea7bcd93.tar.gz upstream-d989124c02bf5662ccf638d361229bd5ea7bcd93.tar.bz2 upstream-d989124c02bf5662ccf638d361229bd5ea7bcd93.zip |
broadcom-wl: Fix compilation with kernel 5.10
This adds a few fixes for compiling against Linux 5.10:
1. segment_eq() has been removed with upstream commit
428e2976a5bf7e7f5554286d7a5a33b8147b106a ("uaccess: remove
segment_eq") and can use uaccess_kernel() instead
2. ioremap_nocache() is removed and is now an alias for ioremap() with
upstream commit 4bdc0d676a643140bdf17dbf7eafedee3d496a3c ("remove
ioremap_nocache and devm_ioremap_nocache")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
(cherry picked from commit cd3de51bb4a18f922a961fdeb42c1c8f1f80b425)
Diffstat (limited to 'package/kernel/broadcom-wl/patches/917-fix-compilation-for-5_10.patch')
-rw-r--r-- | package/kernel/broadcom-wl/patches/917-fix-compilation-for-5_10.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/package/kernel/broadcom-wl/patches/917-fix-compilation-for-5_10.patch b/package/kernel/broadcom-wl/patches/917-fix-compilation-for-5_10.patch new file mode 100644 index 0000000000..98c0375be3 --- /dev/null +++ b/package/kernel/broadcom-wl/patches/917-fix-compilation-for-5_10.patch @@ -0,0 +1,42 @@ +Index: broadcom-wl-5.10.56.27.3/driver/wl_linux.c +=================================================================== +--- broadcom-wl-5.10.56.27.3.orig/driver/wl_linux.c ++++ broadcom-wl-5.10.56.27.3/driver/wl_linux.c +@@ -74,6 +74,10 @@ + #error "No support for Kernel Rev <= 2.4.5, As the older kernel revs doesn't support Tasklets" + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++#define ioremap_nocache ioremap ++#endif ++ + typedef void wlc_info_t; + typedef void wlc_hw_info_t; + #include <wlc_pub.h> +@@ -1915,7 +1919,11 @@ wl_ioctl(struct net_device *dev, struct + } + + /* optimization for direct ioctl calls from kernel */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0) + if (segment_eq(get_fs(), KERNEL_DS)) ++#else ++ if (uaccess_kernel()) ++#endif + buf = ioc.buf; + + else if (ioc.buf) { +Index: broadcom-wl-5.10.56.27.3/driver/linux_osl.c +=================================================================== +--- broadcom-wl-5.10.56.27.3.orig/driver/linux_osl.c ++++ broadcom-wl-5.10.56.27.3/driver/linux_osl.c +@@ -34,6 +34,10 @@ + #define OS_HANDLE_MAGIC 0x1234abcd /* Magic # to recognise osh */ + #define BCM_MEM_FILENAME_LEN 24 /* Mem. filename length */ + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) ++#define ioremap_nocache ioremap ++#endif ++ + typedef struct bcm_mem_link { + struct bcm_mem_link *prev; + struct bcm_mem_link *next; |