aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-04-02 19:52:00 +0200
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-04-12 12:35:37 +0200
commitd761b9f21114478f9cc09f5c358a05be0870cc5d (patch)
treeaa6d2926602aae231cb426e0b9c45aa29242ea02 /package
parente66becb490796d0787f8bd2448ee6f14198a904a (diff)
downloadupstream-d761b9f21114478f9cc09f5c358a05be0870cc5d.tar.gz
upstream-d761b9f21114478f9cc09f5c358a05be0870cc5d.tar.bz2
upstream-d761b9f21114478f9cc09f5c358a05be0870cc5d.zip
broadcom-wl: fix compilation with kernel >= 4.15
Since kernel 4.15, init_timer is not available anymore, and has been replaced by timer_setup. The fixes compilation of wl_linuc.c, which returned the following errors beforehand (line-wrapped manually): .../broadcom-wl-5.10.56.27.3/driver/wl_linux.c: In function 'wl_init_timer': .../broadcom-wl-5.10.56.27.3/driver/wl_linux.c:2576:2: error: implicit declaration of function 'init_timer'; did you mean 'init_timers'? [-Werror=implicit-function-declaration] init_timer(&t->timer); ^~~~~~~~~~ init_timers .../broadcom-wl-5.10.56.27.3/driver/wl_linux.c:2577:10: error: 'struct timer_list' has no member named 'data' t->timer.data = (ulong) t; ^ .../broadcom-wl-5.10.56.27.3/driver/wl_linux.c:2578:20: error: assignment to 'void (*)(struct timer_list *)' from incompatible pointer type 'void (*)(ulong)' {aka 'void (*)(long unsigned int)'} [-Werror=incompatible-pointer-types] t->timer.function = wl_timer; This should fix build of several devices on bcm63xx with testing kernel (4.19). Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'package')
-rw-r--r--package/kernel/broadcom-wl/patches/915-fix-wl_timer-for-4_15.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/package/kernel/broadcom-wl/patches/915-fix-wl_timer-for-4_15.patch b/package/kernel/broadcom-wl/patches/915-fix-wl_timer-for-4_15.patch
new file mode 100644
index 0000000000..daf3160952
--- /dev/null
+++ b/package/kernel/broadcom-wl/patches/915-fix-wl_timer-for-4_15.patch
@@ -0,0 +1,55 @@
+--- a/driver/wl_linux.c
++++ b/driver/wl_linux.c
+@@ -235,7 +235,11 @@
+
+ };
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
++static void wl_timer(struct timer_list *tl);
++#else
+ static void wl_timer(ulong data);
++#endif
+ static void _wl_timer(wl_timer_t *t);
+
+ #ifdef WLC_HIGH_ONLY
+@@ -2512,6 +2517,18 @@
+ }
+ #endif /* WLC_HIGH_ONLY */
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
++static void
++wl_timer(struct timer_list *tl)
++{
++ wl_timer_t *t = from_timer(t, tl, timer);
++#ifndef WLC_HIGH_ONLY
++ _wl_timer(t);
++#else
++ wl_schedule_task(t->wl, wl_timer_task, t);
++#endif /* WLC_HIGH_ONLY */
++}
++#else
+ static void
+ wl_timer(ulong data)
+ {
+@@ -2522,6 +2539,7 @@
+ wl_schedule_task(t->wl, wl_timer_task, t);
+ #endif /* WLC_HIGH_ONLY */
+ }
++#endif /* linux >= 4.15.0 */
+
+ static void
+ _wl_timer(wl_timer_t *t)
+@@ -2573,9 +2591,13 @@
+
+ bzero(t, sizeof(wl_timer_t));
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
++ timer_setup(&t->timer, wl_timer, 0);
++#else
+ init_timer(&t->timer);
+ t->timer.data = (ulong) t;
+ t->timer.function = wl_timer;
++#endif
+ t->wl = wl;
+ t->fn = fn;
+ t->arg = arg;