blob: 17e80acd039efef6ae2beab717c0b9e1b975d76c [file] [log] [blame]
developer699cda22022-12-17 15:21:57 +08001From 156663f40f0af9fef71e64fd573b2a113bb90098 Mon Sep 17 00:00:00 2001
developereb6a0182022-12-12 18:53:32 +08002From: Shayne Chen <shayne.chen@mediatek.com>
developer4be8f972022-12-13 16:02:25 +08003Date: Mon, 12 Dec 2022 18:17:12 +0800
developer699cda22022-12-17 15:21:57 +08004Subject: [PATCH 4003/4003] mt76: revert for backports-5.15 wireless stack
developereb6a0182022-12-12 18:53:32 +08005
6Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
developerfe7be7f2022-12-13 21:40:24 +08007---
8 debugfs.c | 2 +
9 dma.c | 2 +-
10 mac80211.c | 4 +-
developerf0de14b2022-12-14 23:07:34 +080011 mt7615/dma.c | 4 +-
developerfe7be7f2022-12-13 21:40:24 +080012 mt7615/main.c | 6 +-
13 mt7615/mcu.c | 8 +--
14 mt76_connac_mcu.c | 108 +++++++++++++++---------------
15 mt76x02_mac.c | 6 +-
16 mt7915/debugfs.c | 4 +-
17 mt7915/dma.c | 4 +-
18 mt7915/init.c | 3 +-
19 mt7915/mac.c | 2 +-
20 mt7915/main.c | 10 +--
21 mt7915/mcu.c | 166 +++++++++++++++++++++++-----------------------
22 mt7915/testmode.c | 8 +--
23 tx.c | 11 +--
developerf0de14b2022-12-14 23:07:34 +080024 16 files changed, 170 insertions(+), 178 deletions(-)
developereb6a0182022-12-12 18:53:32 +080025
26diff --git a/debugfs.c b/debugfs.c
developer699cda22022-12-17 15:21:57 +080027index 79064a4..4a8e186 100644
developereb6a0182022-12-12 18:53:32 +080028--- a/debugfs.c
29+++ b/debugfs.c
30@@ -33,8 +33,10 @@ mt76_napi_threaded_set(void *data, u64 val)
31 if (!mt76_is_mmio(dev))
32 return -EOPNOTSUPP;
33
34+#if 0 /* disable in backport 5.15 */
35 if (dev->napi_dev.threaded != val)
36 return dev_set_threaded(&dev->napi_dev, val);
37+#endif
38
39 return 0;
40 }
41diff --git a/dma.c b/dma.c
developer699cda22022-12-17 15:21:57 +080042index 0925daf..08169ba 100644
developereb6a0182022-12-12 18:53:32 +080043--- a/dma.c
44+++ b/dma.c
developer699cda22022-12-17 15:21:57 +080045@@ -945,7 +945,7 @@ mt76_dma_init(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +080046 dev->napi_dev.threaded = 1;
47
48 mt76_for_each_q_rx(dev, i) {
49- netif_napi_add(&dev->napi_dev, &dev->napi[i], poll);
50+ netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64);
51 mt76_dma_rx_fill(dev, &dev->q_rx[i]);
52 napi_enable(&dev->napi[i]);
53 }
54diff --git a/mac80211.c b/mac80211.c
developer699cda22022-12-17 15:21:57 +080055index 818f4f0..909ab25 100644
developereb6a0182022-12-12 18:53:32 +080056--- a/mac80211.c
57+++ b/mac80211.c
developer9851a292022-12-15 17:33:43 +080058@@ -1508,7 +1508,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power);
developereb6a0182022-12-12 18:53:32 +080059 static void
60 __mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
61 {
62- if (vif->bss_conf.csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
63+ if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
64 ieee80211_csa_finish(vif);
65 }
66
developer9851a292022-12-15 17:33:43 +080067@@ -1530,7 +1530,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif)
developereb6a0182022-12-12 18:53:32 +080068 {
69 struct mt76_dev *dev = priv;
70
71- if (!vif->bss_conf.csa_active)
72+ if (!vif->csa_active)
73 return;
74
75 dev->csa_complete |= ieee80211_beacon_cntdwn_is_complete(vif);
developerf0de14b2022-12-14 23:07:34 +080076diff --git a/mt7615/dma.c b/mt7615/dma.c
developer699cda22022-12-17 15:21:57 +080077index f191443..ec729db 100644
developerf0de14b2022-12-14 23:07:34 +080078--- a/mt7615/dma.c
79+++ b/mt7615/dma.c
80@@ -281,8 +281,8 @@ int mt7615_dma_init(struct mt7615_dev *dev)
81 if (ret < 0)
82 return ret;
83
84- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
85- mt7615_poll_tx);
86+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
87+ mt7615_poll_tx, NAPI_POLL_WEIGHT);
88 napi_enable(&dev->mt76.tx_napi);
89
90 mt76_poll(dev, MT_WPDMA_GLO_CFG,
developereb6a0182022-12-12 18:53:32 +080091diff --git a/mt7615/main.c b/mt7615/main.c
developer699cda22022-12-17 15:21:57 +080092index ab4c1b4..8fb5b25 100644
developereb6a0182022-12-12 18:53:32 +080093--- a/mt7615/main.c
94+++ b/mt7615/main.c
95@@ -474,7 +474,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
96
97 static int
98 mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
99- unsigned int link_id, u16 queue,
100+ u16 queue,
101 const struct ieee80211_tx_queue_params *params)
102 {
103 struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
104@@ -556,7 +556,7 @@ static void mt7615_configure_filter(struct ieee80211_hw *hw,
105 static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
106 struct ieee80211_vif *vif,
107 struct ieee80211_bss_conf *info,
108- u64 changed)
109+ u32 changed)
110 {
111 struct mt7615_dev *dev = mt7615_hw_dev(hw);
112 struct mt7615_phy *phy = mt7615_hw_phy(hw);
113@@ -599,7 +599,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
114 }
115
116 if (changed & BSS_CHANGED_ASSOC)
117- mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc);
118+ mt7615_mac_set_beacon_filter(phy, vif, info->assoc);
119
120 mt7615_mutex_release(dev);
121 }
122diff --git a/mt7615/mcu.c b/mt7615/mcu.c
developer699cda22022-12-17 15:21:57 +0800123index e917d02..b2e1f38 100644
developereb6a0182022-12-12 18:53:32 +0800124--- a/mt7615/mcu.c
125+++ b/mt7615/mcu.c
developerfe7be7f2022-12-13 21:40:24 +0800126@@ -353,7 +353,7 @@ out:
developereb6a0182022-12-12 18:53:32 +0800127 static void
128 mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
129 {
130- if (vif->bss_conf.csa_active)
131+ if (vif->csa_active)
132 ieee80211_csa_finish(vif);
133 }
134
developerfe7be7f2022-12-13 21:40:24 +0800135@@ -699,7 +699,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800136 if (!enable)
137 goto out;
138
139- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
140+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
141 if (!skb)
142 return -EINVAL;
143
developerfe7be7f2022-12-13 21:40:24 +0800144@@ -1074,7 +1074,7 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800145 if (!enable)
146 goto out;
147
148- skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs, 0);
149+ skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs);
150 if (!skb)
151 return -EINVAL;
152
developerfe7be7f2022-12-13 21:40:24 +0800153@@ -2526,7 +2526,7 @@ int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800154 u8 pad;
155 } req = {
156 .bss_idx = mvif->mt76.idx,
157- .aid = cpu_to_le16(vif->cfg.aid),
158+ .aid = cpu_to_le16(vif->bss_conf.aid),
159 .dtim_period = vif->bss_conf.dtim_period,
160 .bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int),
161 };
162diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
developer699cda22022-12-17 15:21:57 +0800163index d406013..703ca73 100644
developereb6a0182022-12-12 18:53:32 +0800164--- a/mt76_connac_mcu.c
165+++ b/mt76_connac_mcu.c
developerfe7be7f2022-12-13 21:40:24 +0800166@@ -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 +0800167 */
168 } req = {
169 .bss_idx = mvif->idx,
170- .ps_state = vif->cfg.ps ? 2 : 0,
171+ .ps_state = vif->bss_conf.ps ? 2 : 0,
172 };
173
174 if (vif->type != NL80211_IFTYPE_STATION)
developerfe7be7f2022-12-13 21:40:24 +0800175@@ -409,7 +409,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800176 else
177 conn_type = CONNECTION_INFRA_AP;
178 basic->conn_type = cpu_to_le32(conn_type);
179- basic->aid = cpu_to_le16(vif->cfg.aid);
180+ basic->aid = cpu_to_le16(vif->bss_conf.aid);
181 break;
182 case NL80211_IFTYPE_ADHOC:
183 basic->conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC);
developerfe7be7f2022-12-13 21:40:24 +0800184@@ -553,7 +553,7 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800185
186 if (sta) {
187 if (vif->type == NL80211_IFTYPE_STATION)
188- generic->partial_aid = cpu_to_le16(vif->cfg.aid);
189+ generic->partial_aid = cpu_to_le16(vif->bss_conf.aid);
190 else
191 generic->partial_aid = cpu_to_le16(sta->aid);
192 memcpy(generic->peer_addr, sta->addr, ETH_ALEN);
developerfe7be7f2022-12-13 21:40:24 +0800193@@ -602,14 +602,14 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800194 vif->type != NL80211_IFTYPE_STATION)
195 return;
196
197- if (!sta->deflink.agg.max_amsdu_len)
198+ if (!sta->max_amsdu_len)
199 return;
200
201 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
202 amsdu = (struct sta_rec_amsdu *)tlv;
203 amsdu->max_amsdu_num = 8;
204 amsdu->amsdu_en = true;
205- amsdu->max_mpdu_size = sta->deflink.agg.max_amsdu_len >=
206+ amsdu->max_mpdu_size = sta->max_amsdu_len >=
207 IEEE80211_MAX_MPDU_LEN_VHT_7991;
208
209 wcid->amsdu = true;
developerfe7be7f2022-12-13 21:40:24 +0800210@@ -620,7 +620,7 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800211 static void
212 mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
213 {
214- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
215+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
216 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
217 struct sta_rec_he *he;
218 struct tlv *tlv;
developerfe7be7f2022-12-13 21:40:24 +0800219@@ -708,7 +708,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800220
221 he->he_cap = cpu_to_le32(cap);
222
223- switch (sta->deflink.bandwidth) {
224+ switch (sta->bandwidth) {
225 case IEEE80211_STA_RX_BW_160:
226 if (elem->phy_cap_info[0] &
227 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developerfe7be7f2022-12-13 21:40:24 +0800228@@ -753,7 +753,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800229 static void
230 mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
231 {
232- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
233+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
234 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
235 struct sta_rec_he_v2 *he;
236 struct tlv *tlv;
developerfe7be7f2022-12-13 21:40:24 +0800237@@ -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 +0800238 memcpy(he->he_phy_cap, elem->phy_cap_info, sizeof(he->he_phy_cap));
239 memcpy(he->he_mac_cap, elem->mac_cap_info, sizeof(he->he_mac_cap));
240
241- switch (sta->deflink.bandwidth) {
242+ switch (sta->bandwidth) {
243 case IEEE80211_STA_RX_BW_160:
244 if (elem->phy_cap_info[0] &
245 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developerfe7be7f2022-12-13 21:40:24 +0800246@@ -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 +0800247 break;
248 }
249
250- he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US;
251+ he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
252 }
253
254 static u8
developerfe7be7f2022-12-13 21:40:24 +0800255@@ -793,9 +793,9 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800256 u8 mode = 0;
257
258 if (sta) {
259- ht_cap = &sta->deflink.ht_cap;
260- vht_cap = &sta->deflink.vht_cap;
261- he_cap = &sta->deflink.he_cap;
262+ ht_cap = &sta->ht_cap;
263+ vht_cap = &sta->vht_cap;
264+ he_cap = &sta->he_cap;
265 } else {
266 struct ieee80211_supported_band *sband;
267
developerfe7be7f2022-12-13 21:40:24 +0800268@@ -844,25 +844,25 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800269 u16 supp_rates;
270
271 /* starec ht */
272- if (sta->deflink.ht_cap.ht_supported) {
273+ if (sta->ht_cap.ht_supported) {
274 struct sta_rec_ht *ht;
275
276 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
277 ht = (struct sta_rec_ht *)tlv;
278- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
279+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
280 }
281
282 /* starec vht */
283- if (sta->deflink.vht_cap.vht_supported) {
284+ if (sta->vht_cap.vht_supported) {
285 struct sta_rec_vht *vht;
286 int len;
287
288 len = is_mt7921(dev) ? sizeof(*vht) : sizeof(*vht) - 4;
289 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, len);
290 vht = (struct sta_rec_vht *)tlv;
291- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
292- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
293- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
294+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
295+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
296+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
297 }
298
299 /* starec uapsd */
developerfe7be7f2022-12-13 21:40:24 +0800300@@ -871,11 +871,11 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800301 if (!is_mt7921(dev))
302 return;
303
304- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)
305+ if (sta->ht_cap.ht_supported || sta->he_cap.has_he)
306 mt76_connac_mcu_sta_amsdu_tlv(skb, sta, vif);
307
308 /* starec he */
309- if (sta->deflink.he_cap.has_he) {
310+ if (sta->he_cap.has_he) {
311 mt76_connac_mcu_sta_he_tlv(skb, sta);
312 mt76_connac_mcu_sta_he_tlv_v2(skb, sta);
313 if (band == NL80211_BAND_6GHZ &&
developerfe7be7f2022-12-13 21:40:24 +0800314@@ -885,7 +885,7 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800315 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE_6G,
316 sizeof(*he_6g_capa));
317 he_6g_capa = (struct sta_rec_he_6g_capa *)tlv;
318- he_6g_capa->capa = sta->deflink.he_6ghz_capa.capa;
319+ he_6g_capa->capa = sta->he_6ghz_capa.capa;
320 }
321 }
322
developerfe7be7f2022-12-13 21:40:24 +0800323@@ -895,14 +895,14 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800324 phy->basic_rate = cpu_to_le16((u16)vif->bss_conf.basic_rates);
325 phy->rcpi = rcpi;
326 phy->ampdu = FIELD_PREP(IEEE80211_HT_AMPDU_PARM_FACTOR,
327- sta->deflink.ht_cap.ampdu_factor) |
328+ sta->ht_cap.ampdu_factor) |
329 FIELD_PREP(IEEE80211_HT_AMPDU_PARM_DENSITY,
330- sta->deflink.ht_cap.ampdu_density);
331+ sta->ht_cap.ampdu_density);
332
333 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra_info));
334 ra_info = (struct sta_rec_ra_info *)tlv;
335
336- supp_rates = sta->deflink.supp_rates[band];
337+ supp_rates = sta->supp_rates[band];
338 if (band == NL80211_BAND_2GHZ)
339 supp_rates = FIELD_PREP(RA_LEGACY_OFDM, supp_rates >> 4) |
340 FIELD_PREP(RA_LEGACY_CCK, supp_rates & 0xf);
developerfe7be7f2022-12-13 21:40:24 +0800341@@ -911,18 +911,18 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800342
343 ra_info->legacy = cpu_to_le16(supp_rates);
344
345- if (sta->deflink.ht_cap.ht_supported)
346+ if (sta->ht_cap.ht_supported)
347 memcpy(ra_info->rx_mcs_bitmask,
348- sta->deflink.ht_cap.mcs.rx_mask,
349+ sta->ht_cap.mcs.rx_mask,
350 HT_MCS_MASK_NUM);
351
352 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_STATE, sizeof(*state));
353 state = (struct sta_rec_state *)tlv;
354 state->state = sta_state;
355
356- if (sta->deflink.vht_cap.vht_supported) {
357- state->vht_opmode = sta->deflink.bandwidth;
358- state->vht_opmode |= (sta->deflink.rx_nss - 1) <<
359+ if (sta->vht_cap.vht_supported) {
360+ state->vht_opmode = sta->bandwidth;
361+ state->vht_opmode |= (sta->rx_nss - 1) <<
362 IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
363 }
364 }
developerfe7be7f2022-12-13 21:40:24 +0800365@@ -938,7 +938,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800366 tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_SMPS, sizeof(*smps),
367 wtbl_tlv, sta_wtbl);
368 smps = (struct wtbl_smps *)tlv;
369- smps->smps = (sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC);
370+ smps->smps = (sta->smps_mode == IEEE80211_SMPS_DYNAMIC);
371 }
372 EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_smps_tlv);
373
developerfe7be7f2022-12-13 21:40:24 +0800374@@ -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 +0800375 struct tlv *tlv;
376 u32 flags = 0;
377
378- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_6ghz_capa.capa) {
379+ if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) {
380 tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht),
381 wtbl_tlv, sta_wtbl);
382 ht = (struct wtbl_ht *)tlv;
383 ht->ldpc = ht_ldpc &&
384- !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
385+ !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
386
387- if (sta->deflink.ht_cap.ht_supported) {
388- ht->af = sta->deflink.ht_cap.ampdu_factor;
389- ht->mm = sta->deflink.ht_cap.ampdu_density;
390+ if (sta->ht_cap.ht_supported) {
391+ ht->af = sta->ht_cap.ampdu_factor;
392+ ht->mm = sta->ht_cap.ampdu_density;
393 } else {
394- ht->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
395+ ht->af = le16_get_bits(sta->he_6ghz_capa.capa,
396 IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
397- ht->mm = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
398+ ht->mm = le16_get_bits(sta->he_6ghz_capa.capa,
399 IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START);
400 }
401
402 ht->ht = true;
403 }
404
405- if (sta->deflink.vht_cap.vht_supported || sta->deflink.he_6ghz_capa.capa) {
406+ if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) {
407 struct wtbl_vht *vht;
408 u8 af;
409
developerfe7be7f2022-12-13 21:40:24 +0800410@@ -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 +0800411 sta_wtbl);
412 vht = (struct wtbl_vht *)tlv;
413 vht->ldpc = vht_ldpc &&
414- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
415+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
416 vht->vht = true;
417
418 af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
419- sta->deflink.vht_cap.cap);
420+ sta->vht_cap.cap);
421 if (ht)
422 ht->af = max(ht->af, af);
423 }
424
425 mt76_connac_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_tlv);
426
427- if (is_connac_v1(dev) && sta->deflink.ht_cap.ht_supported) {
428+ if (is_connac_v1(dev) && sta->ht_cap.ht_supported) {
429 /* sgi */
430 u32 msk = MT_WTBL_W5_SHORT_GI_20 | MT_WTBL_W5_SHORT_GI_40 |
431 MT_WTBL_W5_SHORT_GI_80 | MT_WTBL_W5_SHORT_GI_160;
developerfe7be7f2022-12-13 21:40:24 +0800432@@ -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 +0800433 sizeof(*raw), wtbl_tlv,
434 sta_wtbl);
435
436- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
437+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
438 flags |= MT_WTBL_W5_SHORT_GI_20;
439- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
440+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
441 flags |= MT_WTBL_W5_SHORT_GI_40;
442
443- if (sta->deflink.vht_cap.vht_supported) {
444- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
445+ if (sta->vht_cap.vht_supported) {
446+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
447 flags |= MT_WTBL_W5_SHORT_GI_80;
448- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
449+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
450 flags |= MT_WTBL_W5_SHORT_GI_160;
451 }
452 raw = (struct wtbl_raw *)tlv;
developerfe7be7f2022-12-13 21:40:24 +0800453@@ -1294,9 +1294,9 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800454 return 0x38;
455
456 if (sta) {
457- ht_cap = &sta->deflink.ht_cap;
458- vht_cap = &sta->deflink.vht_cap;
459- he_cap = &sta->deflink.he_cap;
460+ ht_cap = &sta->ht_cap;
461+ vht_cap = &sta->vht_cap;
462+ he_cap = &sta->he_cap;
463 } else {
464 struct ieee80211_supported_band *sband;
465
developerfe7be7f2022-12-13 21:40:24 +0800466@@ -1616,7 +1616,6 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800467 for (i = 0; i < sreq->n_ssids; i++) {
468 if (!sreq->ssids[i].ssid_len)
469 continue;
470-
471 req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len);
472 memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid,
473 sreq->ssids[i].ssid_len);
developerfe7be7f2022-12-13 21:40:24 +0800474@@ -1749,7 +1748,6 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy,
developereb6a0182022-12-12 18:53:32 +0800475 memcpy(req->ssids[i].ssid, ssid->ssid, ssid->ssid_len);
476 req->ssids[i].ssid_len = cpu_to_le32(ssid->ssid_len);
477 }
478-
479 req->match_num = sreq->n_match_sets;
480 for (i = 0; i < req->match_num; i++) {
481 match = &sreq->match_sets[i];
developerfe7be7f2022-12-13 21:40:24 +0800482@@ -2236,10 +2234,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800483 struct mt76_vif *vif,
484 struct ieee80211_bss_conf *info)
485 {
486- struct ieee80211_vif *mvif = container_of(info, struct ieee80211_vif,
487- bss_conf);
488 struct sk_buff *skb;
489- int i, len = min_t(int, mvif->cfg.arp_addr_cnt,
490+ int i, len = min_t(int, info->arp_addr_cnt,
491 IEEE80211_BSS_ARP_ADDR_LIST_LEN);
492 struct {
493 struct {
developerfe7be7f2022-12-13 21:40:24 +0800494@@ -2267,7 +2263,7 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800495
496 skb_put_data(skb, &req_hdr, sizeof(req_hdr));
497 for (i = 0; i < len; i++)
498- skb_put_data(skb, &mvif->cfg.arp_addr_list[i], sizeof(__be32));
499+ skb_put_data(skb, &info->arp_addr_list[i], sizeof(__be32));
500
501 return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true);
502 }
503diff --git a/mt76x02_mac.c b/mt76x02_mac.c
developer699cda22022-12-17 15:21:57 +0800504index d3f7447..87ea3db 100644
developereb6a0182022-12-12 18:53:32 +0800505--- a/mt76x02_mac.c
506+++ b/mt76x02_mac.c
507@@ -404,7 +404,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
508 txwi->rate |= cpu_to_le16(MT_RXWI_RATE_LDPC);
509 if ((info->flags & IEEE80211_TX_CTL_STBC) && nss == 1)
510 txwi->rate |= cpu_to_le16(MT_RXWI_RATE_STBC);
511- if (nss > 1 && sta && sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC)
512+ if (nss > 1 && sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC)
513 txwi_flags |= MT_TXWI_FLAGS_MMPS;
514 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
515 txwi->ack_ctl |= MT_TXWI_ACK_CTL_REQ;
516@@ -412,9 +412,9 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
517 txwi->ack_ctl |= MT_TXWI_ACK_CTL_NSEQ;
518 if ((info->flags & IEEE80211_TX_CTL_AMPDU) && sta) {
519 u8 ba_size = IEEE80211_MIN_AMPDU_BUF;
520- u8 ampdu_density = sta->deflink.ht_cap.ampdu_density;
521+ u8 ampdu_density = sta->ht_cap.ampdu_density;
522
523- ba_size <<= sta->deflink.ht_cap.ampdu_factor;
524+ ba_size <<= sta->ht_cap.ampdu_factor;
525 ba_size = min_t(int, 63, ba_size - 1);
526 if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
527 ba_size = 0;
528diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
developer699cda22022-12-17 15:21:57 +0800529index b178036..cecc3ef 100644
developereb6a0182022-12-12 18:53:32 +0800530--- a/mt7915/debugfs.c
531+++ b/mt7915/debugfs.c
developerfe7be7f2022-12-13 21:40:24 +0800532@@ -1905,8 +1905,8 @@ static ssize_t mt7915_sta_fixed_rate_set(struct file *file,
developereb6a0182022-12-12 18:53:32 +0800533
534 phy.ldpc = (phy.bw || phy.ldpc) * GENMASK(2, 0);
535 for (i = 0; i <= phy.bw; i++) {
536- phy.sgi |= gi << (i << sta->deflink.he_cap.has_he);
537- phy.he_ltf |= he_ltf << (i << sta->deflink.he_cap.has_he);
538+ phy.sgi |= gi << (i << sta->he_cap.has_he);
539+ phy.he_ltf |= he_ltf << (i << sta->he_cap.has_he);
540 }
541 field = RATE_PARAM_FIXED;
542
543diff --git a/mt7915/dma.c b/mt7915/dma.c
developer699cda22022-12-17 15:21:57 +0800544index 9cbd362..5743dc5 100644
developereb6a0182022-12-12 18:53:32 +0800545--- a/mt7915/dma.c
546+++ b/mt7915/dma.c
developer9851a292022-12-15 17:33:43 +0800547@@ -553,8 +553,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
developereb6a0182022-12-12 18:53:32 +0800548 if (ret < 0)
549 return ret;
550
551- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
552- mt7915_poll_tx);
553+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
554+ mt7915_poll_tx, NAPI_POLL_WEIGHT);
555 napi_enable(&dev->mt76.tx_napi);
556
557 mt7915_dma_enable(dev);
558diff --git a/mt7915/init.c b/mt7915/init.c
developer699cda22022-12-17 15:21:57 +0800559index ef752e1..9ccbc7b 100755
developereb6a0182022-12-12 18:53:32 +0800560--- a/mt7915/init.c
561+++ b/mt7915/init.c
developer9851a292022-12-15 17:33:43 +0800562@@ -1152,8 +1152,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
developereb6a0182022-12-12 18:53:32 +0800563 mt7915_gen_ppe_thresh(he_cap->ppe_thres, nss);
564 } else {
565 he_cap_elem->phy_cap_info[9] |=
566- u8_encode_bits(IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US,
567- IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK);
568+ IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
569 }
570
571 if (band == NL80211_BAND_6GHZ) {
572diff --git a/mt7915/mac.c b/mt7915/mac.c
developer699cda22022-12-17 15:21:57 +0800573index 0d0ae7a..d759912 100644
developereb6a0182022-12-12 18:53:32 +0800574--- a/mt7915/mac.c
575+++ b/mt7915/mac.c
developer1346ce52022-12-15 21:36:14 +0800576@@ -915,7 +915,7 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
developereb6a0182022-12-12 18:53:32 +0800577 u16 fc, tid;
578 u32 val;
579
580- if (!sta || !(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
581+ if (!sta || !(sta->ht_cap.ht_supported || sta->he_cap.has_he))
582 return;
583
584 tid = le32_get_bits(txwi[1], MT_TXD1_TID);
585diff --git a/mt7915/main.c b/mt7915/main.c
developer699cda22022-12-17 15:21:57 +0800586index c87f04b..28509d9 100644
developereb6a0182022-12-12 18:53:32 +0800587--- a/mt7915/main.c
588+++ b/mt7915/main.c
developer1346ce52022-12-15 21:36:14 +0800589@@ -523,7 +523,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
developereb6a0182022-12-12 18:53:32 +0800590
591 static int
592 mt7915_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
593- unsigned int link_id, u16 queue,
594+ u16 queue,
595 const struct ieee80211_tx_queue_params *params)
596 {
597 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
developer1346ce52022-12-15 21:36:14 +0800598@@ -618,7 +618,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw,
developereb6a0182022-12-12 18:53:32 +0800599 static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
600 struct ieee80211_vif *vif,
601 struct ieee80211_bss_conf *info,
602- u64 changed)
603+ u32 changed)
604 {
605 struct mt7915_phy *phy = mt7915_hw_phy(hw);
606 struct mt7915_dev *dev = mt7915_hw_dev(hw);
developer1346ce52022-12-15 21:36:14 +0800607@@ -638,7 +638,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
developereb6a0182022-12-12 18:53:32 +0800608 }
609
610 if (changed & BSS_CHANGED_ASSOC)
611- mt7915_mcu_add_bss_info(phy, vif, vif->cfg.assoc);
612+ mt7915_mcu_add_bss_info(phy, vif, info->assoc);
613
614 if (changed & BSS_CHANGED_ERP_CTS_PROT)
615 mt7915_mac_enable_rtscts(dev, vif, info->use_cts_prot);
developer1346ce52022-12-15 21:36:14 +0800616@@ -1223,10 +1223,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw,
developereb6a0182022-12-12 18:53:32 +0800617 {
618 struct mt7915_phy *phy = mt7915_hw_phy(hw);
619 struct mt7915_dev *dev = mt7915_hw_dev(hw);
620- s16 txpower = sta->deflink.txpwr.power;
621+ s16 txpower = sta->txpwr.power;
622 int ret;
623
624- if (sta->deflink.txpwr.type == NL80211_TX_POWER_AUTOMATIC)
625+ if (sta->txpwr.type == NL80211_TX_POWER_AUTOMATIC)
626 txpower = 0;
627
628 mutex_lock(&dev->mt76.mutex);
629diff --git a/mt7915/mcu.c b/mt7915/mcu.c
developer699cda22022-12-17 15:21:57 +0800630index 88ce44f..f2c848d 100644
developereb6a0182022-12-12 18:53:32 +0800631--- a/mt7915/mcu.c
632+++ b/mt7915/mcu.c
developerfe7be7f2022-12-13 21:40:24 +0800633@@ -64,7 +64,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
developereb6a0182022-12-12 18:53:32 +0800634 struct mt7915_dev *dev = msta->vif->phy->dev;
635 enum nl80211_band band = msta->vif->phy->mt76->chandef.chan->band;
636 const u16 *mask = msta->vif->bitrate_mask.control[band].he_mcs;
637- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
638+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
639
640 for (nss = 0; nss < max_nss; nss++) {
641 int mcs;
developerfe7be7f2022-12-13 21:40:24 +0800642@@ -104,7 +104,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
developereb6a0182022-12-12 18:53:32 +0800643
644 /* only support 2ss on 160MHz for mt7915 */
645 if (is_mt7915(&dev->mt76) && nss > 1 &&
646- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
647+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
648 break;
649 }
650
developerfe7be7f2022-12-13 21:40:24 +0800651@@ -117,8 +117,8 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
developereb6a0182022-12-12 18:53:32 +0800652 {
653 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
654 struct mt7915_dev *dev = msta->vif->phy->dev;
655- u16 mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map);
656- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
657+ u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
658+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
659 u16 mcs;
660
661 for (nss = 0; nss < max_nss; nss++, mcs_map >>= 2) {
developerfe7be7f2022-12-13 21:40:24 +0800662@@ -140,7 +140,7 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
developereb6a0182022-12-12 18:53:32 +0800663
664 /* only support 2ss on 160MHz for mt7915 */
665 if (is_mt7915(&dev->mt76) && nss > 1 &&
666- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
667+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
668 break;
669 }
670 }
developerfe7be7f2022-12-13 21:40:24 +0800671@@ -149,10 +149,10 @@ static void
developereb6a0182022-12-12 18:53:32 +0800672 mt7915_mcu_set_sta_ht_mcs(struct ieee80211_sta *sta, u8 *ht_mcs,
673 const u8 *mask)
674 {
675- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
676+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
677
678 for (nss = 0; nss < max_nss; nss++)
679- ht_mcs[nss] = sta->deflink.ht_cap.mcs.rx_mask[nss] & mask[nss];
680+ ht_mcs[nss] = sta->ht_cap.mcs.rx_mask[nss] & mask[nss];
681 }
682
683 static int
developer1346ce52022-12-15 21:36:14 +0800684@@ -231,7 +231,7 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
developereb6a0182022-12-12 18:53:32 +0800685 static void
686 mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
687 {
688- if (vif->bss_conf.csa_active)
689+ if (vif->csa_active)
690 ieee80211_csa_finish(vif);
691 }
692
developer1346ce52022-12-15 21:36:14 +0800693@@ -332,7 +332,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)
developereb6a0182022-12-12 18:53:32 +0800694 static void
695 mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
696 {
697- if (!vif->bss_conf.color_change_active)
698+ if (!vif->color_change_active)
699 return;
700
701 ieee80211_color_change_finish(vif);
developer1346ce52022-12-15 21:36:14 +0800702@@ -745,13 +745,13 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800703 struct ieee80211_vif *vif)
704 {
705 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
706- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
707+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
708 struct ieee80211_he_mcs_nss_supp mcs_map;
709 struct sta_rec_he *he;
710 struct tlv *tlv;
711 u32 cap = 0;
712
713- if (!sta->deflink.he_cap.has_he)
714+ if (!sta->he_cap.has_he)
715 return;
716
717 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE, sizeof(*he));
developer1346ce52022-12-15 21:36:14 +0800718@@ -837,8 +837,8 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800719
720 he->he_cap = cpu_to_le32(cap);
721
722- mcs_map = sta->deflink.he_cap.he_mcs_nss_supp;
723- switch (sta->deflink.bandwidth) {
724+ mcs_map = sta->he_cap.he_mcs_nss_supp;
725+ switch (sta->bandwidth) {
726 case IEEE80211_STA_RX_BW_160:
727 if (elem->phy_cap_info[0] &
728 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developer1346ce52022-12-15 21:36:14 +0800729@@ -888,7 +888,7 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800730 struct ieee80211_sta *sta, struct ieee80211_vif *vif)
731 {
732 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
733- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
734+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
735 struct sta_rec_muru *muru;
736 struct tlv *tlv;
737
developer1346ce52022-12-15 21:36:14 +0800738@@ -912,11 +912,11 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800739 muru->cfg.ofdma_dl_en = !!(dev->dbg.muru_onoff & OFDMA_DL);
740 muru->cfg.ofdma_ul_en = !!(dev->dbg.muru_onoff & OFDMA_UL);
741
742- if (sta->deflink.vht_cap.vht_supported)
743+ if (sta->vht_cap.vht_supported)
744 muru->mimo_dl.vht_mu_bfee =
745- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
746+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
747
748- if (!sta->deflink.he_cap.has_he)
749+ if (!sta->he_cap.has_he)
750 return;
751
752 muru->mimo_dl.partial_bw_dl_mimo =
developer1346ce52022-12-15 21:36:14 +0800753@@ -950,13 +950,13 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800754 struct sta_rec_ht *ht;
755 struct tlv *tlv;
756
757- if (!sta->deflink.ht_cap.ht_supported)
758+ if (!sta->ht_cap.ht_supported)
759 return;
760
761 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
762
763 ht = (struct sta_rec_ht *)tlv;
764- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
765+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
766 }
767
768 static void
developer1346ce52022-12-15 21:36:14 +0800769@@ -965,15 +965,15 @@ mt7915_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800770 struct sta_rec_vht *vht;
771 struct tlv *tlv;
772
773- if (!sta->deflink.vht_cap.vht_supported)
774+ if (!sta->vht_cap.vht_supported)
775 return;
776
777 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, sizeof(*vht));
778
779 vht = (struct sta_rec_vht *)tlv;
780- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
781- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
782- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
783+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
784+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
785+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
786 }
787
788 static void
developer1346ce52022-12-15 21:36:14 +0800789@@ -988,7 +988,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800790 vif->type != NL80211_IFTYPE_AP)
791 return;
792
793- if (!sta->deflink.agg.max_amsdu_len)
794+ if (!sta->max_amsdu_len)
795 return;
796
797 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
developer1346ce52022-12-15 21:36:14 +0800798@@ -997,7 +997,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800799 amsdu->amsdu_en = true;
800 msta->wcid.amsdu = true;
801
802- switch (sta->deflink.agg.max_amsdu_len) {
803+ switch (sta->max_amsdu_len) {
804 case IEEE80211_MAX_MPDU_LEN_VHT_11454:
805 if (!is_mt7915(&dev->mt76)) {
806 amsdu->max_mpdu_size =
developer1346ce52022-12-15 21:36:14 +0800807@@ -1060,8 +1060,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800808 if (!bfee && tx_ant < 2)
809 return false;
810
811- if (sta->deflink.he_cap.has_he) {
812- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
813+ if (sta->he_cap.has_he) {
814+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
815
816 if (bfee)
817 return mvif->cap.he_su_ebfee &&
developer1346ce52022-12-15 21:36:14 +0800818@@ -1071,8 +1071,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800819 HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
820 }
821
822- if (sta->deflink.vht_cap.vht_supported) {
823- u32 cap = sta->deflink.vht_cap.cap;
824+ if (sta->vht_cap.vht_supported) {
825+ u32 cap = sta->vht_cap.cap;
826
827 if (bfee)
828 return mvif->cap.vht_su_ebfee &&
developer1346ce52022-12-15 21:36:14 +0800829@@ -1098,7 +1098,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800830 mt7915_mcu_sta_bfer_ht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
831 struct sta_rec_bf *bf)
832 {
833- struct ieee80211_mcs_info *mcs = &sta->deflink.ht_cap.mcs;
834+ struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
835 u8 n = 0;
836
837 bf->tx_mode = MT_PHY_TYPE_HT;
developer1346ce52022-12-15 21:36:14 +0800838@@ -1123,7 +1123,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800839 mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
840 struct sta_rec_bf *bf, bool explicit)
841 {
842- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
843+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
844 struct ieee80211_sta_vht_cap *vc = &phy->mt76->sband_5g.sband.vht_cap;
845 u16 mcs_map = le16_to_cpu(pc->vht_mcs.rx_mcs_map);
846 u8 nss_mcs = mt7915_mcu_get_sta_nss(mcs_map);
developer1346ce52022-12-15 21:36:14 +0800847@@ -1144,14 +1144,14 @@ mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
developereb6a0182022-12-12 18:53:32 +0800848 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
849 bf->ibf_ncol = bf->ncol;
850
851- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
852+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
853 bf->nrow = 1;
854 } else {
855 bf->nrow = tx_ant;
856 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
857 bf->ibf_ncol = nss_mcs;
858
859- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
860+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
861 bf->ibf_nrow = 1;
862 }
863 }
developer1346ce52022-12-15 21:36:14 +0800864@@ -1160,7 +1160,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800865 mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
866 struct mt7915_phy *phy, struct sta_rec_bf *bf)
867 {
868- struct ieee80211_sta_he_cap *pc = &sta->deflink.he_cap;
869+ struct ieee80211_sta_he_cap *pc = &sta->he_cap;
870 struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem;
871 const struct ieee80211_sta_he_cap *vc =
872 mt76_connac_get_he_phy_cap(phy->mt76, vif);
developer1346ce52022-12-15 21:36:14 +0800873@@ -1185,7 +1185,7 @@ mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800874 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
875 bf->ibf_ncol = bf->ncol;
876
877- if (sta->deflink.bandwidth != IEEE80211_STA_RX_BW_160)
878+ if (sta->bandwidth != IEEE80211_STA_RX_BW_160)
879 return;
880
881 /* go over for 160MHz and 80p80 */
developer1346ce52022-12-15 21:36:14 +0800882@@ -1233,7 +1233,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800883 };
884 bool ebf;
885
886- if (!(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
887+ if (!(sta->ht_cap.ht_supported || sta->he_cap.has_he))
888 return;
889
890 ebf = mt7915_is_ebf_supported(phy, vif, sta, false);
developer1346ce52022-12-15 21:36:14 +0800891@@ -1247,21 +1247,21 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800892 * vht: support eBF and iBF
893 * ht: iBF only, since mac80211 lacks of eBF support
894 */
895- if (sta->deflink.he_cap.has_he && ebf)
896+ if (sta->he_cap.has_he && ebf)
897 mt7915_mcu_sta_bfer_he(sta, vif, phy, bf);
898- else if (sta->deflink.vht_cap.vht_supported)
899+ else if (sta->vht_cap.vht_supported)
900 mt7915_mcu_sta_bfer_vht(sta, phy, bf, ebf);
901- else if (sta->deflink.ht_cap.ht_supported)
902+ else if (sta->ht_cap.ht_supported)
903 mt7915_mcu_sta_bfer_ht(sta, phy, bf);
904 else
905 return;
906
907 bf->bf_cap = ebf ? ebf : dev->ibf << 1;
908- bf->bw = sta->deflink.bandwidth;
909- bf->ibf_dbw = sta->deflink.bandwidth;
910+ bf->bw = sta->bandwidth;
911+ bf->ibf_dbw = sta->bandwidth;
912 bf->ibf_nrow = tx_ant;
913
914- if (!ebf && sta->deflink.bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
915+ if (!ebf && sta->bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
916 bf->ibf_timeout = 0x48;
917 else
918 bf->ibf_timeout = 0x18;
developer1346ce52022-12-15 21:36:14 +0800919@@ -1271,7 +1271,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800920 else
921 bf->mem_20m = matrix[bf->nrow][bf->ncol];
922
923- switch (sta->deflink.bandwidth) {
924+ switch (sta->bandwidth) {
925 case IEEE80211_STA_RX_BW_160:
926 case IEEE80211_STA_RX_BW_80:
927 bf->mem_total = bf->mem_20m * 2;
developer1346ce52022-12-15 21:36:14 +0800928@@ -1296,7 +1296,7 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800929 struct tlv *tlv;
930 u8 nrow = 0;
931
932- if (!(sta->deflink.vht_cap.vht_supported || sta->deflink.he_cap.has_he))
933+ if (!(sta->vht_cap.vht_supported || sta->he_cap.has_he))
934 return;
935
936 if (!mt7915_is_ebf_supported(phy, vif, sta, true))
developer1346ce52022-12-15 21:36:14 +0800937@@ -1305,13 +1305,13 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800938 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_BFEE, sizeof(*bfee));
939 bfee = (struct sta_rec_bfee *)tlv;
940
941- if (sta->deflink.he_cap.has_he) {
942- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
943+ if (sta->he_cap.has_he) {
944+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
945
946 nrow = HE_PHY(CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK,
947 pe->phy_cap_info[5]);
948- } else if (sta->deflink.vht_cap.vht_supported) {
949- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
950+ } else if (sta->vht_cap.vht_supported) {
951+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
952
953 nrow = FIELD_GET(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK,
954 pc->cap);
developer1346ce52022-12-15 21:36:14 +0800955@@ -1367,7 +1367,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800956 ra->phy = *phy;
957 break;
958 case RATE_PARAM_MMPS_UPDATE:
959- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
960+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
961 break;
962 case RATE_PARAM_SPE_UPDATE:
963 ra->spe_idx = *(u8 *)data;
developer1346ce52022-12-15 21:36:14 +0800964@@ -1442,7 +1442,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800965 do { \
966 u8 i, gi = mask->control[band]._gi; \
967 gi = (_he) ? gi : gi == NL80211_TXRATE_FORCE_SGI; \
968- for (i = 0; i <= sta->deflink.bandwidth; i++) { \
969+ for (i = 0; i <= sta->bandwidth; i++) { \
970 phy.sgi |= gi << (i << (_he)); \
971 phy.he_ltf |= mask->control[band].he_ltf << (i << (_he));\
972 } \
developer1346ce52022-12-15 21:36:14 +0800973@@ -1456,11 +1456,11 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800974 } \
975 } while (0)
976
977- if (sta->deflink.he_cap.has_he) {
978+ if (sta->he_cap.has_he) {
979 __sta_phy_bitrate_mask_check(he_mcs, he_gi, 0, 1);
980- } else if (sta->deflink.vht_cap.vht_supported) {
981+ } else if (sta->vht_cap.vht_supported) {
982 __sta_phy_bitrate_mask_check(vht_mcs, gi, 0, 0);
983- } else if (sta->deflink.ht_cap.ht_supported) {
984+ } else if (sta->ht_cap.ht_supported) {
985 __sta_phy_bitrate_mask_check(ht_mcs, gi, 1, 0);
986 } else {
987 nrates = hweight32(mask->control[band].legacy);
developer1346ce52022-12-15 21:36:14 +0800988@@ -1494,7 +1494,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800989 * actual txrate hardware sends out.
990 */
991 addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 7);
992- if (sta->deflink.he_cap.has_he)
993+ if (sta->he_cap.has_he)
994 mt76_rmw_field(dev, addr, GENMASK(31, 24), phy.sgi);
995 else
996 mt76_rmw_field(dev, addr, GENMASK(15, 12), phy.sgi);
developer1346ce52022-12-15 21:36:14 +0800997@@ -1527,7 +1527,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800998 enum nl80211_band band = chandef->chan->band;
999 struct sta_rec_ra *ra;
1000 struct tlv *tlv;
1001- u32 supp_rate = sta->deflink.supp_rates[band];
1002+ u32 supp_rate = sta->supp_rates[band];
1003 u32 cap = sta->wme ? STA_CAP_WMM : 0;
1004
1005 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra));
developer1346ce52022-12-15 21:36:14 +08001006@@ -1537,9 +1537,9 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +08001007 ra->auto_rate = true;
1008 ra->phy_mode = mt76_connac_get_phy_mode(mphy, vif, band, sta);
1009 ra->channel = chandef->chan->hw_value;
1010- ra->bw = sta->deflink.bandwidth;
1011- ra->phy.bw = sta->deflink.bandwidth;
1012- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
1013+ ra->bw = sta->bandwidth;
1014+ ra->phy.bw = sta->bandwidth;
1015+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
1016
1017 if (supp_rate) {
1018 supp_rate &= mask->control[band].legacy;
developer1346ce52022-12-15 21:36:14 +08001019@@ -1559,22 +1559,22 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +08001020 }
1021 }
1022
1023- if (sta->deflink.ht_cap.ht_supported) {
1024+ if (sta->ht_cap.ht_supported) {
1025 ra->supp_mode |= MODE_HT;
1026- ra->af = sta->deflink.ht_cap.ampdu_factor;
1027- ra->ht_gf = !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
1028+ ra->af = sta->ht_cap.ampdu_factor;
1029+ ra->ht_gf = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
1030
1031 cap |= STA_CAP_HT;
1032- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
1033+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
1034 cap |= STA_CAP_SGI_20;
1035- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
1036+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
1037 cap |= STA_CAP_SGI_40;
1038- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
1039+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
1040 cap |= STA_CAP_TX_STBC;
1041- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
1042+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
1043 cap |= STA_CAP_RX_STBC;
1044 if (mvif->cap.ht_ldpc &&
1045- (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
1046+ (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
1047 cap |= STA_CAP_LDPC;
1048
1049 mt7915_mcu_set_sta_ht_mcs(sta, ra->ht_mcs,
developer1346ce52022-12-15 21:36:14 +08001050@@ -1582,37 +1582,37 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +08001051 ra->supp_ht_mcs = *(__le32 *)ra->ht_mcs;
1052 }
1053
1054- if (sta->deflink.vht_cap.vht_supported) {
1055+ if (sta->vht_cap.vht_supported) {
1056 u8 af;
1057
1058 ra->supp_mode |= MODE_VHT;
1059 af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
1060- sta->deflink.vht_cap.cap);
1061+ sta->vht_cap.cap);
1062 ra->af = max_t(u8, ra->af, af);
1063
1064 cap |= STA_CAP_VHT;
1065- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
1066+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
1067 cap |= STA_CAP_VHT_SGI_80;
1068- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
1069+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
1070 cap |= STA_CAP_VHT_SGI_160;
1071- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
1072+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
1073 cap |= STA_CAP_VHT_TX_STBC;
1074- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
1075+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
1076 cap |= STA_CAP_VHT_RX_STBC;
1077 if (mvif->cap.vht_ldpc &&
1078- (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
1079+ (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
1080 cap |= STA_CAP_VHT_LDPC;
1081
1082 mt7915_mcu_set_sta_vht_mcs(sta, ra->supp_vht_mcs,
1083 mask->control[band].vht_mcs);
1084 }
1085
1086- if (sta->deflink.he_cap.has_he) {
1087+ if (sta->he_cap.has_he) {
1088 ra->supp_mode |= MODE_HE;
1089 cap |= STA_CAP_HE;
1090
1091- if (sta->deflink.he_6ghz_capa.capa)
1092- ra->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
1093+ if (sta->he_6ghz_capa.capa)
1094+ ra->af = le16_get_bits(sta->he_6ghz_capa.capa,
1095 IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
1096 }
1097
developer1346ce52022-12-15 21:36:14 +08001098@@ -1821,7 +1821,7 @@ mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
developereb6a0182022-12-12 18:53:32 +08001099 if (!offs->cntdwn_counter_offs[0])
1100 return;
1101
1102- sub_tag = vif->bss_conf.csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
1103+ sub_tag = vif->csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
1104 tlv = mt7915_mcu_add_nested_subtlv(rskb, sub_tag, sizeof(*info),
1105 &bcn->sub_ntlv, &bcn->len);
1106 info = (struct bss_info_bcn_cntdwn *)tlv;
developer1346ce52022-12-15 21:36:14 +08001107@@ -1906,9 +1906,9 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +08001108 if (offs->cntdwn_counter_offs[0]) {
1109 u16 offset = offs->cntdwn_counter_offs[0];
1110
1111- if (vif->bss_conf.csa_active)
1112+ if (vif->csa_active)
1113 cont->csa_ofs = cpu_to_le16(offset - 4);
1114- if (vif->bss_conf.color_change_active)
1115+ if (vif->color_change_active)
1116 cont->bcc_ofs = cpu_to_le16(offset - 3);
1117 }
1118
developer1346ce52022-12-15 21:36:14 +08001119@@ -2092,7 +2092,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +08001120 if (!en)
1121 goto out;
1122
1123- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
1124+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
1125 if (!skb)
1126 return -EINVAL;
1127
developer1346ce52022-12-15 21:36:14 +08001128@@ -3308,17 +3308,17 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy,
developereb6a0182022-12-12 18:53:32 +08001129 if (txpower) {
1130 u32 offs, len, i;
1131
1132- if (sta->deflink.ht_cap.ht_supported) {
1133+ if (sta->ht_cap.ht_supported) {
1134 const u8 *sku_len = mt7915_sku_group_len;
1135
1136 offs = sku_len[SKU_CCK] + sku_len[SKU_OFDM];
1137 len = sku_len[SKU_HT_BW20] + sku_len[SKU_HT_BW40];
1138
1139- if (sta->deflink.vht_cap.vht_supported) {
1140+ if (sta->vht_cap.vht_supported) {
1141 offs += len;
1142 len = sku_len[SKU_VHT_BW20] * 4;
1143
1144- if (sta->deflink.he_cap.has_he) {
1145+ if (sta->he_cap.has_he) {
1146 offs += len + sku_len[SKU_HE_RU26] * 3;
1147 len = sku_len[SKU_HE_RU242] * 4;
1148 }
developerfe7be7f2022-12-13 21:40:24 +08001149diff --git a/mt7915/testmode.c b/mt7915/testmode.c
developer699cda22022-12-17 15:21:57 +08001150index 70382b9..5c71116 100644
developerfe7be7f2022-12-13 21:40:24 +08001151--- a/mt7915/testmode.c
1152+++ b/mt7915/testmode.c
developer1346ce52022-12-15 21:36:14 +08001153@@ -397,12 +397,12 @@ mt7915_tm_entry_add(struct mt7915_phy *phy, u8 aid)
1154 memcpy(sta->addr, td->addr[0], ETH_ALEN);
developerfe7be7f2022-12-13 21:40:24 +08001155
1156 if (td->tx_rate_mode >= MT76_TM_TX_MODE_HT)
1157- memcpy(&sta->deflink.ht_cap, &sband->ht_cap, sizeof(sta->deflink.ht_cap));
1158+ memcpy(&sta->ht_cap, &sband->ht_cap, sizeof(sta->ht_cap));
1159 if (td->tx_rate_mode >= MT76_TM_TX_MODE_VHT)
1160- memcpy(&sta->deflink.vht_cap, &sband->vht_cap, sizeof(sta->deflink.vht_cap));
1161+ memcpy(&sta->vht_cap, &sband->vht_cap, sizeof(sta->vht_cap));
1162 if (td->tx_rate_mode >= MT76_TM_TX_MODE_HE_SU)
1163- memcpy(&sta->deflink.he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap,
1164- sizeof(sta->deflink.he_cap));
1165+ memcpy(&sta->he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap,
1166+ sizeof(sta->he_cap));
1167 sta->aid = aid;
1168 sta->wme = 1;
1169
developereb6a0182022-12-12 18:53:32 +08001170diff --git a/tx.c b/tx.c
developer699cda22022-12-17 15:21:57 +08001171index a72b777..04b6f2e 100644
developereb6a0182022-12-12 18:53:32 +08001172--- a/tx.c
1173+++ b/tx.c
1174@@ -60,20 +60,15 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
1175 .skb = skb,
1176 .info = IEEE80211_SKB_CB(skb),
1177 };
1178- struct ieee80211_rate_status rs = {};
1179 struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
1180 struct mt76_wcid *wcid;
1181
1182 wcid = rcu_dereference(dev->wcid[cb->wcid]);
1183 if (wcid) {
1184 status.sta = wcid_to_sta(wcid);
1185- if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
1186- rs.rate_idx = wcid->rate;
1187- status.rates = &rs;
1188- status.n_rates = 1;
1189- } else {
1190- status.n_rates = 0;
1191- }
1192+
1193+ if (status.sta)
1194+ status.rate = &wcid->rate;
1195 }
1196
1197 hw = mt76_tx_status_get_hw(dev, skb);
1198--
developer699cda22022-12-17 15:21:57 +080011992.36.1
developereb6a0182022-12-12 18:53:32 +08001200