1From bc408ef546b08443dabbe8fcdfec5e1e48494ed8 Mon Sep 17 00:00:00 2001
2From: aszlig <aszlig@redmoonstudios.org>
3Date: Mon, 1 Aug 2016 20:45:47 +0200
4Subject: [PATCH 04/16] linuxPackages.broadcom_sta: fix build for kernel 4.7+
5
6Patch is from Arch Linux at:
7
8https://aur.archlinux.org/cgit/aur.git/tree/?h=broadcom-wl
9
10I've tested building against 3.18.36, 4.4.16 and 4.7.0.
11
12Signed-off-by: aszlig <aszlig@redmoonstudios.org>
13Cc: @phreedom, @vcunat
14
15Since Linux 4.7, the enum ieee80211_band is no longer used
16
17This shall cause no problem's since both enums ieee80211_band
18and nl80211_band were added in the same commit:
19https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c
20
21This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_*
22
23Reference:
24https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3
25---
26 src/wl/sys/wl_cfg80211_hybrid.c | 24 ++++++++++++------------
27 1 file changed, 12 insertions(+), 12 deletions(-)
28
29diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
30index 7b606e0..3b438ba 100644
31--- a/src/wl/sys/wl_cfg80211_hybrid.c
32+++ b/src/wl/sys/wl_cfg80211_hybrid.c
33@@ -236,7 +236,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX] = {
34 #endif
35
36 #define CHAN2G(_channel, _freq, _flags) { \
37- .band = IEEE80211_BAND_2GHZ, \
38+ .band = NL80211_BAND_2GHZ, \
39 .center_freq = (_freq), \
40 .hw_value = (_channel), \
41 .flags = (_flags), \
42@@ -245,7 +245,7 @@ static s8 wl_dbg_estr[][WL_DBG_ESTR_MAX] = {
43 }
44
45 #define CHAN5G(_channel, _flags) { \
46- .band = IEEE80211_BAND_5GHZ, \
47+ .band = NL80211_BAND_5GHZ, \
48 .center_freq = 5000 + (5 * (_channel)), \
49 .hw_value = (_channel), \
50 .flags = (_flags), \
51@@ -379,7 +379,7 @@ static struct ieee80211_channel __wl_5ghz_n_channels[] = {
52 };
53
54 static struct ieee80211_supported_band __wl_band_2ghz = {
55- .band = IEEE80211_BAND_2GHZ,
56+ .band = NL80211_BAND_2GHZ,
57 .channels = __wl_2ghz_channels,
58 .n_channels = ARRAY_SIZE(__wl_2ghz_channels),
59 .bitrates = wl_g_rates,
60@@ -387,7 +387,7 @@ static struct ieee80211_supported_band __wl_band_2ghz = {
61 };
62
63 static struct ieee80211_supported_band __wl_band_5ghz_a = {
64- .band = IEEE80211_BAND_5GHZ,
65+ .band = NL80211_BAND_5GHZ,
66 .channels = __wl_5ghz_a_channels,
67 .n_channels = ARRAY_SIZE(__wl_5ghz_a_channels),
68 .bitrates = wl_a_rates,
69@@ -395,7 +395,7 @@ static struct ieee80211_supported_band __wl_band_5ghz_a = {
70 };
71
72 static struct ieee80211_supported_band __wl_band_5ghz_n = {
73- .band = IEEE80211_BAND_5GHZ,
74+ .band = NL80211_BAND_5GHZ,
75 .channels = __wl_5ghz_n_channels,
76 .n_channels = ARRAY_SIZE(__wl_5ghz_n_channels),
77 .bitrates = wl_a_rates,
78@@ -1876,8 +1876,8 @@ static s32 wl_alloc_wdev(struct device *dev, struct wireless_dev **rwdev)
79 wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
80 #endif
81 wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
82- wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
83- wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a;
84+ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
85+ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a;
86 wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
87 wdev->wiphy->cipher_suites = __wl_cipher_suites;
88 wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
89@@ -2000,7 +2000,7 @@ static s32 wl_inform_single_bss(struct wl_cfg80211_priv *wl, struct wl_bss_info
90 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
91 freq = ieee80211_channel_to_frequency(notif_bss_info->channel,
92 (notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ?
93- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
94+ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ);
95 #else
96 freq = ieee80211_channel_to_frequency(notif_bss_info->channel);
97 #endif
98@@ -2116,7 +2116,7 @@ wl_notify_connect_status(struct wl_cfg80211_priv *wl, struct net_device *ndev,
99 return err;
100 }
101 chan = wf_chspec_ctlchan(chanspec);
102- band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
103+ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
104 freq = ieee80211_channel_to_frequency(chan, band);
105 channel = ieee80211_get_channel(wiphy, freq);
106 cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
107@@ -2250,10 +2250,10 @@ static void wl_ch_to_chanspec(struct ieee80211_channel *chan, struct wl_join_par
108 join_params->params.chanspec_list[0] =
109 ieee80211_frequency_to_channel(chan->center_freq);
110
111- if (chan->band == IEEE80211_BAND_2GHZ) {
112+ if (chan->band == NL80211_BAND_2GHZ) {
113 chanspec |= WL_CHANSPEC_BAND_2G;
114 }
115- else if (chan->band == IEEE80211_BAND_5GHZ) {
116+ else if (chan->band == NL80211_BAND_5GHZ) {
117 chanspec |= WL_CHANSPEC_BAND_5G;
118 }
119 else {
120@@ -2885,7 +2885,7 @@ static s32 wl_update_wiphybands(struct wl_cfg80211_priv *wl)
121
122 if (phy == 'n' || phy == 'a' || phy == 'v') {
123 wiphy = wl_to_wiphy(wl);
124- wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
125+ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n;
126 }
127
128 return err;
129--
1302.45.1
131