mac80211: update to wireless-testing 2016-05-12
[openwrt/staging/yousong.git] / package / kernel / mwlwifi / patches / 110-api_sync.patch
1 --- a/mac80211.c
2 +++ b/mac80211.c
3 @@ -260,12 +260,12 @@ static int mwl_mac80211_config(struct ie
4 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
5 int rate = 0;
6
7 - if (conf->chandef.chan->band == IEEE80211_BAND_2GHZ) {
8 + if (conf->chandef.chan->band == NL80211_BAND_2GHZ) {
9 mwl_fwcmd_set_apmode(hw, AP_MODE_2_4GHZ_11AC_MIXED);
10 mwl_fwcmd_set_linkadapt_cs_mode(hw,
11 LINK_CS_STATE_CONSERV);
12 rate = mwl_rates_24[0].hw_value;
13 - } else if (conf->chandef.chan->band == IEEE80211_BAND_5GHZ) {
14 + } else if (conf->chandef.chan->band == NL80211_BAND_5GHZ) {
15 mwl_fwcmd_set_apmode(hw, AP_MODE_11AC);
16 mwl_fwcmd_set_linkadapt_cs_mode(hw,
17 LINK_CS_STATE_AUTO);
18 @@ -333,7 +333,7 @@ static void mwl_mac80211_bss_info_change
19 if (idx)
20 idx--;
21
22 - if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ)
23 + if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ)
24 rate = mwl_rates_24[idx].hw_value;
25 else
26 rate = mwl_rates_50[idx].hw_value;
27 @@ -600,10 +600,13 @@ static int mwl_mac80211_get_survey(struc
28
29 static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw,
30 struct ieee80211_vif *vif,
31 - enum ieee80211_ampdu_mlme_action action,
32 - struct ieee80211_sta *sta,
33 - u16 tid, u16 *ssn, u8 buf_size, bool amsdu)
34 + struct ieee80211_ampdu_params *params)
35 {
36 + enum ieee80211_ampdu_mlme_action action = params->action;
37 + struct ieee80211_sta *sta = params->sta;
38 + u16 tid = params->tid;
39 + u16 *ssn = &params->ssn;
40 + u8 buf_size = params->buf_size;
41 int rc = 0;
42 struct mwl_priv *priv = hw->priv;
43 struct mwl_ampdu_stream *stream;
44 --- a/fwcmd.c
45 +++ b/fwcmd.c
46 @@ -730,9 +730,9 @@ static int mwl_fwcmd_set_country_code(st
47 bool enable = false;
48
49 if (b_inf->ie_country_ptr) {
50 - if (bss_conf->chandef.chan->band == IEEE80211_BAND_2GHZ)
51 + if (bss_conf->chandef.chan->band == NL80211_BAND_2GHZ)
52 a_band = false;
53 - else if (bss_conf->chandef.chan->band == IEEE80211_BAND_5GHZ)
54 + else if (bss_conf->chandef.chan->band == NL80211_BAND_5GHZ)
55 a_band = true;
56 else
57 return -EINVAL;
58 @@ -1075,9 +1075,9 @@ int mwl_fwcmd_max_tx_power(struct ieee80
59 break;
60 }
61
62 - if (channel->band == IEEE80211_BAND_2GHZ)
63 + if (channel->band == NL80211_BAND_2GHZ)
64 band = FREQ_BAND_2DOT4GHZ;
65 - else if (channel->band == IEEE80211_BAND_5GHZ)
66 + else if (channel->band == NL80211_BAND_5GHZ)
67 band = FREQ_BAND_5GHZ;
68
69 switch (conf->chandef.width) {
70 @@ -1161,9 +1161,9 @@ int mwl_fwcmd_tx_power(struct ieee80211_
71 break;
72 }
73
74 - if (channel->band == IEEE80211_BAND_2GHZ)
75 + if (channel->band == NL80211_BAND_2GHZ)
76 band = FREQ_BAND_2DOT4GHZ;
77 - else if (channel->band == IEEE80211_BAND_5GHZ)
78 + else if (channel->band == NL80211_BAND_5GHZ)
79 band = FREQ_BAND_5GHZ;
80
81 switch (conf->chandef.width) {
82 @@ -1354,9 +1354,9 @@ int mwl_fwcmd_set_rf_channel(struct ieee
83 pcmd->action = cpu_to_le16(WL_SET);
84 pcmd->curr_chnl = channel->hw_value;
85
86 - if (channel->band == IEEE80211_BAND_2GHZ) {
87 + if (channel->band == NL80211_BAND_2GHZ) {
88 freq_band = FREQ_BAND_2DOT4GHZ;
89 - } else if (channel->band == IEEE80211_BAND_5GHZ) {
90 + } else if (channel->band == NL80211_BAND_5GHZ) {
91 freq_band = FREQ_BAND_5GHZ;
92 } else {
93 mutex_unlock(&priv->fwcmd_mutex);
94 @@ -1923,10 +1923,10 @@ int mwl_fwcmd_set_new_stn_add(struct iee
95 }
96 ether_addr_copy(pcmd->mac_addr, sta->addr);
97
98 - if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ)
99 - rates = sta->supp_rates[IEEE80211_BAND_2GHZ];
100 + if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ)
101 + rates = sta->supp_rates[NL80211_BAND_2GHZ];
102 else
103 - rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5;
104 + rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5;
105 pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates);
106
107 if (sta->ht_cap.ht_supported) {
108 @@ -2097,9 +2097,9 @@ int mwl_fwcmd_set_switch_channel(struct
109 if (priv->csa_active)
110 return 0;
111
112 - if (channel->band == IEEE80211_BAND_2GHZ)
113 + if (channel->band == NL80211_BAND_2GHZ)
114 freq_band = FREQ_BAND_2DOT4GHZ;
115 - else if (channel->band == IEEE80211_BAND_5GHZ)
116 + else if (channel->band == NL80211_BAND_5GHZ)
117 freq_band = FREQ_BAND_5GHZ;
118 else
119 return -EINVAL;
120 --- a/main.c
121 +++ b/main.c
122 @@ -63,20 +63,20 @@ static struct mwl_chip_info mwl_chip_tbl
123 };
124
125 static const struct ieee80211_channel mwl_channels_24[] = {
126 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2412, .hw_value = 1, },
127 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2417, .hw_value = 2, },
128 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2422, .hw_value = 3, },
129 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2427, .hw_value = 4, },
130 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2432, .hw_value = 5, },
131 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2437, .hw_value = 6, },
132 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2442, .hw_value = 7, },
133 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2447, .hw_value = 8, },
134 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2452, .hw_value = 9, },
135 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2457, .hw_value = 10, },
136 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2462, .hw_value = 11, },
137 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2467, .hw_value = 12, },
138 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2472, .hw_value = 13, },
139 - { .band = IEEE80211_BAND_2GHZ, .center_freq = 2484, .hw_value = 14, },
140 + { .band = NL80211_BAND_2GHZ, .center_freq = 2412, .hw_value = 1, },
141 + { .band = NL80211_BAND_2GHZ, .center_freq = 2417, .hw_value = 2, },
142 + { .band = NL80211_BAND_2GHZ, .center_freq = 2422, .hw_value = 3, },
143 + { .band = NL80211_BAND_2GHZ, .center_freq = 2427, .hw_value = 4, },
144 + { .band = NL80211_BAND_2GHZ, .center_freq = 2432, .hw_value = 5, },
145 + { .band = NL80211_BAND_2GHZ, .center_freq = 2437, .hw_value = 6, },
146 + { .band = NL80211_BAND_2GHZ, .center_freq = 2442, .hw_value = 7, },
147 + { .band = NL80211_BAND_2GHZ, .center_freq = 2447, .hw_value = 8, },
148 + { .band = NL80211_BAND_2GHZ, .center_freq = 2452, .hw_value = 9, },
149 + { .band = NL80211_BAND_2GHZ, .center_freq = 2457, .hw_value = 10, },
150 + { .band = NL80211_BAND_2GHZ, .center_freq = 2462, .hw_value = 11, },
151 + { .band = NL80211_BAND_2GHZ, .center_freq = 2467, .hw_value = 12, },
152 + { .band = NL80211_BAND_2GHZ, .center_freq = 2472, .hw_value = 13, },
153 + { .band = NL80211_BAND_2GHZ, .center_freq = 2484, .hw_value = 14, },
154 };
155
156 static const struct ieee80211_rate mwl_rates_24[] = {
157 @@ -96,30 +96,30 @@ static const struct ieee80211_rate mwl_r
158 };
159
160 static const struct ieee80211_channel mwl_channels_50[] = {
161 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5180, .hw_value = 36, },
162 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5200, .hw_value = 40, },
163 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5220, .hw_value = 44, },
164 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5240, .hw_value = 48, },
165 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5260, .hw_value = 52, },
166 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5280, .hw_value = 56, },
167 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5300, .hw_value = 60, },
168 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5320, .hw_value = 64, },
169 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5500, .hw_value = 100, },
170 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5520, .hw_value = 104, },
171 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5540, .hw_value = 108, },
172 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5560, .hw_value = 112, },
173 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5580, .hw_value = 116, },
174 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5600, .hw_value = 120, },
175 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5620, .hw_value = 124, },
176 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5640, .hw_value = 128, },
177 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5660, .hw_value = 132, },
178 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5680, .hw_value = 136, },
179 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5700, .hw_value = 140, },
180 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5720, .hw_value = 144, },
181 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5745, .hw_value = 149, },
182 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5765, .hw_value = 153, },
183 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5785, .hw_value = 157, },
184 - { .band = IEEE80211_BAND_5GHZ, .center_freq = 5805, .hw_value = 161, },
185 + { .band = NL80211_BAND_5GHZ, .center_freq = 5180, .hw_value = 36, },
186 + { .band = NL80211_BAND_5GHZ, .center_freq = 5200, .hw_value = 40, },
187 + { .band = NL80211_BAND_5GHZ, .center_freq = 5220, .hw_value = 44, },
188 + { .band = NL80211_BAND_5GHZ, .center_freq = 5240, .hw_value = 48, },
189 + { .band = NL80211_BAND_5GHZ, .center_freq = 5260, .hw_value = 52, },
190 + { .band = NL80211_BAND_5GHZ, .center_freq = 5280, .hw_value = 56, },
191 + { .band = NL80211_BAND_5GHZ, .center_freq = 5300, .hw_value = 60, },
192 + { .band = NL80211_BAND_5GHZ, .center_freq = 5320, .hw_value = 64, },
193 + { .band = NL80211_BAND_5GHZ, .center_freq = 5500, .hw_value = 100, },
194 + { .band = NL80211_BAND_5GHZ, .center_freq = 5520, .hw_value = 104, },
195 + { .band = NL80211_BAND_5GHZ, .center_freq = 5540, .hw_value = 108, },
196 + { .band = NL80211_BAND_5GHZ, .center_freq = 5560, .hw_value = 112, },
197 + { .band = NL80211_BAND_5GHZ, .center_freq = 5580, .hw_value = 116, },
198 + { .band = NL80211_BAND_5GHZ, .center_freq = 5600, .hw_value = 120, },
199 + { .band = NL80211_BAND_5GHZ, .center_freq = 5620, .hw_value = 124, },
200 + { .band = NL80211_BAND_5GHZ, .center_freq = 5640, .hw_value = 128, },
201 + { .band = NL80211_BAND_5GHZ, .center_freq = 5660, .hw_value = 132, },
202 + { .band = NL80211_BAND_5GHZ, .center_freq = 5680, .hw_value = 136, },
203 + { .band = NL80211_BAND_5GHZ, .center_freq = 5700, .hw_value = 140, },
204 + { .band = NL80211_BAND_5GHZ, .center_freq = 5720, .hw_value = 144, },
205 + { .band = NL80211_BAND_5GHZ, .center_freq = 5745, .hw_value = 149, },
206 + { .band = NL80211_BAND_5GHZ, .center_freq = 5765, .hw_value = 153, },
207 + { .band = NL80211_BAND_5GHZ, .center_freq = 5785, .hw_value = 157, },
208 + { .band = NL80211_BAND_5GHZ, .center_freq = 5805, .hw_value = 161, },
209 };
210
211 static const struct ieee80211_rate mwl_rates_50[] = {
212 @@ -478,7 +478,7 @@ static void mwl_set_caps(struct mwl_priv
213 BUILD_BUG_ON(sizeof(priv->rates_24) != sizeof(mwl_rates_24));
214 memcpy(priv->rates_24, mwl_rates_24, sizeof(mwl_rates_24));
215
216 - priv->band_24.band = IEEE80211_BAND_2GHZ;
217 + priv->band_24.band = NL80211_BAND_2GHZ;
218 priv->band_24.channels = priv->channels_24;
219 priv->band_24.n_channels = ARRAY_SIZE(mwl_channels_24);
220 priv->band_24.bitrates = priv->rates_24;
221 @@ -487,7 +487,7 @@ static void mwl_set_caps(struct mwl_priv
222 mwl_set_ht_caps(priv, &priv->band_24);
223 mwl_set_vht_caps(priv, &priv->band_24);
224
225 - hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band_24;
226 + hw->wiphy->bands[NL80211_BAND_2GHZ] = &priv->band_24;
227 }
228
229 /* set up band information for 5G */
230 @@ -500,7 +500,7 @@ static void mwl_set_caps(struct mwl_priv
231 BUILD_BUG_ON(sizeof(priv->rates_50) != sizeof(mwl_rates_50));
232 memcpy(priv->rates_50, mwl_rates_50, sizeof(mwl_rates_50));
233
234 - priv->band_50.band = IEEE80211_BAND_5GHZ;
235 + priv->band_50.band = NL80211_BAND_5GHZ;
236 priv->band_50.channels = priv->channels_50;
237 priv->band_50.n_channels = ARRAY_SIZE(mwl_channels_50);
238 priv->band_50.bitrates = priv->rates_50;
239 @@ -509,7 +509,7 @@ static void mwl_set_caps(struct mwl_priv
240 mwl_set_ht_caps(priv, &priv->band_50);
241 mwl_set_vht_caps(priv, &priv->band_50);
242
243 - hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->band_50;
244 + hw->wiphy->bands[NL80211_BAND_5GHZ] = &priv->band_50;
245 }
246 }
247
248 --- a/rx.c
249 +++ b/rx.c
250 @@ -243,7 +243,7 @@ static inline void mwl_rx_prepare_status
251 status->rate_idx = rt;
252
253 if (pdesc->channel > BAND_24_CHANNEL_NUM) {
254 - status->band = IEEE80211_BAND_5GHZ;
255 + status->band = NL80211_BAND_5GHZ;
256 if ((!(status->flag & RX_FLAG_HT)) &&
257 (!(status->flag & RX_FLAG_VHT))) {
258 status->rate_idx -= 5;
259 @@ -251,7 +251,7 @@ static inline void mwl_rx_prepare_status
260 status->rate_idx = BAND_50_RATE_NUM - 1;
261 }
262 } else {
263 - status->band = IEEE80211_BAND_2GHZ;
264 + status->band = NL80211_BAND_2GHZ;
265 if ((!(status->flag & RX_FLAG_HT)) &&
266 (!(status->flag & RX_FLAG_VHT))) {
267 if (status->rate_idx >= BAND_24_RATE_NUM)