blob: 652fa5023e390aeb7e6e74cbcebdbb8d3d3aedf7 [file] [log] [blame]
developer4f0d84b2023-03-03 14:21:44 +08001From 1a40927274d316173f1aa460083eea54e2804a0a Mon Sep 17 00:00:00 2001
developereb6a0182022-12-12 18:53:32 +08002From: Shayne Chen <shayne.chen@mediatek.com>
developer61526b72022-12-30 11:15:01 +08003Date: Fri, 30 Dec 2022 11:12:07 +0800
developerfd8e1152023-02-14 11:29:23 +08004Subject: [PATCH 4004/4005] mt76: revert for backports-5.15 wireless stack
developereb6a0182022-12-12 18:53:32 +08005
developerfe7be7f2022-12-13 21:40:24 +08006---
developerfe7be7f2022-12-13 21:40:24 +08007 dma.c | 2 +-
8 mac80211.c | 4 +-
developerf0de14b2022-12-14 23:07:34 +08009 mt7615/dma.c | 4 +-
developerfe7be7f2022-12-13 21:40:24 +080010 mt7615/main.c | 6 +-
11 mt7615/mcu.c | 8 +--
12 mt76_connac_mcu.c | 108 +++++++++++++++---------------
13 mt76x02_mac.c | 6 +-
14 mt7915/debugfs.c | 4 +-
15 mt7915/dma.c | 4 +-
16 mt7915/init.c | 3 +-
17 mt7915/mac.c | 2 +-
18 mt7915/main.c | 10 +--
19 mt7915/mcu.c | 166 +++++++++++++++++++++++-----------------------
20 mt7915/testmode.c | 8 +--
21 tx.c | 11 +--
developer61526b72022-12-30 11:15:01 +080022 15 files changed, 168 insertions(+), 178 deletions(-)
developereb6a0182022-12-12 18:53:32 +080023
developereb6a0182022-12-12 18:53:32 +080024diff --git a/dma.c b/dma.c
developer4f0d84b2023-03-03 14:21:44 +080025index 1fc4bd2d..e7d174b8 100644
developereb6a0182022-12-12 18:53:32 +080026--- a/dma.c
27+++ b/dma.c
developer4f0d84b2023-03-03 14:21:44 +080028@@ -986,7 +986,7 @@ mt76_dma_init(struct mt76_dev *dev,
developerc04f5402023-02-03 09:22:26 +080029 init_completion(&dev->mmio.wed_reset_complete);
developereb6a0182022-12-12 18:53:32 +080030
31 mt76_for_each_q_rx(dev, i) {
32- netif_napi_add(&dev->napi_dev, &dev->napi[i], poll);
33+ netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64);
34 mt76_dma_rx_fill(dev, &dev->q_rx[i]);
35 napi_enable(&dev->napi[i]);
36 }
37diff --git a/mac80211.c b/mac80211.c
developer4f0d84b2023-03-03 14:21:44 +080038index 4dc7627e..4c88710f 100644
developereb6a0182022-12-12 18:53:32 +080039--- a/mac80211.c
40+++ b/mac80211.c
developer4f0d84b2023-03-03 14:21:44 +080041@@ -1517,7 +1517,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power);
developereb6a0182022-12-12 18:53:32 +080042 static void
43 __mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
44 {
45- if (vif->bss_conf.csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
46+ if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
47 ieee80211_csa_finish(vif);
48 }
49
developer4f0d84b2023-03-03 14:21:44 +080050@@ -1539,7 +1539,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif)
developereb6a0182022-12-12 18:53:32 +080051 {
52 struct mt76_dev *dev = priv;
53
54- if (!vif->bss_conf.csa_active)
55+ if (!vif->csa_active)
56 return;
57
58 dev->csa_complete |= ieee80211_beacon_cntdwn_is_complete(vif);
developerf0de14b2022-12-14 23:07:34 +080059diff --git a/mt7615/dma.c b/mt7615/dma.c
developer61526b72022-12-30 11:15:01 +080060index f1914431..ec729dbe 100644
developerf0de14b2022-12-14 23:07:34 +080061--- a/mt7615/dma.c
62+++ b/mt7615/dma.c
63@@ -281,8 +281,8 @@ int mt7615_dma_init(struct mt7615_dev *dev)
64 if (ret < 0)
65 return ret;
66
67- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
68- mt7615_poll_tx);
69+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
70+ mt7615_poll_tx, NAPI_POLL_WEIGHT);
71 napi_enable(&dev->mt76.tx_napi);
72
73 mt76_poll(dev, MT_WPDMA_GLO_CFG,
developereb6a0182022-12-12 18:53:32 +080074diff --git a/mt7615/main.c b/mt7615/main.c
developer61526b72022-12-30 11:15:01 +080075index ab4c1b44..8fb5b256 100644
developereb6a0182022-12-12 18:53:32 +080076--- a/mt7615/main.c
77+++ b/mt7615/main.c
78@@ -474,7 +474,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
79
80 static int
81 mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
82- unsigned int link_id, u16 queue,
83+ u16 queue,
84 const struct ieee80211_tx_queue_params *params)
85 {
86 struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
87@@ -556,7 +556,7 @@ static void mt7615_configure_filter(struct ieee80211_hw *hw,
88 static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
89 struct ieee80211_vif *vif,
90 struct ieee80211_bss_conf *info,
91- u64 changed)
92+ u32 changed)
93 {
94 struct mt7615_dev *dev = mt7615_hw_dev(hw);
95 struct mt7615_phy *phy = mt7615_hw_phy(hw);
96@@ -599,7 +599,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
97 }
98
99 if (changed & BSS_CHANGED_ASSOC)
100- mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc);
101+ mt7615_mac_set_beacon_filter(phy, vif, info->assoc);
102
103 mt7615_mutex_release(dev);
104 }
105diff --git a/mt7615/mcu.c b/mt7615/mcu.c
developerc04f5402023-02-03 09:22:26 +0800106index 4593b2e1..39e81d26 100644
developereb6a0182022-12-12 18:53:32 +0800107--- a/mt7615/mcu.c
108+++ b/mt7615/mcu.c
developerfe7be7f2022-12-13 21:40:24 +0800109@@ -353,7 +353,7 @@ out:
developereb6a0182022-12-12 18:53:32 +0800110 static void
111 mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
112 {
113- if (vif->bss_conf.csa_active)
114+ if (vif->csa_active)
115 ieee80211_csa_finish(vif);
116 }
117
developerfe7be7f2022-12-13 21:40:24 +0800118@@ -699,7 +699,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800119 if (!enable)
120 goto out;
121
122- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
123+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
124 if (!skb)
125 return -EINVAL;
126
developerfe7be7f2022-12-13 21:40:24 +0800127@@ -1074,7 +1074,7 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800128 if (!enable)
129 goto out;
130
131- skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs, 0);
132+ skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs);
133 if (!skb)
134 return -EINVAL;
135
developerc04f5402023-02-03 09:22:26 +0800136@@ -2525,7 +2525,7 @@ int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800137 u8 pad;
138 } req = {
139 .bss_idx = mvif->mt76.idx,
140- .aid = cpu_to_le16(vif->cfg.aid),
141+ .aid = cpu_to_le16(vif->bss_conf.aid),
142 .dtim_period = vif->bss_conf.dtim_period,
143 .bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int),
144 };
145diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
developerc04f5402023-02-03 09:22:26 +0800146index 1baa4a03..d7d85291 100644
developereb6a0182022-12-12 18:53:32 +0800147--- a/mt76_connac_mcu.c
148+++ b/mt76_connac_mcu.c
developerfe7be7f2022-12-13 21:40:24 +0800149@@ -197,7 +197,7 @@ int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif)
developereb6a0182022-12-12 18:53:32 +0800150 */
151 } req = {
152 .bss_idx = mvif->idx,
153- .ps_state = vif->cfg.ps ? 2 : 0,
154+ .ps_state = vif->bss_conf.ps ? 2 : 0,
155 };
156
157 if (vif->type != NL80211_IFTYPE_STATION)
developerfe7be7f2022-12-13 21:40:24 +0800158@@ -409,7 +409,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800159 else
160 conn_type = CONNECTION_INFRA_AP;
161 basic->conn_type = cpu_to_le32(conn_type);
162- basic->aid = cpu_to_le16(vif->cfg.aid);
163+ basic->aid = cpu_to_le16(vif->bss_conf.aid);
164 break;
165 case NL80211_IFTYPE_ADHOC:
166 basic->conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC);
developerfe7be7f2022-12-13 21:40:24 +0800167@@ -553,7 +553,7 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800168
169 if (sta) {
170 if (vif->type == NL80211_IFTYPE_STATION)
171- generic->partial_aid = cpu_to_le16(vif->cfg.aid);
172+ generic->partial_aid = cpu_to_le16(vif->bss_conf.aid);
173 else
174 generic->partial_aid = cpu_to_le16(sta->aid);
175 memcpy(generic->peer_addr, sta->addr, ETH_ALEN);
developerfe7be7f2022-12-13 21:40:24 +0800176@@ -602,14 +602,14 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800177 vif->type != NL80211_IFTYPE_STATION)
178 return;
179
180- if (!sta->deflink.agg.max_amsdu_len)
181+ if (!sta->max_amsdu_len)
182 return;
183
184 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
185 amsdu = (struct sta_rec_amsdu *)tlv;
186 amsdu->max_amsdu_num = 8;
187 amsdu->amsdu_en = true;
188- amsdu->max_mpdu_size = sta->deflink.agg.max_amsdu_len >=
189+ amsdu->max_mpdu_size = sta->max_amsdu_len >=
190 IEEE80211_MAX_MPDU_LEN_VHT_7991;
191
192 wcid->amsdu = true;
developerfe7be7f2022-12-13 21:40:24 +0800193@@ -620,7 +620,7 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800194 static void
195 mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
196 {
197- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
198+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
199 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
200 struct sta_rec_he *he;
201 struct tlv *tlv;
developerfe7be7f2022-12-13 21:40:24 +0800202@@ -708,7 +708,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800203
204 he->he_cap = cpu_to_le32(cap);
205
206- switch (sta->deflink.bandwidth) {
207+ switch (sta->bandwidth) {
208 case IEEE80211_STA_RX_BW_160:
209 if (elem->phy_cap_info[0] &
210 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developerfe7be7f2022-12-13 21:40:24 +0800211@@ -753,7 +753,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800212 static void
213 mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
214 {
215- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
216+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
217 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
218 struct sta_rec_he_v2 *he;
219 struct tlv *tlv;
developerfe7be7f2022-12-13 21:40:24 +0800220@@ -764,7 +764,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800221 memcpy(he->he_phy_cap, elem->phy_cap_info, sizeof(he->he_phy_cap));
222 memcpy(he->he_mac_cap, elem->mac_cap_info, sizeof(he->he_mac_cap));
223
224- switch (sta->deflink.bandwidth) {
225+ switch (sta->bandwidth) {
226 case IEEE80211_STA_RX_BW_160:
227 if (elem->phy_cap_info[0] &
228 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developerfe7be7f2022-12-13 21:40:24 +0800229@@ -780,7 +780,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800230 break;
231 }
232
233- he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US;
234+ he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
235 }
236
237 static u8
developerfe7be7f2022-12-13 21:40:24 +0800238@@ -793,9 +793,9 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800239 u8 mode = 0;
240
241 if (sta) {
242- ht_cap = &sta->deflink.ht_cap;
243- vht_cap = &sta->deflink.vht_cap;
244- he_cap = &sta->deflink.he_cap;
245+ ht_cap = &sta->ht_cap;
246+ vht_cap = &sta->vht_cap;
247+ he_cap = &sta->he_cap;
248 } else {
249 struct ieee80211_supported_band *sband;
250
developerfe7be7f2022-12-13 21:40:24 +0800251@@ -844,25 +844,25 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800252 u16 supp_rates;
253
254 /* starec ht */
255- if (sta->deflink.ht_cap.ht_supported) {
256+ if (sta->ht_cap.ht_supported) {
257 struct sta_rec_ht *ht;
258
259 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
260 ht = (struct sta_rec_ht *)tlv;
261- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
262+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
263 }
264
265 /* starec vht */
266- if (sta->deflink.vht_cap.vht_supported) {
267+ if (sta->vht_cap.vht_supported) {
268 struct sta_rec_vht *vht;
269 int len;
270
271 len = is_mt7921(dev) ? sizeof(*vht) : sizeof(*vht) - 4;
272 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, len);
273 vht = (struct sta_rec_vht *)tlv;
274- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
275- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
276- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
277+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
278+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
279+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
280 }
281
282 /* starec uapsd */
developerfe7be7f2022-12-13 21:40:24 +0800283@@ -871,11 +871,11 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800284 if (!is_mt7921(dev))
285 return;
286
287- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)
288+ if (sta->ht_cap.ht_supported || sta->he_cap.has_he)
289 mt76_connac_mcu_sta_amsdu_tlv(skb, sta, vif);
290
291 /* starec he */
292- if (sta->deflink.he_cap.has_he) {
293+ if (sta->he_cap.has_he) {
294 mt76_connac_mcu_sta_he_tlv(skb, sta);
295 mt76_connac_mcu_sta_he_tlv_v2(skb, sta);
296 if (band == NL80211_BAND_6GHZ &&
developerfe7be7f2022-12-13 21:40:24 +0800297@@ -885,7 +885,7 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800298 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE_6G,
299 sizeof(*he_6g_capa));
300 he_6g_capa = (struct sta_rec_he_6g_capa *)tlv;
301- he_6g_capa->capa = sta->deflink.he_6ghz_capa.capa;
302+ he_6g_capa->capa = sta->he_6ghz_capa.capa;
303 }
304 }
305
developerfe7be7f2022-12-13 21:40:24 +0800306@@ -895,14 +895,14 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800307 phy->basic_rate = cpu_to_le16((u16)vif->bss_conf.basic_rates);
308 phy->rcpi = rcpi;
309 phy->ampdu = FIELD_PREP(IEEE80211_HT_AMPDU_PARM_FACTOR,
310- sta->deflink.ht_cap.ampdu_factor) |
311+ sta->ht_cap.ampdu_factor) |
312 FIELD_PREP(IEEE80211_HT_AMPDU_PARM_DENSITY,
313- sta->deflink.ht_cap.ampdu_density);
314+ sta->ht_cap.ampdu_density);
315
316 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra_info));
317 ra_info = (struct sta_rec_ra_info *)tlv;
318
319- supp_rates = sta->deflink.supp_rates[band];
320+ supp_rates = sta->supp_rates[band];
321 if (band == NL80211_BAND_2GHZ)
322 supp_rates = FIELD_PREP(RA_LEGACY_OFDM, supp_rates >> 4) |
323 FIELD_PREP(RA_LEGACY_CCK, supp_rates & 0xf);
developerfe7be7f2022-12-13 21:40:24 +0800324@@ -911,18 +911,18 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800325
326 ra_info->legacy = cpu_to_le16(supp_rates);
327
328- if (sta->deflink.ht_cap.ht_supported)
329+ if (sta->ht_cap.ht_supported)
330 memcpy(ra_info->rx_mcs_bitmask,
331- sta->deflink.ht_cap.mcs.rx_mask,
332+ sta->ht_cap.mcs.rx_mask,
333 HT_MCS_MASK_NUM);
334
335 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_STATE, sizeof(*state));
336 state = (struct sta_rec_state *)tlv;
337 state->state = sta_state;
338
339- if (sta->deflink.vht_cap.vht_supported) {
340- state->vht_opmode = sta->deflink.bandwidth;
341- state->vht_opmode |= (sta->deflink.rx_nss - 1) <<
342+ if (sta->vht_cap.vht_supported) {
343+ state->vht_opmode = sta->bandwidth;
344+ state->vht_opmode |= (sta->rx_nss - 1) <<
345 IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
346 }
347 }
developerfe7be7f2022-12-13 21:40:24 +0800348@@ -938,7 +938,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800349 tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_SMPS, sizeof(*smps),
350 wtbl_tlv, sta_wtbl);
351 smps = (struct wtbl_smps *)tlv;
352- smps->smps = (sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC);
353+ smps->smps = (sta->smps_mode == IEEE80211_SMPS_DYNAMIC);
354 }
355 EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_smps_tlv);
356
developerfe7be7f2022-12-13 21:40:24 +0800357@@ -950,27 +950,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800358 struct tlv *tlv;
359 u32 flags = 0;
360
361- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_6ghz_capa.capa) {
362+ if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) {
363 tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht),
364 wtbl_tlv, sta_wtbl);
365 ht = (struct wtbl_ht *)tlv;
366 ht->ldpc = ht_ldpc &&
367- !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
368+ !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
369
370- if (sta->deflink.ht_cap.ht_supported) {
371- ht->af = sta->deflink.ht_cap.ampdu_factor;
372- ht->mm = sta->deflink.ht_cap.ampdu_density;
373+ if (sta->ht_cap.ht_supported) {
374+ ht->af = sta->ht_cap.ampdu_factor;
375+ ht->mm = sta->ht_cap.ampdu_density;
376 } else {
377- ht->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
378+ ht->af = le16_get_bits(sta->he_6ghz_capa.capa,
379 IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
380- ht->mm = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
381+ ht->mm = le16_get_bits(sta->he_6ghz_capa.capa,
382 IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START);
383 }
384
385 ht->ht = true;
386 }
387
388- if (sta->deflink.vht_cap.vht_supported || sta->deflink.he_6ghz_capa.capa) {
389+ if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) {
390 struct wtbl_vht *vht;
391 u8 af;
392
developerfe7be7f2022-12-13 21:40:24 +0800393@@ -979,18 +979,18 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800394 sta_wtbl);
395 vht = (struct wtbl_vht *)tlv;
396 vht->ldpc = vht_ldpc &&
397- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
398+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
399 vht->vht = true;
400
401 af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
402- sta->deflink.vht_cap.cap);
403+ sta->vht_cap.cap);
404 if (ht)
405 ht->af = max(ht->af, af);
406 }
407
408 mt76_connac_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_tlv);
409
410- if (is_connac_v1(dev) && sta->deflink.ht_cap.ht_supported) {
411+ if (is_connac_v1(dev) && sta->ht_cap.ht_supported) {
412 /* sgi */
413 u32 msk = MT_WTBL_W5_SHORT_GI_20 | MT_WTBL_W5_SHORT_GI_40 |
414 MT_WTBL_W5_SHORT_GI_80 | MT_WTBL_W5_SHORT_GI_160;
developerfe7be7f2022-12-13 21:40:24 +0800415@@ -1000,15 +1000,15 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800416 sizeof(*raw), wtbl_tlv,
417 sta_wtbl);
418
419- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
420+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
421 flags |= MT_WTBL_W5_SHORT_GI_20;
422- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
423+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
424 flags |= MT_WTBL_W5_SHORT_GI_40;
425
426- if (sta->deflink.vht_cap.vht_supported) {
427- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
428+ if (sta->vht_cap.vht_supported) {
429+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
430 flags |= MT_WTBL_W5_SHORT_GI_80;
431- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
432+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
433 flags |= MT_WTBL_W5_SHORT_GI_160;
434 }
435 raw = (struct wtbl_raw *)tlv;
developerfe7be7f2022-12-13 21:40:24 +0800436@@ -1294,9 +1294,9 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800437 return 0x38;
438
439 if (sta) {
440- ht_cap = &sta->deflink.ht_cap;
441- vht_cap = &sta->deflink.vht_cap;
442- he_cap = &sta->deflink.he_cap;
443+ ht_cap = &sta->ht_cap;
444+ vht_cap = &sta->vht_cap;
445+ he_cap = &sta->he_cap;
446 } else {
447 struct ieee80211_supported_band *sband;
448
developerc04f5402023-02-03 09:22:26 +0800449@@ -1662,7 +1662,6 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800450 for (i = 0; i < sreq->n_ssids; i++) {
451 if (!sreq->ssids[i].ssid_len)
452 continue;
453-
454 req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len);
455 memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid,
456 sreq->ssids[i].ssid_len);
developerc04f5402023-02-03 09:22:26 +0800457@@ -1795,7 +1794,6 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy,
developereb6a0182022-12-12 18:53:32 +0800458 memcpy(req->ssids[i].ssid, ssid->ssid, ssid->ssid_len);
459 req->ssids[i].ssid_len = cpu_to_le32(ssid->ssid_len);
460 }
461-
462 req->match_num = sreq->n_match_sets;
463 for (i = 0; i < req->match_num; i++) {
464 match = &sreq->match_sets[i];
developerc04f5402023-02-03 09:22:26 +0800465@@ -2282,10 +2280,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800466 struct mt76_vif *vif,
467 struct ieee80211_bss_conf *info)
468 {
469- struct ieee80211_vif *mvif = container_of(info, struct ieee80211_vif,
470- bss_conf);
471 struct sk_buff *skb;
472- int i, len = min_t(int, mvif->cfg.arp_addr_cnt,
473+ int i, len = min_t(int, info->arp_addr_cnt,
474 IEEE80211_BSS_ARP_ADDR_LIST_LEN);
475 struct {
476 struct {
developerc04f5402023-02-03 09:22:26 +0800477@@ -2313,7 +2309,7 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800478
479 skb_put_data(skb, &req_hdr, sizeof(req_hdr));
480 for (i = 0; i < len; i++)
481- skb_put_data(skb, &mvif->cfg.arp_addr_list[i], sizeof(__be32));
482+ skb_put_data(skb, &info->arp_addr_list[i], sizeof(__be32));
483
484 return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true);
485 }
486diff --git a/mt76x02_mac.c b/mt76x02_mac.c
developer61526b72022-12-30 11:15:01 +0800487index d3f74473..87ea3db1 100644
developereb6a0182022-12-12 18:53:32 +0800488--- a/mt76x02_mac.c
489+++ b/mt76x02_mac.c
490@@ -404,7 +404,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
491 txwi->rate |= cpu_to_le16(MT_RXWI_RATE_LDPC);
492 if ((info->flags & IEEE80211_TX_CTL_STBC) && nss == 1)
493 txwi->rate |= cpu_to_le16(MT_RXWI_RATE_STBC);
494- if (nss > 1 && sta && sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC)
495+ if (nss > 1 && sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC)
496 txwi_flags |= MT_TXWI_FLAGS_MMPS;
497 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
498 txwi->ack_ctl |= MT_TXWI_ACK_CTL_REQ;
499@@ -412,9 +412,9 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
500 txwi->ack_ctl |= MT_TXWI_ACK_CTL_NSEQ;
501 if ((info->flags & IEEE80211_TX_CTL_AMPDU) && sta) {
502 u8 ba_size = IEEE80211_MIN_AMPDU_BUF;
503- u8 ampdu_density = sta->deflink.ht_cap.ampdu_density;
504+ u8 ampdu_density = sta->ht_cap.ampdu_density;
505
506- ba_size <<= sta->deflink.ht_cap.ampdu_factor;
507+ ba_size <<= sta->ht_cap.ampdu_factor;
508 ba_size = min_t(int, 63, ba_size - 1);
509 if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
510 ba_size = 0;
511diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
developer61526b72022-12-30 11:15:01 +0800512index b178036c..cecc3ef5 100644
developereb6a0182022-12-12 18:53:32 +0800513--- a/mt7915/debugfs.c
514+++ b/mt7915/debugfs.c
developerfe7be7f2022-12-13 21:40:24 +0800515@@ -1905,8 +1905,8 @@ static ssize_t mt7915_sta_fixed_rate_set(struct file *file,
developereb6a0182022-12-12 18:53:32 +0800516
517 phy.ldpc = (phy.bw || phy.ldpc) * GENMASK(2, 0);
518 for (i = 0; i <= phy.bw; i++) {
519- phy.sgi |= gi << (i << sta->deflink.he_cap.has_he);
520- phy.he_ltf |= he_ltf << (i << sta->deflink.he_cap.has_he);
521+ phy.sgi |= gi << (i << sta->he_cap.has_he);
522+ phy.he_ltf |= he_ltf << (i << sta->he_cap.has_he);
523 }
524 field = RATE_PARAM_FIXED;
525
526diff --git a/mt7915/dma.c b/mt7915/dma.c
developer4f0d84b2023-03-03 14:21:44 +0800527index 6d9b2d15..08322453 100644
developereb6a0182022-12-12 18:53:32 +0800528--- a/mt7915/dma.c
529+++ b/mt7915/dma.c
developer4f0d84b2023-03-03 14:21:44 +0800530@@ -554,8 +554,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
developereb6a0182022-12-12 18:53:32 +0800531 if (ret < 0)
532 return ret;
533
534- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
535- mt7915_poll_tx);
536+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
537+ mt7915_poll_tx, NAPI_POLL_WEIGHT);
538 napi_enable(&dev->mt76.tx_napi);
539
540 mt7915_dma_enable(dev);
541diff --git a/mt7915/init.c b/mt7915/init.c
developer4f0d84b2023-03-03 14:21:44 +0800542index 70563c9d..0b852286 100644
developereb6a0182022-12-12 18:53:32 +0800543--- a/mt7915/init.c
544+++ b/mt7915/init.c
developer4f0d84b2023-03-03 14:21:44 +0800545@@ -1160,8 +1160,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
developereb6a0182022-12-12 18:53:32 +0800546 mt7915_gen_ppe_thresh(he_cap->ppe_thres, nss);
547 } else {
548 he_cap_elem->phy_cap_info[9] |=
549- u8_encode_bits(IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US,
550- IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK);
551+ IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
552 }
553
554 if (band == NL80211_BAND_6GHZ) {
555diff --git a/mt7915/mac.c b/mt7915/mac.c
developer4f0d84b2023-03-03 14:21:44 +0800556index 180c1ae3..583b71b1 100644
developereb6a0182022-12-12 18:53:32 +0800557--- a/mt7915/mac.c
558+++ b/mt7915/mac.c
developerc04f5402023-02-03 09:22:26 +0800559@@ -902,7 +902,7 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
developereb6a0182022-12-12 18:53:32 +0800560 u16 fc, tid;
561 u32 val;
562
563- if (!sta || !(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
564+ if (!sta || !(sta->ht_cap.ht_supported || sta->he_cap.has_he))
565 return;
566
567 tid = le32_get_bits(txwi[1], MT_TXD1_TID);
568diff --git a/mt7915/main.c b/mt7915/main.c
developerfd8e1152023-02-14 11:29:23 +0800569index 21caddbe..fd62a659 100644
developereb6a0182022-12-12 18:53:32 +0800570--- a/mt7915/main.c
571+++ b/mt7915/main.c
developer1346ce52022-12-15 21:36:14 +0800572@@ -523,7 +523,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
developereb6a0182022-12-12 18:53:32 +0800573
574 static int
575 mt7915_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
576- unsigned int link_id, u16 queue,
577+ u16 queue,
578 const struct ieee80211_tx_queue_params *params)
579 {
580 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
developer1346ce52022-12-15 21:36:14 +0800581@@ -618,7 +618,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw,
developereb6a0182022-12-12 18:53:32 +0800582 static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
583 struct ieee80211_vif *vif,
584 struct ieee80211_bss_conf *info,
585- u64 changed)
586+ u32 changed)
587 {
588 struct mt7915_phy *phy = mt7915_hw_phy(hw);
589 struct mt7915_dev *dev = mt7915_hw_dev(hw);
developer1346ce52022-12-15 21:36:14 +0800590@@ -638,7 +638,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
developereb6a0182022-12-12 18:53:32 +0800591 }
592
593 if (changed & BSS_CHANGED_ASSOC)
594- mt7915_mcu_add_bss_info(phy, vif, vif->cfg.assoc);
595+ mt7915_mcu_add_bss_info(phy, vif, info->assoc);
596
597 if (changed & BSS_CHANGED_ERP_CTS_PROT)
598 mt7915_mac_enable_rtscts(dev, vif, info->use_cts_prot);
developerfd8e1152023-02-14 11:29:23 +0800599@@ -1225,10 +1225,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw,
developereb6a0182022-12-12 18:53:32 +0800600 {
601 struct mt7915_phy *phy = mt7915_hw_phy(hw);
602 struct mt7915_dev *dev = mt7915_hw_dev(hw);
603- s16 txpower = sta->deflink.txpwr.power;
604+ s16 txpower = sta->txpwr.power;
605 int ret;
606
607- if (sta->deflink.txpwr.type == NL80211_TX_POWER_AUTOMATIC)
608+ if (sta->txpwr.type == NL80211_TX_POWER_AUTOMATIC)
609 txpower = 0;
610
611 mutex_lock(&dev->mt76.mutex);
612diff --git a/mt7915/mcu.c b/mt7915/mcu.c
developer4f0d84b2023-03-03 14:21:44 +0800613index 37291865..4f1bd1cd 100644
developereb6a0182022-12-12 18:53:32 +0800614--- a/mt7915/mcu.c
615+++ b/mt7915/mcu.c
developerfe7be7f2022-12-13 21:40:24 +0800616@@ -64,7 +64,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
developereb6a0182022-12-12 18:53:32 +0800617 struct mt7915_dev *dev = msta->vif->phy->dev;
618 enum nl80211_band band = msta->vif->phy->mt76->chandef.chan->band;
619 const u16 *mask = msta->vif->bitrate_mask.control[band].he_mcs;
620- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
621+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
622
623 for (nss = 0; nss < max_nss; nss++) {
624 int mcs;
developerfe7be7f2022-12-13 21:40:24 +0800625@@ -104,7 +104,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
developereb6a0182022-12-12 18:53:32 +0800626
627 /* only support 2ss on 160MHz for mt7915 */
628 if (is_mt7915(&dev->mt76) && nss > 1 &&
629- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
630+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
631 break;
632 }
633
developerfe7be7f2022-12-13 21:40:24 +0800634@@ -117,8 +117,8 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
developereb6a0182022-12-12 18:53:32 +0800635 {
636 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
637 struct mt7915_dev *dev = msta->vif->phy->dev;
638- u16 mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map);
639- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
640+ u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
641+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
642 u16 mcs;
643
644 for (nss = 0; nss < max_nss; nss++, mcs_map >>= 2) {
developerfe7be7f2022-12-13 21:40:24 +0800645@@ -140,7 +140,7 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
developereb6a0182022-12-12 18:53:32 +0800646
647 /* only support 2ss on 160MHz for mt7915 */
648 if (is_mt7915(&dev->mt76) && nss > 1 &&
649- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
650+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
651 break;
652 }
653 }
developerfe7be7f2022-12-13 21:40:24 +0800654@@ -149,10 +149,10 @@ static void
developereb6a0182022-12-12 18:53:32 +0800655 mt7915_mcu_set_sta_ht_mcs(struct ieee80211_sta *sta, u8 *ht_mcs,
656 const u8 *mask)
657 {
658- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
659+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
660
661 for (nss = 0; nss < max_nss; nss++)
662- ht_mcs[nss] = sta->deflink.ht_cap.mcs.rx_mask[nss] & mask[nss];
663+ ht_mcs[nss] = sta->ht_cap.mcs.rx_mask[nss] & mask[nss];
664 }
665
666 static int
developerfd8e1152023-02-14 11:29:23 +0800667@@ -233,7 +233,7 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
developereb6a0182022-12-12 18:53:32 +0800668 static void
669 mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
670 {
671- if (vif->bss_conf.csa_active)
672+ if (vif->csa_active)
673 ieee80211_csa_finish(vif);
674 }
675
developerfd8e1152023-02-14 11:29:23 +0800676@@ -334,7 +334,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)
developereb6a0182022-12-12 18:53:32 +0800677 static void
678 mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
679 {
680- if (!vif->bss_conf.color_change_active)
681+ if (!vif->color_change_active)
682 return;
683
684 ieee80211_color_change_finish(vif);
developerfd8e1152023-02-14 11:29:23 +0800685@@ -748,13 +748,13 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800686 struct ieee80211_vif *vif)
687 {
688 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
689- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
690+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
691 struct ieee80211_he_mcs_nss_supp mcs_map;
692 struct sta_rec_he *he;
693 struct tlv *tlv;
694 u32 cap = 0;
695
696- if (!sta->deflink.he_cap.has_he)
697+ if (!sta->he_cap.has_he)
698 return;
699
700 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE, sizeof(*he));
developerfd8e1152023-02-14 11:29:23 +0800701@@ -840,8 +840,8 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800702
703 he->he_cap = cpu_to_le32(cap);
704
705- mcs_map = sta->deflink.he_cap.he_mcs_nss_supp;
706- switch (sta->deflink.bandwidth) {
707+ mcs_map = sta->he_cap.he_mcs_nss_supp;
708+ switch (sta->bandwidth) {
709 case IEEE80211_STA_RX_BW_160:
710 if (elem->phy_cap_info[0] &
711 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developerfd8e1152023-02-14 11:29:23 +0800712@@ -892,7 +892,7 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800713 {
714 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
developerfd8e1152023-02-14 11:29:23 +0800715 struct mt7915_phy *phy = mvif->phy;
developereb6a0182022-12-12 18:53:32 +0800716- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
717+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
718 struct sta_rec_muru *muru;
719 struct tlv *tlv;
developerfd8e1152023-02-14 11:29:23 +0800720
721@@ -916,11 +916,11 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb2bd8e2023-02-09 11:16:04 +0800722 muru->cfg.ofdma_dl_en = !!(phy->muru_onoff & OFDMA_DL);
723 muru->cfg.ofdma_ul_en = !!(phy->muru_onoff & OFDMA_UL);
developereb6a0182022-12-12 18:53:32 +0800724
725- if (sta->deflink.vht_cap.vht_supported)
726+ if (sta->vht_cap.vht_supported)
727 muru->mimo_dl.vht_mu_bfee =
728- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
729+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
730
731- if (!sta->deflink.he_cap.has_he)
732+ if (!sta->he_cap.has_he)
733 return;
734
735 muru->mimo_dl.partial_bw_dl_mimo =
developerfd8e1152023-02-14 11:29:23 +0800736@@ -954,13 +954,13 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800737 struct sta_rec_ht *ht;
738 struct tlv *tlv;
739
740- if (!sta->deflink.ht_cap.ht_supported)
741+ if (!sta->ht_cap.ht_supported)
742 return;
743
744 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
745
746 ht = (struct sta_rec_ht *)tlv;
747- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
748+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
749 }
750
751 static void
developerfd8e1152023-02-14 11:29:23 +0800752@@ -969,15 +969,15 @@ mt7915_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800753 struct sta_rec_vht *vht;
754 struct tlv *tlv;
755
756- if (!sta->deflink.vht_cap.vht_supported)
757+ if (!sta->vht_cap.vht_supported)
758 return;
759
760 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, sizeof(*vht));
761
762 vht = (struct sta_rec_vht *)tlv;
763- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
764- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
765- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
766+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
767+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
768+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
769 }
770
771 static void
developerfd8e1152023-02-14 11:29:23 +0800772@@ -992,7 +992,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800773 vif->type != NL80211_IFTYPE_AP)
774 return;
775
776- if (!sta->deflink.agg.max_amsdu_len)
777+ if (!sta->max_amsdu_len)
778 return;
779
780 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
developerfd8e1152023-02-14 11:29:23 +0800781@@ -1001,7 +1001,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800782 amsdu->amsdu_en = true;
783 msta->wcid.amsdu = true;
784
785- switch (sta->deflink.agg.max_amsdu_len) {
786+ switch (sta->max_amsdu_len) {
787 case IEEE80211_MAX_MPDU_LEN_VHT_11454:
788 if (!is_mt7915(&dev->mt76)) {
789 amsdu->max_mpdu_size =
developerfd8e1152023-02-14 11:29:23 +0800790@@ -1064,8 +1064,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800791 if (!bfee && tx_ant < 2)
792 return false;
793
794- if (sta->deflink.he_cap.has_he) {
795- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
796+ if (sta->he_cap.has_he) {
797+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
798
799 if (bfee)
800 return mvif->cap.he_su_ebfee &&
developerfd8e1152023-02-14 11:29:23 +0800801@@ -1075,8 +1075,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800802 HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
803 }
804
805- if (sta->deflink.vht_cap.vht_supported) {
806- u32 cap = sta->deflink.vht_cap.cap;
807+ if (sta->vht_cap.vht_supported) {
808+ u32 cap = sta->vht_cap.cap;
809
810 if (bfee)
811 return mvif->cap.vht_su_ebfee &&
developerfd8e1152023-02-14 11:29:23 +0800812@@ -1102,7 +1102,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800813 mt7915_mcu_sta_bfer_ht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
814 struct sta_rec_bf *bf)
815 {
816- struct ieee80211_mcs_info *mcs = &sta->deflink.ht_cap.mcs;
817+ struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
818 u8 n = 0;
819
820 bf->tx_mode = MT_PHY_TYPE_HT;
developerfd8e1152023-02-14 11:29:23 +0800821@@ -1127,7 +1127,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800822 mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
823 struct sta_rec_bf *bf, bool explicit)
824 {
825- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
826+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
827 struct ieee80211_sta_vht_cap *vc = &phy->mt76->sband_5g.sband.vht_cap;
828 u16 mcs_map = le16_to_cpu(pc->vht_mcs.rx_mcs_map);
829 u8 nss_mcs = mt7915_mcu_get_sta_nss(mcs_map);
developerfd8e1152023-02-14 11:29:23 +0800830@@ -1148,14 +1148,14 @@ mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
developereb6a0182022-12-12 18:53:32 +0800831 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
832 bf->ibf_ncol = bf->ncol;
833
834- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
835+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
836 bf->nrow = 1;
837 } else {
838 bf->nrow = tx_ant;
839 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
840 bf->ibf_ncol = nss_mcs;
841
842- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
843+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
844 bf->ibf_nrow = 1;
845 }
846 }
developerfd8e1152023-02-14 11:29:23 +0800847@@ -1164,7 +1164,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800848 mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
849 struct mt7915_phy *phy, struct sta_rec_bf *bf)
850 {
851- struct ieee80211_sta_he_cap *pc = &sta->deflink.he_cap;
852+ struct ieee80211_sta_he_cap *pc = &sta->he_cap;
853 struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem;
854 const struct ieee80211_sta_he_cap *vc =
855 mt76_connac_get_he_phy_cap(phy->mt76, vif);
developerfd8e1152023-02-14 11:29:23 +0800856@@ -1189,7 +1189,7 @@ mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800857 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
858 bf->ibf_ncol = bf->ncol;
859
860- if (sta->deflink.bandwidth != IEEE80211_STA_RX_BW_160)
861+ if (sta->bandwidth != IEEE80211_STA_RX_BW_160)
862 return;
863
864 /* go over for 160MHz and 80p80 */
developerfd8e1152023-02-14 11:29:23 +0800865@@ -1237,7 +1237,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800866 };
867 bool ebf;
868
869- if (!(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
870+ if (!(sta->ht_cap.ht_supported || sta->he_cap.has_he))
871 return;
872
873 ebf = mt7915_is_ebf_supported(phy, vif, sta, false);
developerfd8e1152023-02-14 11:29:23 +0800874@@ -1251,21 +1251,21 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800875 * vht: support eBF and iBF
876 * ht: iBF only, since mac80211 lacks of eBF support
877 */
878- if (sta->deflink.he_cap.has_he && ebf)
879+ if (sta->he_cap.has_he && ebf)
880 mt7915_mcu_sta_bfer_he(sta, vif, phy, bf);
881- else if (sta->deflink.vht_cap.vht_supported)
882+ else if (sta->vht_cap.vht_supported)
883 mt7915_mcu_sta_bfer_vht(sta, phy, bf, ebf);
884- else if (sta->deflink.ht_cap.ht_supported)
885+ else if (sta->ht_cap.ht_supported)
886 mt7915_mcu_sta_bfer_ht(sta, phy, bf);
887 else
888 return;
889
890 bf->bf_cap = ebf ? ebf : dev->ibf << 1;
891- bf->bw = sta->deflink.bandwidth;
892- bf->ibf_dbw = sta->deflink.bandwidth;
893+ bf->bw = sta->bandwidth;
894+ bf->ibf_dbw = sta->bandwidth;
895 bf->ibf_nrow = tx_ant;
896
897- if (!ebf && sta->deflink.bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
898+ if (!ebf && sta->bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
899 bf->ibf_timeout = 0x48;
900 else
901 bf->ibf_timeout = 0x18;
developerfd8e1152023-02-14 11:29:23 +0800902@@ -1275,7 +1275,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800903 else
904 bf->mem_20m = matrix[bf->nrow][bf->ncol];
905
906- switch (sta->deflink.bandwidth) {
907+ switch (sta->bandwidth) {
908 case IEEE80211_STA_RX_BW_160:
909 case IEEE80211_STA_RX_BW_80:
910 bf->mem_total = bf->mem_20m * 2;
developerfd8e1152023-02-14 11:29:23 +0800911@@ -1300,7 +1300,7 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800912 struct tlv *tlv;
913 u8 nrow = 0;
914
915- if (!(sta->deflink.vht_cap.vht_supported || sta->deflink.he_cap.has_he))
916+ if (!(sta->vht_cap.vht_supported || sta->he_cap.has_he))
917 return;
918
919 if (!mt7915_is_ebf_supported(phy, vif, sta, true))
developerfd8e1152023-02-14 11:29:23 +0800920@@ -1309,13 +1309,13 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800921 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_BFEE, sizeof(*bfee));
922 bfee = (struct sta_rec_bfee *)tlv;
923
924- if (sta->deflink.he_cap.has_he) {
925- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
926+ if (sta->he_cap.has_he) {
927+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
928
929 nrow = HE_PHY(CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK,
930 pe->phy_cap_info[5]);
931- } else if (sta->deflink.vht_cap.vht_supported) {
932- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
933+ } else if (sta->vht_cap.vht_supported) {
934+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
935
936 nrow = FIELD_GET(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK,
937 pc->cap);
developerfd8e1152023-02-14 11:29:23 +0800938@@ -1371,7 +1371,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800939 ra->phy = *phy;
940 break;
941 case RATE_PARAM_MMPS_UPDATE:
942- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
943+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
944 break;
945 case RATE_PARAM_SPE_UPDATE:
946 ra->spe_idx = *(u8 *)data;
developerfd8e1152023-02-14 11:29:23 +0800947@@ -1446,7 +1446,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800948 do { \
949 u8 i, gi = mask->control[band]._gi; \
950 gi = (_he) ? gi : gi == NL80211_TXRATE_FORCE_SGI; \
951- for (i = 0; i <= sta->deflink.bandwidth; i++) { \
952+ for (i = 0; i <= sta->bandwidth; i++) { \
953 phy.sgi |= gi << (i << (_he)); \
954 phy.he_ltf |= mask->control[band].he_ltf << (i << (_he));\
955 } \
developerfd8e1152023-02-14 11:29:23 +0800956@@ -1460,11 +1460,11 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800957 } \
958 } while (0)
959
960- if (sta->deflink.he_cap.has_he) {
961+ if (sta->he_cap.has_he) {
962 __sta_phy_bitrate_mask_check(he_mcs, he_gi, 0, 1);
963- } else if (sta->deflink.vht_cap.vht_supported) {
964+ } else if (sta->vht_cap.vht_supported) {
965 __sta_phy_bitrate_mask_check(vht_mcs, gi, 0, 0);
966- } else if (sta->deflink.ht_cap.ht_supported) {
967+ } else if (sta->ht_cap.ht_supported) {
968 __sta_phy_bitrate_mask_check(ht_mcs, gi, 1, 0);
969 } else {
970 nrates = hweight32(mask->control[band].legacy);
developerfd8e1152023-02-14 11:29:23 +0800971@@ -1498,7 +1498,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800972 * actual txrate hardware sends out.
973 */
974 addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 7);
975- if (sta->deflink.he_cap.has_he)
976+ if (sta->he_cap.has_he)
977 mt76_rmw_field(dev, addr, GENMASK(31, 24), phy.sgi);
978 else
979 mt76_rmw_field(dev, addr, GENMASK(15, 12), phy.sgi);
developerfd8e1152023-02-14 11:29:23 +0800980@@ -1531,7 +1531,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800981 enum nl80211_band band = chandef->chan->band;
982 struct sta_rec_ra *ra;
983 struct tlv *tlv;
984- u32 supp_rate = sta->deflink.supp_rates[band];
985+ u32 supp_rate = sta->supp_rates[band];
986 u32 cap = sta->wme ? STA_CAP_WMM : 0;
987
988 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra));
developerfd8e1152023-02-14 11:29:23 +0800989@@ -1541,9 +1541,9 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800990 ra->auto_rate = true;
991 ra->phy_mode = mt76_connac_get_phy_mode(mphy, vif, band, sta);
992 ra->channel = chandef->chan->hw_value;
993- ra->bw = sta->deflink.bandwidth;
994- ra->phy.bw = sta->deflink.bandwidth;
995- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
996+ ra->bw = sta->bandwidth;
997+ ra->phy.bw = sta->bandwidth;
998+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
999
1000 if (supp_rate) {
1001 supp_rate &= mask->control[band].legacy;
developerfd8e1152023-02-14 11:29:23 +08001002@@ -1563,22 +1563,22 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +08001003 }
1004 }
1005
1006- if (sta->deflink.ht_cap.ht_supported) {
1007+ if (sta->ht_cap.ht_supported) {
1008 ra->supp_mode |= MODE_HT;
1009- ra->af = sta->deflink.ht_cap.ampdu_factor;
1010- ra->ht_gf = !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
1011+ ra->af = sta->ht_cap.ampdu_factor;
1012+ ra->ht_gf = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
1013
1014 cap |= STA_CAP_HT;
1015- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
1016+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
1017 cap |= STA_CAP_SGI_20;
1018- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
1019+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
1020 cap |= STA_CAP_SGI_40;
1021- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
1022+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
1023 cap |= STA_CAP_TX_STBC;
1024- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
1025+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
1026 cap |= STA_CAP_RX_STBC;
1027 if (mvif->cap.ht_ldpc &&
1028- (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
1029+ (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
1030 cap |= STA_CAP_LDPC;
1031
1032 mt7915_mcu_set_sta_ht_mcs(sta, ra->ht_mcs,
developerfd8e1152023-02-14 11:29:23 +08001033@@ -1586,37 +1586,37 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +08001034 ra->supp_ht_mcs = *(__le32 *)ra->ht_mcs;
1035 }
1036
1037- if (sta->deflink.vht_cap.vht_supported) {
1038+ if (sta->vht_cap.vht_supported) {
1039 u8 af;
1040
1041 ra->supp_mode |= MODE_VHT;
1042 af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
1043- sta->deflink.vht_cap.cap);
1044+ sta->vht_cap.cap);
1045 ra->af = max_t(u8, ra->af, af);
1046
1047 cap |= STA_CAP_VHT;
1048- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
1049+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
1050 cap |= STA_CAP_VHT_SGI_80;
1051- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
1052+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
1053 cap |= STA_CAP_VHT_SGI_160;
1054- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
1055+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
1056 cap |= STA_CAP_VHT_TX_STBC;
1057- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
1058+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
1059 cap |= STA_CAP_VHT_RX_STBC;
1060 if (mvif->cap.vht_ldpc &&
1061- (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
1062+ (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
1063 cap |= STA_CAP_VHT_LDPC;
1064
1065 mt7915_mcu_set_sta_vht_mcs(sta, ra->supp_vht_mcs,
1066 mask->control[band].vht_mcs);
1067 }
1068
1069- if (sta->deflink.he_cap.has_he) {
1070+ if (sta->he_cap.has_he) {
1071 ra->supp_mode |= MODE_HE;
1072 cap |= STA_CAP_HE;
1073
1074- if (sta->deflink.he_6ghz_capa.capa)
1075- ra->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
1076+ if (sta->he_6ghz_capa.capa)
1077+ ra->af = le16_get_bits(sta->he_6ghz_capa.capa,
1078 IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
1079 }
1080
developerfd8e1152023-02-14 11:29:23 +08001081@@ -1825,7 +1825,7 @@ mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
developereb6a0182022-12-12 18:53:32 +08001082 if (!offs->cntdwn_counter_offs[0])
1083 return;
1084
1085- sub_tag = vif->bss_conf.csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
1086+ sub_tag = vif->csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
1087 tlv = mt7915_mcu_add_nested_subtlv(rskb, sub_tag, sizeof(*info),
1088 &bcn->sub_ntlv, &bcn->len);
1089 info = (struct bss_info_bcn_cntdwn *)tlv;
developerfd8e1152023-02-14 11:29:23 +08001090@@ -1910,9 +1910,9 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +08001091 if (offs->cntdwn_counter_offs[0]) {
1092 u16 offset = offs->cntdwn_counter_offs[0];
1093
1094- if (vif->bss_conf.csa_active)
1095+ if (vif->csa_active)
1096 cont->csa_ofs = cpu_to_le16(offset - 4);
1097- if (vif->bss_conf.color_change_active)
1098+ if (vif->color_change_active)
1099 cont->bcc_ofs = cpu_to_le16(offset - 3);
1100 }
1101
developerfd8e1152023-02-14 11:29:23 +08001102@@ -2097,7 +2097,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +08001103 if (!en)
1104 goto out;
1105
1106- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
1107+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
1108 if (!skb)
1109 return -EINVAL;
1110
developerfd8e1152023-02-14 11:29:23 +08001111@@ -3358,17 +3358,17 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy,
developereb6a0182022-12-12 18:53:32 +08001112 if (txpower) {
1113 u32 offs, len, i;
1114
1115- if (sta->deflink.ht_cap.ht_supported) {
1116+ if (sta->ht_cap.ht_supported) {
1117 const u8 *sku_len = mt7915_sku_group_len;
1118
1119 offs = sku_len[SKU_CCK] + sku_len[SKU_OFDM];
1120 len = sku_len[SKU_HT_BW20] + sku_len[SKU_HT_BW40];
1121
1122- if (sta->deflink.vht_cap.vht_supported) {
1123+ if (sta->vht_cap.vht_supported) {
1124 offs += len;
1125 len = sku_len[SKU_VHT_BW20] * 4;
1126
1127- if (sta->deflink.he_cap.has_he) {
1128+ if (sta->he_cap.has_he) {
1129 offs += len + sku_len[SKU_HE_RU26] * 3;
1130 len = sku_len[SKU_HE_RU242] * 4;
1131 }
developerfe7be7f2022-12-13 21:40:24 +08001132diff --git a/mt7915/testmode.c b/mt7915/testmode.c
developer61526b72022-12-30 11:15:01 +08001133index e4af5e1c..19dfb354 100644
developerfe7be7f2022-12-13 21:40:24 +08001134--- a/mt7915/testmode.c
1135+++ b/mt7915/testmode.c
developer1346ce52022-12-15 21:36:14 +08001136@@ -397,12 +397,12 @@ mt7915_tm_entry_add(struct mt7915_phy *phy, u8 aid)
1137 memcpy(sta->addr, td->addr[0], ETH_ALEN);
developerfe7be7f2022-12-13 21:40:24 +08001138
1139 if (td->tx_rate_mode >= MT76_TM_TX_MODE_HT)
1140- memcpy(&sta->deflink.ht_cap, &sband->ht_cap, sizeof(sta->deflink.ht_cap));
1141+ memcpy(&sta->ht_cap, &sband->ht_cap, sizeof(sta->ht_cap));
1142 if (td->tx_rate_mode >= MT76_TM_TX_MODE_VHT)
1143- memcpy(&sta->deflink.vht_cap, &sband->vht_cap, sizeof(sta->deflink.vht_cap));
1144+ memcpy(&sta->vht_cap, &sband->vht_cap, sizeof(sta->vht_cap));
1145 if (td->tx_rate_mode >= MT76_TM_TX_MODE_HE_SU)
1146- memcpy(&sta->deflink.he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap,
1147- sizeof(sta->deflink.he_cap));
1148+ memcpy(&sta->he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap,
1149+ sizeof(sta->he_cap));
1150 sta->aid = aid;
1151 sta->wme = 1;
1152
developereb6a0182022-12-12 18:53:32 +08001153diff --git a/tx.c b/tx.c
developerfd8e1152023-02-14 11:29:23 +08001154index 36b0f486..6b590b27 100644
developereb6a0182022-12-12 18:53:32 +08001155--- a/tx.c
1156+++ b/tx.c
1157@@ -60,20 +60,15 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
1158 .skb = skb,
1159 .info = IEEE80211_SKB_CB(skb),
1160 };
1161- struct ieee80211_rate_status rs = {};
1162 struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
1163 struct mt76_wcid *wcid;
1164
1165 wcid = rcu_dereference(dev->wcid[cb->wcid]);
1166 if (wcid) {
1167 status.sta = wcid_to_sta(wcid);
1168- if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
1169- rs.rate_idx = wcid->rate;
1170- status.rates = &rs;
1171- status.n_rates = 1;
1172- } else {
1173- status.n_rates = 0;
1174- }
1175+
1176+ if (status.sta)
1177+ status.rate = &wcid->rate;
1178 }
1179
1180 hw = mt76_tx_status_get_hw(dev, skb);
1181--
developer61526b72022-12-30 11:15:01 +080011822.18.0
developereb6a0182022-12-12 18:53:32 +08001183