Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 59 lines 1.6 kB view raw
1From ae88c3c0c91d26ca5e4dc1e498a370747d2c3b03 Mon Sep 17 00:00:00 2001 2From: Yegor Timoshenko <yegortimoshenko@riseup.net> 3Date: Wed, 31 Jan 2018 22:59:09 +0000 4Subject: [PATCH 08/16] linuxPackages.broadcom_sta: fix build for kernel 4.15+ 5 6See: https://lkml.org/lkml/2017/11/25/90 7--- 8 src/wl/sys/wl_linux.c | 14 ++++++++++++++ 9 1 file changed, 14 insertions(+) 10 11diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c 12index 18841d9..83b8859 100644 13--- a/src/wl/sys/wl_linux.c 14+++ b/src/wl/sys/wl_linux.c 15@@ -93,7 +93,11 @@ struct iw_statistics *wl_get_wireless_stats(struct net_device *dev); 16 17 #include <wlc_wowl.h> 18 19+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) 20+static void wl_timer(struct timer_list *tl); 21+#else 22 static void wl_timer(ulong data); 23+#endif 24 static void _wl_timer(wl_timer_t *t); 25 static struct net_device *wl_alloc_linux_if(wl_if_t *wlif); 26 27@@ -2303,9 +2307,15 @@ wl_timer_task(wl_task_t *task) 28 } 29 30 static void 31+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) 32+wl_timer(struct timer_list *tl) 33+{ 34+ wl_timer_t *t = from_timer(t, tl, timer); 35+#else 36 wl_timer(ulong data) 37 { 38 wl_timer_t *t = (wl_timer_t *)data; 39+#endif 40 41 if (!WL_ALL_PASSIVE_ENAB(t->wl)) 42 _wl_timer(t); 43@@ -2357,9 +2367,13 @@ wl_init_timer(wl_info_t *wl, void (*fn)(void *arg), void *arg, const char *tname 44 45 bzero(t, sizeof(wl_timer_t)); 46 47+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) 48+ timer_setup(&t->timer, wl_timer, 0); 49+#else 50 init_timer(&t->timer); 51 t->timer.data = (ulong) t; 52 t->timer.function = wl_timer; 53+#endif 54 t->wl = wl; 55 t->fn = fn; 56 t->arg = arg; 57-- 582.45.1 59