b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | --- a/driver/wl_linux.c |
| 2 | +++ b/driver/wl_linux.c |
| 3 | @@ -235,7 +235,11 @@ |
| 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 +2517,18 @@ |
| 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 +2539,7 @@ |
| 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 +2591,13 @@ |
| 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; |