1From 5a0301c2d9c65dbb3c5b8990e635d37f071d26c4 Mon Sep 17 00:00:00 2001
2From: georgewhewell <georgerw@gmail.com>
3Date: Fri, 2 Jun 2017 14:19:04 +0100
4Subject: [PATCH 06/16] linuxPackages.broadcom_sta: fix build for kernel 4.11+
5
6---
7 src/wl/sys/wl_cfg80211_hybrid.c | 3 +++
8 src/wl/sys/wl_linux.c | 12 ++++++++++++
9 2 files changed, 15 insertions(+)
10
11diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
12index 84f0068..9fd8ed1 100644
13--- a/src/wl/sys/wl_cfg80211_hybrid.c
14+++ b/src/wl/sys/wl_cfg80211_hybrid.c
15@@ -30,6 +30,9 @@
16 #include <linux/kthread.h>
17 #include <linux/netdevice.h>
18 #include <linux/ieee80211.h>
19+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
20+#include <linux/sched/signal.h>
21+#endif
22 #include <net/cfg80211.h>
23 #include <linux/nl80211.h>
24 #include <net/rtnetlink.h>
25diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
26index 65d7a22..18841d9 100644
27--- a/src/wl/sys/wl_linux.c
28+++ b/src/wl/sys/wl_linux.c
29@@ -117,6 +117,9 @@ int wl_found = 0;
30
31 typedef struct priv_link {
32 wl_if_t *wlif;
33+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
34+ unsigned long last_rx;
35+#endif
36 } priv_link_t;
37
38 #define WL_DEV_IF(dev) ((wl_if_t*)((priv_link_t*)DEV_PRIV(dev))->wlif)
39@@ -2451,6 +2454,9 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
40 {
41 struct sk_buff *oskb = (struct sk_buff *)p;
42 struct sk_buff *skb;
43+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
44+ priv_link_t *priv_link;
45+#endif
46 uchar *pdata;
47 uint len;
48
49@@ -2917,7 +2923,13 @@ wl_monitor(wl_info_t *wl, wl_rxsts_t *rxsts, void *p)
50 if (skb == NULL) return;
51
52 skb->dev = wl->monitor_dev;
53+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
54+ priv_link = MALLOC(wl->osh, sizeof(priv_link_t));
55+ priv_link = netdev_priv(skb->dev);
56+ priv_link->last_rx = jiffies;
57+#else
58 skb->dev->last_rx = jiffies;
59+#endif
60 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
61 skb_reset_mac_header(skb);
62 #else
63--
642.45.1
65