mwlwifi: update to version 10.3.9.0-20230311
[openwrt/staging/wigyori.git] / package / kernel / mwlwifi / patches / 005-mac80211_update.patch
1 --- a/core.c
2 +++ b/core.c
3 @@ -706,7 +706,7 @@ static void mwl_chnl_switch_event(struct
4 vif = container_of((void *)mwl_vif, struct ieee80211_vif,
5 drv_priv);
6
7 - if (vif->csa_active)
8 + if (vif->bss_conf.csa_active)
9 ieee80211_csa_finish(vif);
10 }
11 spin_unlock_bh(&priv->vif_lock);
12 --- a/debugfs.c
13 +++ b/debugfs.c
14 @@ -455,9 +455,9 @@ static ssize_t mwl_debugfs_vif_read(stru
15 switch (vif->type) {
16 case NL80211_IFTYPE_AP:
17 len += scnprintf(p + len, size - len, "type: ap\n");
18 - memcpy(ssid, vif->bss_conf.ssid,
19 - vif->bss_conf.ssid_len);
20 - ssid[vif->bss_conf.ssid_len] = 0;
21 + memcpy(ssid, vif->cfg.ssid,
22 + vif->cfg.ssid_len);
23 + ssid[vif->cfg.ssid_len] = 0;
24 len += scnprintf(p + len, size - len,
25 "ssid: %s\n", ssid);
26 len += scnprintf(p + len, size - len,
27 @@ -479,8 +479,8 @@ static ssize_t mwl_debugfs_vif_read(stru
28 "type: unknown\n");
29 break;
30 }
31 - if (vif->chanctx_conf) {
32 - chan_def = &vif->chanctx_conf->def;
33 + if (vif->bss_conf.chanctx_conf) {
34 + chan_def = &vif->bss_conf.chanctx_conf->def;
35 len += scnprintf(p + len, size - len,
36 "channel: %d: width: %d\n",
37 chan_def->chan->hw_value,
38 @@ -564,28 +564,28 @@ static ssize_t mwl_debugfs_sta_read(stru
39 "amsdu cap: 0x%02x\n",
40 sta_info->amsdu_ctrl.cap);
41 }
42 - if (sta->ht_cap.ht_supported) {
43 + if (sta->deflink.ht_cap.ht_supported) {
44 len += scnprintf(p + len, size - len,
45 "ht_cap: 0x%04x, ampdu: %02x, %02x\n",
46 - sta->ht_cap.cap,
47 - sta->ht_cap.ampdu_factor,
48 - sta->ht_cap.ampdu_density);
49 + sta->deflink.ht_cap.cap,
50 + sta->deflink.ht_cap.ampdu_factor,
51 + sta->deflink.ht_cap.ampdu_density);
52 len += scnprintf(p + len, size - len,
53 "rx_mask: 0x%02x, %02x, %02x, %02x\n",
54 - sta->ht_cap.mcs.rx_mask[0],
55 - sta->ht_cap.mcs.rx_mask[1],
56 - sta->ht_cap.mcs.rx_mask[2],
57 - sta->ht_cap.mcs.rx_mask[3]);
58 + sta->deflink.ht_cap.mcs.rx_mask[0],
59 + sta->deflink.ht_cap.mcs.rx_mask[1],
60 + sta->deflink.ht_cap.mcs.rx_mask[2],
61 + sta->deflink.ht_cap.mcs.rx_mask[3]);
62 }
63 - if (sta->vht_cap.vht_supported) {
64 + if (sta->deflink.vht_cap.vht_supported) {
65 len += scnprintf(p + len, size - len,
66 "vht_cap: 0x%08x, mcs: %02x, %02x\n",
67 - sta->vht_cap.cap,
68 - sta->vht_cap.vht_mcs.rx_mcs_map,
69 - sta->vht_cap.vht_mcs.tx_mcs_map);
70 + sta->deflink.vht_cap.cap,
71 + sta->deflink.vht_cap.vht_mcs.rx_mcs_map,
72 + sta->deflink.vht_cap.vht_mcs.tx_mcs_map);
73 }
74 len += scnprintf(p + len, size - len, "rx_bw: %d, rx_nss: %d\n",
75 - sta->bandwidth, sta->rx_nss);
76 + sta->deflink.bandwidth, sta->deflink.rx_nss);
77 len += scnprintf(p + len, size - len,
78 "tdls: %d, tdls_init: %d\n",
79 sta->tdls, sta->tdls_initiator);
80 --- a/hif/fwcmd.c
81 +++ b/hif/fwcmd.c
82 @@ -634,8 +634,9 @@ einval:
83
84 static int mwl_fwcmd_set_ap_beacon(struct mwl_priv *priv,
85 struct mwl_vif *mwl_vif,
86 - struct ieee80211_bss_conf *bss_conf)
87 + struct ieee80211_vif *vif)
88 {
89 + struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
90 struct hostcmd_cmd_ap_beacon *pcmd;
91 struct ds_params *phy_ds_param_set;
92
93 @@ -664,7 +665,7 @@ static int mwl_fwcmd_set_ap_beacon(struc
94 pcmd->cmd_hdr.macid = mwl_vif->macid;
95
96 ether_addr_copy(pcmd->start_cmd.sta_mac_addr, mwl_vif->bssid);
97 - memcpy(pcmd->start_cmd.ssid, bss_conf->ssid, bss_conf->ssid_len);
98 + memcpy(pcmd->start_cmd.ssid, vif->cfg.ssid, vif->cfg.ssid_len);
99 if (priv->chip_type == MWL8997)
100 ether_addr_copy(pcmd->start_cmd.bssid, mwl_vif->bssid);
101 pcmd->start_cmd.bss_type = 1;
102 @@ -2091,7 +2092,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021
103 if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr))
104 goto err;
105
106 - if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, &vif->bss_conf))
107 + if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, vif))
108 goto err;
109
110 if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT)
111 @@ -2153,38 +2154,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee
112 ether_addr_copy(pcmd->mac_addr, sta->addr);
113
114 if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ)
115 - rates = sta->supp_rates[NL80211_BAND_2GHZ];
116 + rates = sta->deflink.supp_rates[NL80211_BAND_2GHZ];
117 else
118 - rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5;
119 + rates = sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 5;
120 pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates);
121
122 - if (sta->ht_cap.ht_supported) {
123 + if (sta->deflink.ht_cap.ht_supported) {
124 int i;
125
126 for (i = 0; i < 4; i++) {
127 - if (i < sta->rx_nss) {
128 + if (i < sta->deflink.rx_nss) {
129 pcmd->peer_info.ht_rates[i] =
130 - sta->ht_cap.mcs.rx_mask[i];
131 + sta->deflink.ht_cap.mcs.rx_mask[i];
132 } else {
133 pcmd->peer_info.ht_rates[i] = 0;
134 }
135 }
136 - pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->ht_cap.cap);
137 + pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->deflink.ht_cap.cap);
138 pcmd->peer_info.mac_ht_param_info =
139 - (sta->ht_cap.ampdu_factor & 3) |
140 - ((sta->ht_cap.ampdu_density & 7) << 2);
141 + (sta->deflink.ht_cap.ampdu_factor & 3) |
142 + ((sta->deflink.ht_cap.ampdu_density & 7) << 2);
143 }
144
145 - if (sta->vht_cap.vht_supported) {
146 + if (sta->deflink.vht_cap.vht_supported) {
147 u32 rx_mcs_map_mask = 0;
148
149 - rx_mcs_map_mask = ((0x0000FFFF) >> (sta->rx_nss * 2))
150 - << (sta->rx_nss * 2);
151 + rx_mcs_map_mask = ((0x0000FFFF) >> (sta->deflink.rx_nss * 2))
152 + << (sta->deflink.rx_nss * 2);
153 pcmd->peer_info.vht_max_rx_mcs =
154 cpu_to_le32((*((u32 *)
155 - &sta->vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask);
156 - pcmd->peer_info.vht_cap = cpu_to_le32(sta->vht_cap.cap);
157 - pcmd->peer_info.vht_rx_channel_width = sta->bandwidth;
158 + &sta->deflink.vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask);
159 + pcmd->peer_info.vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
160 + pcmd->peer_info.vht_rx_channel_width = sta->deflink.bandwidth;
161 }
162
163 pcmd->is_qos_sta = sta->wme;
164 @@ -2240,38 +2241,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct
165 ether_addr_copy(pcmd->mac_addr, sta->addr);
166
167 if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ)
168 - rates = sta->supp_rates[NL80211_BAND_2GHZ];
169 + rates = sta->deflink.supp_rates[NL80211_BAND_2GHZ];
170 else
171 - rates = sta->supp_rates[NL80211_BAND_5GHZ] << 5;
172 + rates = sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 5;
173 pcmd->peer_info.legacy_rate_bitmap = cpu_to_le32(rates);
174
175 - if (sta->ht_cap.ht_supported) {
176 + if (sta->deflink.ht_cap.ht_supported) {
177 int i;
178
179 for (i = 0; i < 4; i++) {
180 - if (i < sta->rx_nss) {
181 + if (i < sta->deflink.rx_nss) {
182 pcmd->peer_info.ht_rates[i] =
183 - sta->ht_cap.mcs.rx_mask[i];
184 + sta->deflink.ht_cap.mcs.rx_mask[i];
185 } else {
186 pcmd->peer_info.ht_rates[i] = 0;
187 }
188 }
189 - pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->ht_cap.cap);
190 + pcmd->peer_info.ht_cap_info = cpu_to_le16(sta->deflink.ht_cap.cap);
191 pcmd->peer_info.mac_ht_param_info =
192 - (sta->ht_cap.ampdu_factor & 3) |
193 - ((sta->ht_cap.ampdu_density & 7) << 2);
194 + (sta->deflink.ht_cap.ampdu_factor & 3) |
195 + ((sta->deflink.ht_cap.ampdu_density & 7) << 2);
196 }
197
198 - if (sta->vht_cap.vht_supported) {
199 + if (sta->deflink.vht_cap.vht_supported) {
200 u32 rx_mcs_map_mask = 0;
201
202 - rx_mcs_map_mask = ((0x0000FFFF) >> (sta->rx_nss * 2))
203 - << (sta->rx_nss * 2);
204 + rx_mcs_map_mask = ((0x0000FFFF) >> (sta->deflink.rx_nss * 2))
205 + << (sta->deflink.rx_nss * 2);
206 pcmd->peer_info.vht_max_rx_mcs =
207 cpu_to_le32((*((u32 *)
208 - &sta->vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask);
209 - pcmd->peer_info.vht_cap = cpu_to_le32(sta->vht_cap.cap);
210 - pcmd->peer_info.vht_rx_channel_width = sta->bandwidth;
211 + &sta->deflink.vht_cap.vht_mcs.rx_mcs_map)) | rx_mcs_map_mask);
212 + pcmd->peer_info.vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
213 + pcmd->peer_info.vht_rx_channel_width = sta->deflink.bandwidth;
214 }
215
216 pcmd->is_qos_sta = sta->wme;
217 @@ -2788,9 +2789,9 @@ int mwl_fwcmd_create_ba(struct ieee80211
218 pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags);
219 pcmd->ba_info.create_params.queue_id = stream->idx;
220 pcmd->ba_info.create_params.param_info =
221 - (stream->sta->ht_cap.ampdu_factor &
222 + (stream->sta->deflink.ht_cap.ampdu_factor &
223 IEEE80211_HT_AMPDU_PARM_FACTOR) |
224 - ((stream->sta->ht_cap.ampdu_density << 2) &
225 + ((stream->sta->deflink.ht_cap.ampdu_density << 2) &
226 IEEE80211_HT_AMPDU_PARM_DENSITY);
227 if (direction == BA_FLAG_DIRECTION_UP) {
228 pcmd->ba_info.create_params.reset_seq_no = 0;
229 @@ -2800,9 +2801,9 @@ int mwl_fwcmd_create_ba(struct ieee80211
230 pcmd->ba_info.create_params.current_seq = cpu_to_le16(0);
231 }
232 if (priv->chip_type == MWL8964 &&
233 - stream->sta->vht_cap.vht_supported) {
234 + stream->sta->deflink.vht_cap.vht_supported) {
235 pcmd->ba_info.create_params.vht_rx_factor =
236 - cpu_to_le32((stream->sta->vht_cap.cap &
237 + cpu_to_le32((stream->sta->deflink.vht_cap.cap &
238 IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK) >>
239 IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT);
240 }
241 --- a/mac80211.c
242 +++ b/mac80211.c
243 @@ -371,15 +371,15 @@ static void mwl_mac80211_bss_info_change
244 }
245 }
246
247 - if ((changed & BSS_CHANGED_ASSOC) && vif->bss_conf.assoc)
248 + if ((changed & BSS_CHANGED_ASSOC) && vif->cfg.assoc)
249 mwl_fwcmd_set_aid(hw, vif, (u8 *)vif->bss_conf.bssid,
250 - vif->bss_conf.aid);
251 + vif->cfg.aid);
252 }
253
254 static void mwl_mac80211_bss_info_changed_ap(struct ieee80211_hw *hw,
255 struct ieee80211_vif *vif,
256 struct ieee80211_bss_conf *info,
257 - u32 changed)
258 + u64 changed)
259 {
260 struct mwl_priv *priv = hw->priv;
261 struct mwl_vif *mwl_vif;
262 @@ -429,8 +429,8 @@ static void mwl_mac80211_bss_info_change
263 if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) {
264 struct sk_buff *skb;
265
266 - if ((info->ssid[0] != '\0') &&
267 - (info->ssid_len != 0) &&
268 + if ((vif->cfg.ssid[0] != '\0') &&
269 + (vif->cfg.ssid_len != 0) &&
270 (!info->hidden_ssid)) {
271 if (mwl_vif->broadcast_ssid != true) {
272 mwl_fwcmd_broadcast_ssid_enable(hw, vif, true);
273 @@ -444,7 +444,7 @@ static void mwl_mac80211_bss_info_change
274 }
275
276 if (!mwl_vif->set_beacon) {
277 - skb = ieee80211_beacon_get(hw, vif);
278 + skb = ieee80211_beacon_get(hw, vif, 0);
279
280 if (skb) {
281 mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len);
282 @@ -461,7 +461,7 @@ static void mwl_mac80211_bss_info_change
283 static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw,
284 struct ieee80211_vif *vif,
285 struct ieee80211_bss_conf *info,
286 - u32 changed)
287 + u64 changed)
288 {
289 switch (vif->type) {
290 case NL80211_IFTYPE_AP:
291 @@ -584,10 +584,10 @@ static int mwl_mac80211_sta_add(struct i
292 if (vif->type == NL80211_IFTYPE_MESH_POINT)
293 sta_info->is_mesh_node = true;
294
295 - if (sta->ht_cap.ht_supported) {
296 + if (sta->deflink.ht_cap.ht_supported) {
297 sta_info->is_ampdu_allowed = true;
298 sta_info->is_amsdu_allowed = false;
299 - if (sta->ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU)
300 + if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_MAX_AMSDU)
301 sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K;
302 else
303 sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_4K;
304 @@ -669,7 +669,7 @@ static int mwl_mac80211_sta_remove(struc
305
306 static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw,
307 struct ieee80211_vif *vif,
308 - u16 queue,
309 + unsigned int link_id, u16 queue,
310 const struct ieee80211_tx_queue_params *params)
311 {
312 struct mwl_priv *priv = hw->priv;
313 @@ -928,4 +928,5 @@ const struct ieee80211_ops mwl_mac80211_
314 .pre_channel_switch = mwl_mac80211_chnl_switch,
315 .sw_scan_start = mwl_mac80211_sw_scan_start,
316 .sw_scan_complete = mwl_mac80211_sw_scan_complete,
317 + .wake_tx_queue = ieee80211_handle_wake_tx_queue,
318 };
319 --- a/utils.c
320 +++ b/utils.c
321 @@ -173,9 +173,9 @@ u32 utils_get_init_tx_rate(struct mwl_pr
322 u32 tx_rate;
323 u16 format, nss, bw, rate_mcs;
324
325 - if (sta->vht_cap.vht_supported)
326 + if (sta->deflink.vht_cap.vht_supported)
327 format = TX_RATE_FORMAT_11AC;
328 - else if (sta->ht_cap.ht_supported)
329 + else if (sta->deflink.ht_cap.ht_supported)
330 format = TX_RATE_FORMAT_11N;
331 else
332 format = TX_RATE_FORMAT_LEGACY;
333 @@ -192,11 +192,11 @@ u32 utils_get_init_tx_rate(struct mwl_pr
334 nss = 3;
335 break;
336 default:
337 - nss = sta->rx_nss;
338 + nss = sta->deflink.rx_nss;
339 break;
340 }
341 - if (nss > sta->rx_nss)
342 - nss = sta->rx_nss;
343 + if (nss > sta->deflink.rx_nss)
344 + nss = sta->deflink.rx_nss;
345
346 switch (conf->chandef.width) {
347 case NL80211_CHAN_WIDTH_20_NOHT:
348 @@ -213,11 +213,11 @@ u32 utils_get_init_tx_rate(struct mwl_pr
349 bw = TX_RATE_BANDWIDTH_160;
350 break;
351 default:
352 - bw = sta->bandwidth;
353 + bw = sta->deflink.bandwidth;
354 break;
355 }
356 - if (bw > sta->bandwidth)
357 - bw = sta->bandwidth;
358 + if (bw > sta->deflink.bandwidth)
359 + bw = sta->deflink.bandwidth;
360
361 switch (format) {
362 case TX_RATE_FORMAT_LEGACY:
363 --- a/hif/pcie/tx.c
364 +++ b/hif/pcie/tx.c
365 @@ -153,7 +153,7 @@ static int pcie_txbd_ring_create(struct
366 wiphy_info(priv->hw->wiphy,
367 "TX ring: - base: %p, pbase: 0x%x, len: %d\n",
368 pcie_priv->txbd_ring_vbase,
369 - pcie_priv->txbd_ring_pbase,
370 + (u32)pcie_priv->txbd_ring_pbase,
371 pcie_priv->txbd_ring_size);
372
373 for (num = 0; num < PCIE_MAX_TXRX_BD; num++) {
374 @@ -1091,7 +1091,7 @@ void pcie_tx_xmit(struct ieee80211_hw *h
375 index = SYSADPT_TX_WMM_QUEUES - index - 1;
376 txpriority = index;
377
378 - if (sta && sta->ht_cap.ht_supported && !eapol_frame &&
379 + if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame &&
380 ieee80211_is_data_qos(wh->frame_control)) {
381 tid = qos & 0xf;
382 pcie_tx_count_packet(sta, tid);
383 --- a/hif/pcie/tx_ndp.c
384 +++ b/hif/pcie/tx_ndp.c
385 @@ -602,7 +602,7 @@ void pcie_tx_xmit_ndp(struct ieee80211_h
386 pcie_tx_encapsulate_frame(priv, skb, k_conf, NULL);
387 } else {
388 tid = qos & 0x7;
389 - if (sta && sta->ht_cap.ht_supported && !eapol_frame &&
390 + if (sta && sta->deflink.ht_cap.ht_supported && !eapol_frame &&
391 qos != 0xFFFF) {
392 pcie_tx_count_packet(sta, tid);
393 spin_lock_bh(&priv->stream_lock);