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>
This commit is contained in:
parent
22168ae681
commit
cd3de51bb4
4 changed files with 50 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
||||||
--- broadcom-wl-5.10.56.27.3/driver/wl_linux.c.orig 2018-01-13 18:25:14.944667645 +0100
|
--- a/driver/wl_linux.c
|
||||||
+++ broadcom-wl-5.10.56.27.3/driver/wl_linux.c 2018-01-13 18:25:25.836667888 +0100
|
+++ b/driver/wl_linux.c
|
||||||
@@ -2762,7 +2762,6 @@
|
@@ -2762,7 +2762,6 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rx
|
||||||
bcopy(oskb->data + D11_PHY_HDR_LEN, pdata, oskb->len - D11_PHY_HDR_LEN);
|
bcopy(oskb->data + D11_PHY_HDR_LEN, pdata, oskb->len - D11_PHY_HDR_LEN);
|
||||||
|
|
||||||
skb->dev = wl->monitor;
|
skb->dev = wl->monitor;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/driver/wl_linux.c
|
--- a/driver/wl_linux.c
|
||||||
+++ b/driver/wl_linux.c
|
+++ b/driver/wl_linux.c
|
||||||
@@ -235,7 +235,11 @@
|
@@ -235,7 +235,11 @@ struct wl_info {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
static void _wl_timer(wl_timer_t *t);
|
static void _wl_timer(wl_timer_t *t);
|
||||||
|
|
||||||
#ifdef WLC_HIGH_ONLY
|
#ifdef WLC_HIGH_ONLY
|
||||||
@@ -2512,6 +2517,18 @@
|
@@ -2512,6 +2516,18 @@ wl_timer_task(wl_task_t *task)
|
||||||
}
|
}
|
||||||
#endif /* WLC_HIGH_ONLY */
|
#endif /* WLC_HIGH_ONLY */
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
static void
|
static void
|
||||||
wl_timer(ulong data)
|
wl_timer(ulong data)
|
||||||
{
|
{
|
||||||
@@ -2522,6 +2539,7 @@
|
@@ -2522,6 +2538,7 @@ wl_timer(ulong data)
|
||||||
wl_schedule_task(t->wl, wl_timer_task, t);
|
wl_schedule_task(t->wl, wl_timer_task, t);
|
||||||
#endif /* WLC_HIGH_ONLY */
|
#endif /* WLC_HIGH_ONLY */
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_wl_timer(wl_timer_t *t)
|
_wl_timer(wl_timer_t *t)
|
||||||
@@ -2573,9 +2591,13 @@
|
@@ -2573,9 +2590,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
|
||||||
|
|
||||||
bzero(t, sizeof(wl_timer_t));
|
bzero(t, sizeof(wl_timer_t));
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/driver/wl_iw.c
|
--- a/driver/wl_iw.c
|
||||||
+++ b/driver/wl_iw.c
|
+++ b/driver/wl_iw.c
|
||||||
@@ -112,10 +112,14 @@
|
@@ -112,10 +112,14 @@ dev_wlc_ioctl(
|
||||||
ifr.ifr_data = (caddr_t) &ioc;
|
ifr.ifr_data = (caddr_t) &ioc;
|
||||||
|
|
||||||
/* Must be up for virtually all useful ioctls */
|
/* Must be up for virtually all useful ioctls */
|
||||||
|
|
|
@ -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;
|
Loading…
Reference in a new issue