blob: eb261e9140686d05ab01884d360bf66934a3a23f [file] [log] [blame]
Jon West56e83b32021-04-14 12:38:06 -04001--- a/src/wl/sys/wl_linux.c
2+++ b/src/wl/sys/wl_linux.c
3@@ -93,7 +93,13 @@ struct iw_statistics *wl_get_wireless_st
4
5 #include <wlc_wowl.h>
6
7-static void wl_timer(ulong data);
8+static void wl_timer(
9+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
10+ struct timer_list *tl
11+#else
12+ ulong data
13+#endif
14+ );
15 static void _wl_timer(wl_timer_t *t);
16 static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
17
18@@ -2298,9 +2304,19 @@ wl_timer_task(wl_task_t *task)
19 }
20
21 static void
22-wl_timer(ulong data)
23-{
24- wl_timer_t *t = (wl_timer_t *)data;
25+wl_timer(
26+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
27+ struct timer_list *tl
28+#else
29+ ulong data
30+#endif
31+) {
32+ wl_timer_t *t =
33+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
34+ from_timer(t, tl, timer);
35+#else
36+ (wl_timer_t *)data;
37+#endif
38
39 if (!WL_ALL_PASSIVE_ENAB(t->wl))
40 _wl_timer(t);
41@@ -2352,9 +2368,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
42
43 bzero(t, sizeof(wl_timer_t));
44
45+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
46+ timer_setup(&t->timer, wl_timer, 0);
47+#else
48 init_timer(&t->timer);
49 t->timer.data = (ulong) t;
50 t->timer.function = wl_timer;
51+#endif
52 t->wl = wl;
53 t->fn = fn;
54 t->arg = arg;