openwrt/package/kernel/broadcom-wl/patches/915-fix-wl_timer-for-4_15.patch
Florian Fainelli cd3de51bb4 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>
2022-06-20 14:29:12 -07:00

56 lines
1.2 KiB
Diff

--- a/driver/wl_linux.c
+++ b/driver/wl_linux.c
@@ -235,7 +235,11 @@ struct wl_info {
};
+#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 +2516,18 @@ wl_timer_task(wl_task_t *task)
}
#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 +2538,7 @@ wl_timer(ulong data)
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 +2590,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
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;