wifi-scripts: add script to add phy capabilities to board.json
[openwrt/staging/jow.git] / package / kernel / broadcom-wl / patches / 915-fix-wl_timer-for-4_15.patch
1 --- a/driver/wl_linux.c
2 +++ b/driver/wl_linux.c
3 @@ -235,7 +235,11 @@ struct wl_info {
4
5 };
6
7 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
8 +static void wl_timer(struct timer_list *tl);
9 +#else
10 static void wl_timer(ulong data);
11 +#endif
12 static void _wl_timer(wl_timer_t *t);
13
14 #ifdef WLC_HIGH_ONLY
15 @@ -2512,6 +2516,18 @@ wl_timer_task(wl_task_t *task)
16 }
17 #endif /* WLC_HIGH_ONLY */
18
19 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
20 +static void
21 +wl_timer(struct timer_list *tl)
22 +{
23 + wl_timer_t *t = from_timer(t, tl, timer);
24 +#ifndef WLC_HIGH_ONLY
25 + _wl_timer(t);
26 +#else
27 + wl_schedule_task(t->wl, wl_timer_task, t);
28 +#endif /* WLC_HIGH_ONLY */
29 +}
30 +#else
31 static void
32 wl_timer(ulong data)
33 {
34 @@ -2522,6 +2538,7 @@ wl_timer(ulong data)
35 wl_schedule_task(t->wl, wl_timer_task, t);
36 #endif /* WLC_HIGH_ONLY */
37 }
38 +#endif /* linux >= 4.15.0 */
39
40 static void
41 _wl_timer(wl_timer_t *t)
42 @@ -2573,9 +2590,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(
43
44 bzero(t, sizeof(wl_timer_t));
45
46 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
47 + timer_setup(&t->timer, wl_timer, 0);
48 +#else
49 init_timer(&t->timer);
50 t->timer.data = (ulong) t;
51 t->timer.function = wl_timer;
52 +#endif
53 t->wl = wl;
54 t->fn = fn;
55 t->arg = arg;