blob: 0a0ede22bc5001d4174bf4739ec6667f8e0d9628 [file] [log] [blame]
developer4be8f972022-12-13 16:02:25 +08001From a4a4b918aa6c2895840226fc4816c265c6461131 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
4Subject: [PATCH 4002/4002] mt76: revert for backports-5.15 wireless stack
developereb6a0182022-12-12 18:53:32 +08005
6Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
developereb6a0182022-12-12 18:53:32 +08007
8diff --git a/debugfs.c b/debugfs.c
developer4be8f972022-12-13 16:02:25 +08009index 79064a4..4a8e186 100644
developereb6a0182022-12-12 18:53:32 +080010--- a/debugfs.c
11+++ b/debugfs.c
12@@ -33,8 +33,10 @@ mt76_napi_threaded_set(void *data, u64 val)
13 if (!mt76_is_mmio(dev))
14 return -EOPNOTSUPP;
15
16+#if 0 /* disable in backport 5.15 */
17 if (dev->napi_dev.threaded != val)
18 return dev_set_threaded(&dev->napi_dev, val);
19+#endif
20
21 return 0;
22 }
23diff --git a/dma.c b/dma.c
developer4be8f972022-12-13 16:02:25 +080024index 0914266..21e88a2 100644
developereb6a0182022-12-12 18:53:32 +080025--- a/dma.c
26+++ b/dma.c
27@@ -939,7 +939,7 @@ mt76_dma_init(struct mt76_dev *dev,
28 dev->napi_dev.threaded = 1;
29
30 mt76_for_each_q_rx(dev, i) {
31- netif_napi_add(&dev->napi_dev, &dev->napi[i], poll);
32+ netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64);
33 mt76_dma_rx_fill(dev, &dev->q_rx[i]);
34 napi_enable(&dev->napi[i]);
35 }
developer4be8f972022-12-13 16:02:25 +080036diff --git a/eeprom.c b/eeprom.c
37index aac70ef..bb9265c 100644
38--- a/eeprom.c
39+++ b/eeprom.c
40@@ -126,9 +126,15 @@ void
41 mt76_eeprom_override(struct mt76_phy *phy)
42 {
43 struct mt76_dev *dev = phy->dev;
44+#ifdef CONFIG_OF
45 struct device_node *np = dev->dev->of_node;
46+ const u8 *mac = NULL;
47
48- of_get_mac_address(np, phy->macaddr);
49+ if (np)
50+ mac = of_get_mac_address(np);
51+ if (!IS_ERR_OR_NULL(mac))
52+ ether_addr_copy(phy->macaddr, mac);
53+#endif
54
55 if (!is_valid_ether_addr(phy->macaddr)) {
56 eth_random_addr(phy->macaddr);
developereb6a0182022-12-12 18:53:32 +080057diff --git a/mac80211.c b/mac80211.c
developer4be8f972022-12-13 16:02:25 +080058index 15d300a..be4a140 100644
developereb6a0182022-12-12 18:53:32 +080059--- a/mac80211.c
60+++ b/mac80211.c
61@@ -1511,7 +1511,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power);
62 static void
63 __mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
64 {
65- if (vif->bss_conf.csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
66+ if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif))
67 ieee80211_csa_finish(vif);
68 }
69
70@@ -1533,7 +1533,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif)
71 {
72 struct mt76_dev *dev = priv;
73
74- if (!vif->bss_conf.csa_active)
75+ if (!vif->csa_active)
76 return;
77
78 dev->csa_complete |= ieee80211_beacon_cntdwn_is_complete(vif);
79diff --git a/mt7615/main.c b/mt7615/main.c
developer4be8f972022-12-13 16:02:25 +080080index ab4c1b4..8fb5b25 100644
developereb6a0182022-12-12 18:53:32 +080081--- a/mt7615/main.c
82+++ b/mt7615/main.c
83@@ -474,7 +474,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed)
84
85 static int
86 mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
87- unsigned int link_id, u16 queue,
88+ u16 queue,
89 const struct ieee80211_tx_queue_params *params)
90 {
91 struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
92@@ -556,7 +556,7 @@ static void mt7615_configure_filter(struct ieee80211_hw *hw,
93 static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
94 struct ieee80211_vif *vif,
95 struct ieee80211_bss_conf *info,
96- u64 changed)
97+ u32 changed)
98 {
99 struct mt7615_dev *dev = mt7615_hw_dev(hw);
100 struct mt7615_phy *phy = mt7615_hw_phy(hw);
101@@ -599,7 +599,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw,
102 }
103
104 if (changed & BSS_CHANGED_ASSOC)
105- mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc);
106+ mt7615_mac_set_beacon_filter(phy, vif, info->assoc);
107
108 mt7615_mutex_release(dev);
109 }
110diff --git a/mt7615/mcu.c b/mt7615/mcu.c
developer4be8f972022-12-13 16:02:25 +0800111index 83f3030..81579a1 100644
developereb6a0182022-12-12 18:53:32 +0800112--- a/mt7615/mcu.c
113+++ b/mt7615/mcu.c
developer4be8f972022-12-13 16:02:25 +0800114@@ -352,7 +352,7 @@ out:
developereb6a0182022-12-12 18:53:32 +0800115 static void
116 mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
117 {
118- if (vif->bss_conf.csa_active)
119+ if (vif->csa_active)
120 ieee80211_csa_finish(vif);
121 }
122
developer4be8f972022-12-13 16:02:25 +0800123@@ -698,7 +698,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800124 if (!enable)
125 goto out;
126
127- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
128+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
129 if (!skb)
130 return -EINVAL;
131
developer4be8f972022-12-13 16:02:25 +0800132@@ -1073,7 +1073,7 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800133 if (!enable)
134 goto out;
135
136- skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs, 0);
137+ skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs);
138 if (!skb)
139 return -EINVAL;
140
developer4be8f972022-12-13 16:02:25 +0800141@@ -2525,7 +2525,7 @@ int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800142 u8 pad;
143 } req = {
144 .bss_idx = mvif->mt76.idx,
145- .aid = cpu_to_le16(vif->cfg.aid),
146+ .aid = cpu_to_le16(vif->bss_conf.aid),
147 .dtim_period = vif->bss_conf.dtim_period,
148 .bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int),
149 };
150diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
developer4be8f972022-12-13 16:02:25 +0800151index 291a7c1..d5254f9 100644
developereb6a0182022-12-12 18:53:32 +0800152--- a/mt76_connac_mcu.c
153+++ b/mt76_connac_mcu.c
developer4be8f972022-12-13 16:02:25 +0800154@@ -196,7 +196,7 @@ int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif)
developereb6a0182022-12-12 18:53:32 +0800155 */
156 } req = {
157 .bss_idx = mvif->idx,
158- .ps_state = vif->cfg.ps ? 2 : 0,
159+ .ps_state = vif->bss_conf.ps ? 2 : 0,
160 };
161
162 if (vif->type != NL80211_IFTYPE_STATION)
developer4be8f972022-12-13 16:02:25 +0800163@@ -408,7 +408,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800164 else
165 conn_type = CONNECTION_INFRA_AP;
166 basic->conn_type = cpu_to_le32(conn_type);
167- basic->aid = cpu_to_le16(vif->cfg.aid);
168+ basic->aid = cpu_to_le16(vif->bss_conf.aid);
169 break;
170 case NL80211_IFTYPE_ADHOC:
171 basic->conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC);
developer4be8f972022-12-13 16:02:25 +0800172@@ -552,7 +552,7 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800173
174 if (sta) {
175 if (vif->type == NL80211_IFTYPE_STATION)
176- generic->partial_aid = cpu_to_le16(vif->cfg.aid);
177+ generic->partial_aid = cpu_to_le16(vif->bss_conf.aid);
178 else
179 generic->partial_aid = cpu_to_le16(sta->aid);
180 memcpy(generic->peer_addr, sta->addr, ETH_ALEN);
developer4be8f972022-12-13 16:02:25 +0800181@@ -601,14 +601,14 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800182 vif->type != NL80211_IFTYPE_STATION)
183 return;
184
185- if (!sta->deflink.agg.max_amsdu_len)
186+ if (!sta->max_amsdu_len)
187 return;
188
189 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
190 amsdu = (struct sta_rec_amsdu *)tlv;
191 amsdu->max_amsdu_num = 8;
192 amsdu->amsdu_en = true;
193- amsdu->max_mpdu_size = sta->deflink.agg.max_amsdu_len >=
194+ amsdu->max_mpdu_size = sta->max_amsdu_len >=
195 IEEE80211_MAX_MPDU_LEN_VHT_7991;
196
197 wcid->amsdu = true;
developer4be8f972022-12-13 16:02:25 +0800198@@ -619,7 +619,7 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800199 static void
200 mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
201 {
202- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
203+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
204 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
205 struct sta_rec_he *he;
206 struct tlv *tlv;
developer4be8f972022-12-13 16:02:25 +0800207@@ -707,7 +707,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800208
209 he->he_cap = cpu_to_le32(cap);
210
211- switch (sta->deflink.bandwidth) {
212+ switch (sta->bandwidth) {
213 case IEEE80211_STA_RX_BW_160:
214 if (elem->phy_cap_info[0] &
215 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developer4be8f972022-12-13 16:02:25 +0800216@@ -752,7 +752,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800217 static void
218 mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
219 {
220- struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
221+ struct ieee80211_sta_he_cap *he_cap = &sta->he_cap;
222 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
223 struct sta_rec_he_v2 *he;
224 struct tlv *tlv;
developer4be8f972022-12-13 16:02:25 +0800225@@ -763,7 +763,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800226 memcpy(he->he_phy_cap, elem->phy_cap_info, sizeof(he->he_phy_cap));
227 memcpy(he->he_mac_cap, elem->mac_cap_info, sizeof(he->he_mac_cap));
228
229- switch (sta->deflink.bandwidth) {
230+ switch (sta->bandwidth) {
231 case IEEE80211_STA_RX_BW_160:
232 if (elem->phy_cap_info[0] &
233 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developer4be8f972022-12-13 16:02:25 +0800234@@ -779,7 +779,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800235 break;
236 }
237
238- he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US;
239+ he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
240 }
241
242 static u8
developer4be8f972022-12-13 16:02:25 +0800243@@ -792,9 +792,9 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800244 u8 mode = 0;
245
246 if (sta) {
247- ht_cap = &sta->deflink.ht_cap;
248- vht_cap = &sta->deflink.vht_cap;
249- he_cap = &sta->deflink.he_cap;
250+ ht_cap = &sta->ht_cap;
251+ vht_cap = &sta->vht_cap;
252+ he_cap = &sta->he_cap;
253 } else {
254 struct ieee80211_supported_band *sband;
255
developer4be8f972022-12-13 16:02:25 +0800256@@ -843,25 +843,25 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800257 u16 supp_rates;
258
259 /* starec ht */
260- if (sta->deflink.ht_cap.ht_supported) {
261+ if (sta->ht_cap.ht_supported) {
262 struct sta_rec_ht *ht;
263
264 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
265 ht = (struct sta_rec_ht *)tlv;
266- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
267+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
268 }
269
270 /* starec vht */
271- if (sta->deflink.vht_cap.vht_supported) {
272+ if (sta->vht_cap.vht_supported) {
273 struct sta_rec_vht *vht;
274 int len;
275
276 len = is_mt7921(dev) ? sizeof(*vht) : sizeof(*vht) - 4;
277 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, len);
278 vht = (struct sta_rec_vht *)tlv;
279- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
280- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
281- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
282+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
283+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
284+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
285 }
286
287 /* starec uapsd */
developer4be8f972022-12-13 16:02:25 +0800288@@ -870,11 +870,11 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800289 if (!is_mt7921(dev))
290 return;
291
292- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)
293+ if (sta->ht_cap.ht_supported || sta->he_cap.has_he)
294 mt76_connac_mcu_sta_amsdu_tlv(skb, sta, vif);
295
296 /* starec he */
297- if (sta->deflink.he_cap.has_he) {
298+ if (sta->he_cap.has_he) {
299 mt76_connac_mcu_sta_he_tlv(skb, sta);
300 mt76_connac_mcu_sta_he_tlv_v2(skb, sta);
301 if (band == NL80211_BAND_6GHZ &&
developer4be8f972022-12-13 16:02:25 +0800302@@ -884,7 +884,7 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800303 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE_6G,
304 sizeof(*he_6g_capa));
305 he_6g_capa = (struct sta_rec_he_6g_capa *)tlv;
306- he_6g_capa->capa = sta->deflink.he_6ghz_capa.capa;
307+ he_6g_capa->capa = sta->he_6ghz_capa.capa;
308 }
309 }
310
developer4be8f972022-12-13 16:02:25 +0800311@@ -894,14 +894,14 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800312 phy->basic_rate = cpu_to_le16((u16)vif->bss_conf.basic_rates);
313 phy->rcpi = rcpi;
314 phy->ampdu = FIELD_PREP(IEEE80211_HT_AMPDU_PARM_FACTOR,
315- sta->deflink.ht_cap.ampdu_factor) |
316+ sta->ht_cap.ampdu_factor) |
317 FIELD_PREP(IEEE80211_HT_AMPDU_PARM_DENSITY,
318- sta->deflink.ht_cap.ampdu_density);
319+ sta->ht_cap.ampdu_density);
320
321 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra_info));
322 ra_info = (struct sta_rec_ra_info *)tlv;
323
324- supp_rates = sta->deflink.supp_rates[band];
325+ supp_rates = sta->supp_rates[band];
326 if (band == NL80211_BAND_2GHZ)
327 supp_rates = FIELD_PREP(RA_LEGACY_OFDM, supp_rates >> 4) |
328 FIELD_PREP(RA_LEGACY_CCK, supp_rates & 0xf);
developer4be8f972022-12-13 16:02:25 +0800329@@ -910,18 +910,18 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800330
331 ra_info->legacy = cpu_to_le16(supp_rates);
332
333- if (sta->deflink.ht_cap.ht_supported)
334+ if (sta->ht_cap.ht_supported)
335 memcpy(ra_info->rx_mcs_bitmask,
336- sta->deflink.ht_cap.mcs.rx_mask,
337+ sta->ht_cap.mcs.rx_mask,
338 HT_MCS_MASK_NUM);
339
340 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_STATE, sizeof(*state));
341 state = (struct sta_rec_state *)tlv;
342 state->state = sta_state;
343
344- if (sta->deflink.vht_cap.vht_supported) {
345- state->vht_opmode = sta->deflink.bandwidth;
346- state->vht_opmode |= (sta->deflink.rx_nss - 1) <<
347+ if (sta->vht_cap.vht_supported) {
348+ state->vht_opmode = sta->bandwidth;
349+ state->vht_opmode |= (sta->rx_nss - 1) <<
350 IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
351 }
352 }
developer4be8f972022-12-13 16:02:25 +0800353@@ -937,7 +937,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800354 tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_SMPS, sizeof(*smps),
355 wtbl_tlv, sta_wtbl);
356 smps = (struct wtbl_smps *)tlv;
357- smps->smps = (sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC);
358+ smps->smps = (sta->smps_mode == IEEE80211_SMPS_DYNAMIC);
359 }
360 EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_smps_tlv);
361
developer4be8f972022-12-13 16:02:25 +0800362@@ -949,27 +949,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800363 struct tlv *tlv;
364 u32 flags = 0;
365
366- if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_6ghz_capa.capa) {
367+ if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) {
368 tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht),
369 wtbl_tlv, sta_wtbl);
370 ht = (struct wtbl_ht *)tlv;
371 ht->ldpc = ht_ldpc &&
372- !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
373+ !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING);
374
375- if (sta->deflink.ht_cap.ht_supported) {
376- ht->af = sta->deflink.ht_cap.ampdu_factor;
377- ht->mm = sta->deflink.ht_cap.ampdu_density;
378+ if (sta->ht_cap.ht_supported) {
379+ ht->af = sta->ht_cap.ampdu_factor;
380+ ht->mm = sta->ht_cap.ampdu_density;
381 } else {
382- ht->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
383+ ht->af = le16_get_bits(sta->he_6ghz_capa.capa,
384 IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
385- ht->mm = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
386+ ht->mm = le16_get_bits(sta->he_6ghz_capa.capa,
387 IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START);
388 }
389
390 ht->ht = true;
391 }
392
393- if (sta->deflink.vht_cap.vht_supported || sta->deflink.he_6ghz_capa.capa) {
394+ if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) {
395 struct wtbl_vht *vht;
396 u8 af;
397
developer4be8f972022-12-13 16:02:25 +0800398@@ -978,18 +978,18 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800399 sta_wtbl);
400 vht = (struct wtbl_vht *)tlv;
401 vht->ldpc = vht_ldpc &&
402- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
403+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC);
404 vht->vht = true;
405
406 af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
407- sta->deflink.vht_cap.cap);
408+ sta->vht_cap.cap);
409 if (ht)
410 ht->af = max(ht->af, af);
411 }
412
413 mt76_connac_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_tlv);
414
415- if (is_connac_v1(dev) && sta->deflink.ht_cap.ht_supported) {
416+ if (is_connac_v1(dev) && sta->ht_cap.ht_supported) {
417 /* sgi */
418 u32 msk = MT_WTBL_W5_SHORT_GI_20 | MT_WTBL_W5_SHORT_GI_40 |
419 MT_WTBL_W5_SHORT_GI_80 | MT_WTBL_W5_SHORT_GI_160;
developer4be8f972022-12-13 16:02:25 +0800420@@ -999,15 +999,15 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800421 sizeof(*raw), wtbl_tlv,
422 sta_wtbl);
423
424- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
425+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
426 flags |= MT_WTBL_W5_SHORT_GI_20;
427- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
428+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
429 flags |= MT_WTBL_W5_SHORT_GI_40;
430
431- if (sta->deflink.vht_cap.vht_supported) {
432- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
433+ if (sta->vht_cap.vht_supported) {
434+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
435 flags |= MT_WTBL_W5_SHORT_GI_80;
436- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
437+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
438 flags |= MT_WTBL_W5_SHORT_GI_160;
439 }
440 raw = (struct wtbl_raw *)tlv;
developer4be8f972022-12-13 16:02:25 +0800441@@ -1293,9 +1293,9 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800442 return 0x38;
443
444 if (sta) {
445- ht_cap = &sta->deflink.ht_cap;
446- vht_cap = &sta->deflink.vht_cap;
447- he_cap = &sta->deflink.he_cap;
448+ ht_cap = &sta->ht_cap;
449+ vht_cap = &sta->vht_cap;
450+ he_cap = &sta->he_cap;
451 } else {
452 struct ieee80211_supported_band *sband;
453
developer4be8f972022-12-13 16:02:25 +0800454@@ -1615,7 +1615,6 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800455 for (i = 0; i < sreq->n_ssids; i++) {
456 if (!sreq->ssids[i].ssid_len)
457 continue;
458-
459 req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len);
460 memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid,
461 sreq->ssids[i].ssid_len);
developer4be8f972022-12-13 16:02:25 +0800462@@ -1748,7 +1747,6 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy,
developereb6a0182022-12-12 18:53:32 +0800463 memcpy(req->ssids[i].ssid, ssid->ssid, ssid->ssid_len);
464 req->ssids[i].ssid_len = cpu_to_le32(ssid->ssid_len);
465 }
466-
467 req->match_num = sreq->n_match_sets;
468 for (i = 0; i < req->match_num; i++) {
469 match = &sreq->match_sets[i];
developer4be8f972022-12-13 16:02:25 +0800470@@ -2235,10 +2233,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800471 struct mt76_vif *vif,
472 struct ieee80211_bss_conf *info)
473 {
474- struct ieee80211_vif *mvif = container_of(info, struct ieee80211_vif,
475- bss_conf);
476 struct sk_buff *skb;
477- int i, len = min_t(int, mvif->cfg.arp_addr_cnt,
478+ int i, len = min_t(int, info->arp_addr_cnt,
479 IEEE80211_BSS_ARP_ADDR_LIST_LEN);
480 struct {
481 struct {
developer4be8f972022-12-13 16:02:25 +0800482@@ -2266,7 +2262,7 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800483
484 skb_put_data(skb, &req_hdr, sizeof(req_hdr));
485 for (i = 0; i < len; i++)
486- skb_put_data(skb, &mvif->cfg.arp_addr_list[i], sizeof(__be32));
487+ skb_put_data(skb, &info->arp_addr_list[i], sizeof(__be32));
488
489 return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true);
490 }
491diff --git a/mt76x02_mac.c b/mt76x02_mac.c
developer4be8f972022-12-13 16:02:25 +0800492index d3f7447..87ea3db 100644
developereb6a0182022-12-12 18:53:32 +0800493--- a/mt76x02_mac.c
494+++ b/mt76x02_mac.c
495@@ -404,7 +404,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
496 txwi->rate |= cpu_to_le16(MT_RXWI_RATE_LDPC);
497 if ((info->flags & IEEE80211_TX_CTL_STBC) && nss == 1)
498 txwi->rate |= cpu_to_le16(MT_RXWI_RATE_STBC);
499- if (nss > 1 && sta && sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC)
500+ if (nss > 1 && sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC)
501 txwi_flags |= MT_TXWI_FLAGS_MMPS;
502 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
503 txwi->ack_ctl |= MT_TXWI_ACK_CTL_REQ;
504@@ -412,9 +412,9 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
505 txwi->ack_ctl |= MT_TXWI_ACK_CTL_NSEQ;
506 if ((info->flags & IEEE80211_TX_CTL_AMPDU) && sta) {
507 u8 ba_size = IEEE80211_MIN_AMPDU_BUF;
508- u8 ampdu_density = sta->deflink.ht_cap.ampdu_density;
509+ u8 ampdu_density = sta->ht_cap.ampdu_density;
510
511- ba_size <<= sta->deflink.ht_cap.ampdu_factor;
512+ ba_size <<= sta->ht_cap.ampdu_factor;
513 ba_size = min_t(int, 63, ba_size - 1);
514 if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
515 ba_size = 0;
516diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
developer4be8f972022-12-13 16:02:25 +0800517index f3b039f..47c9dfd 100644
developereb6a0182022-12-12 18:53:32 +0800518--- a/mt7915/debugfs.c
519+++ b/mt7915/debugfs.c
520@@ -1840,8 +1840,8 @@ static ssize_t mt7915_sta_fixed_rate_set(struct file *file,
521
522 phy.ldpc = (phy.bw || phy.ldpc) * GENMASK(2, 0);
523 for (i = 0; i <= phy.bw; i++) {
524- phy.sgi |= gi << (i << sta->deflink.he_cap.has_he);
525- phy.he_ltf |= he_ltf << (i << sta->deflink.he_cap.has_he);
526+ phy.sgi |= gi << (i << sta->he_cap.has_he);
527+ phy.he_ltf |= he_ltf << (i << sta->he_cap.has_he);
528 }
529 field = RATE_PARAM_FIXED;
530
531diff --git a/mt7915/dma.c b/mt7915/dma.c
developer4be8f972022-12-13 16:02:25 +0800532index 50b7ed5..1dde068 100644
developereb6a0182022-12-12 18:53:32 +0800533--- a/mt7915/dma.c
534+++ b/mt7915/dma.c
developer4be8f972022-12-13 16:02:25 +0800535@@ -554,8 +554,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
developereb6a0182022-12-12 18:53:32 +0800536 if (ret < 0)
537 return ret;
538
539- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
540- mt7915_poll_tx);
541+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
542+ mt7915_poll_tx, NAPI_POLL_WEIGHT);
543 napi_enable(&dev->mt76.tx_napi);
544
545 mt7915_dma_enable(dev);
546diff --git a/mt7915/init.c b/mt7915/init.c
developer4be8f972022-12-13 16:02:25 +0800547index c347509..e643c0e 100755
developereb6a0182022-12-12 18:53:32 +0800548--- a/mt7915/init.c
549+++ b/mt7915/init.c
550@@ -1148,8 +1148,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
551 mt7915_gen_ppe_thresh(he_cap->ppe_thres, nss);
552 } else {
553 he_cap_elem->phy_cap_info[9] |=
554- u8_encode_bits(IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US,
555- IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK);
556+ IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US;
557 }
558
559 if (band == NL80211_BAND_6GHZ) {
560diff --git a/mt7915/mac.c b/mt7915/mac.c
developer4be8f972022-12-13 16:02:25 +0800561index d5df73d..3bbe757 100644
developereb6a0182022-12-12 18:53:32 +0800562--- a/mt7915/mac.c
563+++ b/mt7915/mac.c
564@@ -913,7 +913,7 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
565 u16 fc, tid;
566 u32 val;
567
568- if (!sta || !(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
569+ if (!sta || !(sta->ht_cap.ht_supported || sta->he_cap.has_he))
570 return;
571
572 tid = le32_get_bits(txwi[1], MT_TXD1_TID);
573diff --git a/mt7915/main.c b/mt7915/main.c
developer4be8f972022-12-13 16:02:25 +0800574index dcf1583..5d678df 100644
developereb6a0182022-12-12 18:53:32 +0800575--- a/mt7915/main.c
576+++ b/mt7915/main.c
577@@ -503,7 +503,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
578
579 static int
580 mt7915_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
581- unsigned int link_id, u16 queue,
582+ u16 queue,
583 const struct ieee80211_tx_queue_params *params)
584 {
585 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
586@@ -598,7 +598,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw,
587 static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
588 struct ieee80211_vif *vif,
589 struct ieee80211_bss_conf *info,
590- u64 changed)
591+ u32 changed)
592 {
593 struct mt7915_phy *phy = mt7915_hw_phy(hw);
594 struct mt7915_dev *dev = mt7915_hw_dev(hw);
595@@ -618,7 +618,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
596 }
597
598 if (changed & BSS_CHANGED_ASSOC)
599- mt7915_mcu_add_bss_info(phy, vif, vif->cfg.assoc);
600+ mt7915_mcu_add_bss_info(phy, vif, info->assoc);
601
602 if (changed & BSS_CHANGED_ERP_CTS_PROT)
603 mt7915_mac_enable_rtscts(dev, vif, info->use_cts_prot);
604@@ -1226,10 +1226,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw,
605 {
606 struct mt7915_phy *phy = mt7915_hw_phy(hw);
607 struct mt7915_dev *dev = mt7915_hw_dev(hw);
608- s16 txpower = sta->deflink.txpwr.power;
609+ s16 txpower = sta->txpwr.power;
610 int ret;
611
612- if (sta->deflink.txpwr.type == NL80211_TX_POWER_AUTOMATIC)
613+ if (sta->txpwr.type == NL80211_TX_POWER_AUTOMATIC)
614 txpower = 0;
615
616 mutex_lock(&dev->mt76.mutex);
617diff --git a/mt7915/mcu.c b/mt7915/mcu.c
developer4be8f972022-12-13 16:02:25 +0800618index 737a714..5bd1881 100644
developereb6a0182022-12-12 18:53:32 +0800619--- a/mt7915/mcu.c
620+++ b/mt7915/mcu.c
developer4be8f972022-12-13 16:02:25 +0800621@@ -63,7 +63,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
developereb6a0182022-12-12 18:53:32 +0800622 struct mt7915_dev *dev = msta->vif->phy->dev;
623 enum nl80211_band band = msta->vif->phy->mt76->chandef.chan->band;
624 const u16 *mask = msta->vif->bitrate_mask.control[band].he_mcs;
625- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
626+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
627
628 for (nss = 0; nss < max_nss; nss++) {
629 int mcs;
developer4be8f972022-12-13 16:02:25 +0800630@@ -103,7 +103,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs,
developereb6a0182022-12-12 18:53:32 +0800631
632 /* only support 2ss on 160MHz for mt7915 */
633 if (is_mt7915(&dev->mt76) && nss > 1 &&
634- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
635+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
636 break;
637 }
638
developer4be8f972022-12-13 16:02:25 +0800639@@ -116,8 +116,8 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
developereb6a0182022-12-12 18:53:32 +0800640 {
641 struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
642 struct mt7915_dev *dev = msta->vif->phy->dev;
643- u16 mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map);
644- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
645+ u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
646+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
647 u16 mcs;
648
649 for (nss = 0; nss < max_nss; nss++, mcs_map >>= 2) {
developer4be8f972022-12-13 16:02:25 +0800650@@ -139,7 +139,7 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs,
developereb6a0182022-12-12 18:53:32 +0800651
652 /* only support 2ss on 160MHz for mt7915 */
653 if (is_mt7915(&dev->mt76) && nss > 1 &&
654- sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
655+ sta->bandwidth == IEEE80211_STA_RX_BW_160)
656 break;
657 }
658 }
developer4be8f972022-12-13 16:02:25 +0800659@@ -148,10 +148,10 @@ static void
developereb6a0182022-12-12 18:53:32 +0800660 mt7915_mcu_set_sta_ht_mcs(struct ieee80211_sta *sta, u8 *ht_mcs,
661 const u8 *mask)
662 {
663- int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss;
664+ int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss;
665
666 for (nss = 0; nss < max_nss; nss++)
667- ht_mcs[nss] = sta->deflink.ht_cap.mcs.rx_mask[nss] & mask[nss];
668+ ht_mcs[nss] = sta->ht_cap.mcs.rx_mask[nss] & mask[nss];
669 }
670
671 static int
developer4be8f972022-12-13 16:02:25 +0800672@@ -229,7 +229,7 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
developereb6a0182022-12-12 18:53:32 +0800673 static void
674 mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
675 {
676- if (vif->bss_conf.csa_active)
677+ if (vif->csa_active)
678 ieee80211_csa_finish(vif);
679 }
680
developer4be8f972022-12-13 16:02:25 +0800681@@ -330,7 +330,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)
developereb6a0182022-12-12 18:53:32 +0800682 static void
683 mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
684 {
685- if (!vif->bss_conf.color_change_active)
686+ if (!vif->color_change_active)
687 return;
688
689 ieee80211_color_change_finish(vif);
developer4be8f972022-12-13 16:02:25 +0800690@@ -730,13 +730,13 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800691 struct ieee80211_vif *vif)
692 {
693 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
694- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
695+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
696 struct ieee80211_he_mcs_nss_supp mcs_map;
697 struct sta_rec_he *he;
698 struct tlv *tlv;
699 u32 cap = 0;
700
701- if (!sta->deflink.he_cap.has_he)
702+ if (!sta->he_cap.has_he)
703 return;
704
705 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE, sizeof(*he));
developer4be8f972022-12-13 16:02:25 +0800706@@ -822,8 +822,8 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
developereb6a0182022-12-12 18:53:32 +0800707
708 he->he_cap = cpu_to_le32(cap);
709
710- mcs_map = sta->deflink.he_cap.he_mcs_nss_supp;
711- switch (sta->deflink.bandwidth) {
712+ mcs_map = sta->he_cap.he_mcs_nss_supp;
713+ switch (sta->bandwidth) {
714 case IEEE80211_STA_RX_BW_160:
715 if (elem->phy_cap_info[0] &
716 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
developer4be8f972022-12-13 16:02:25 +0800717@@ -873,7 +873,7 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800718 struct ieee80211_sta *sta, struct ieee80211_vif *vif)
719 {
720 struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
721- struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem;
722+ struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem;
723 struct sta_rec_muru *muru;
724 struct tlv *tlv;
725
developer4be8f972022-12-13 16:02:25 +0800726@@ -897,11 +897,11 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800727 muru->cfg.ofdma_dl_en = !!(dev->dbg.muru_onoff & OFDMA_DL);
728 muru->cfg.ofdma_ul_en = !!(dev->dbg.muru_onoff & OFDMA_UL);
729
730- if (sta->deflink.vht_cap.vht_supported)
731+ if (sta->vht_cap.vht_supported)
732 muru->mimo_dl.vht_mu_bfee =
733- !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
734+ !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
735
736- if (!sta->deflink.he_cap.has_he)
737+ if (!sta->he_cap.has_he)
738 return;
739
740 muru->mimo_dl.partial_bw_dl_mimo =
developer4be8f972022-12-13 16:02:25 +0800741@@ -935,13 +935,13 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800742 struct sta_rec_ht *ht;
743 struct tlv *tlv;
744
745- if (!sta->deflink.ht_cap.ht_supported)
746+ if (!sta->ht_cap.ht_supported)
747 return;
748
749 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht));
750
751 ht = (struct sta_rec_ht *)tlv;
752- ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap);
753+ ht->ht_cap = cpu_to_le16(sta->ht_cap.cap);
754 }
755
756 static void
developer4be8f972022-12-13 16:02:25 +0800757@@ -950,15 +950,15 @@ mt7915_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)
developereb6a0182022-12-12 18:53:32 +0800758 struct sta_rec_vht *vht;
759 struct tlv *tlv;
760
761- if (!sta->deflink.vht_cap.vht_supported)
762+ if (!sta->vht_cap.vht_supported)
763 return;
764
765 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, sizeof(*vht));
766
767 vht = (struct sta_rec_vht *)tlv;
768- vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap);
769- vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map;
770- vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map;
771+ vht->vht_cap = cpu_to_le32(sta->vht_cap.cap);
772+ vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map;
773+ vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map;
774 }
775
776 static void
developer4be8f972022-12-13 16:02:25 +0800777@@ -973,7 +973,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800778 vif->type != NL80211_IFTYPE_AP)
779 return;
780
781- if (!sta->deflink.agg.max_amsdu_len)
782+ if (!sta->max_amsdu_len)
783 return;
784
785 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu));
developer4be8f972022-12-13 16:02:25 +0800786@@ -982,7 +982,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800787 amsdu->amsdu_en = true;
788 msta->wcid.amsdu = true;
789
790- switch (sta->deflink.agg.max_amsdu_len) {
791+ switch (sta->max_amsdu_len) {
792 case IEEE80211_MAX_MPDU_LEN_VHT_11454:
793 if (!is_mt7915(&dev->mt76)) {
794 amsdu->max_mpdu_size =
developer4be8f972022-12-13 16:02:25 +0800795@@ -1045,8 +1045,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800796 if (!bfee && tx_ant < 2)
797 return false;
798
799- if (sta->deflink.he_cap.has_he) {
800- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
801+ if (sta->he_cap.has_he) {
802+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
803
804 if (bfee)
805 return mvif->cap.he_su_ebfee &&
developer4be8f972022-12-13 16:02:25 +0800806@@ -1056,8 +1056,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800807 HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]);
808 }
809
810- if (sta->deflink.vht_cap.vht_supported) {
811- u32 cap = sta->deflink.vht_cap.cap;
812+ if (sta->vht_cap.vht_supported) {
813+ u32 cap = sta->vht_cap.cap;
814
815 if (bfee)
816 return mvif->cap.vht_su_ebfee &&
developer4be8f972022-12-13 16:02:25 +0800817@@ -1083,7 +1083,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800818 mt7915_mcu_sta_bfer_ht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
819 struct sta_rec_bf *bf)
820 {
821- struct ieee80211_mcs_info *mcs = &sta->deflink.ht_cap.mcs;
822+ struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs;
823 u8 n = 0;
824
825 bf->tx_mode = MT_PHY_TYPE_HT;
developer4be8f972022-12-13 16:02:25 +0800826@@ -1108,7 +1108,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800827 mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
828 struct sta_rec_bf *bf, bool explicit)
829 {
830- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
831+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
832 struct ieee80211_sta_vht_cap *vc = &phy->mt76->sband_5g.sband.vht_cap;
833 u16 mcs_map = le16_to_cpu(pc->vht_mcs.rx_mcs_map);
834 u8 nss_mcs = mt7915_mcu_get_sta_nss(mcs_map);
developer4be8f972022-12-13 16:02:25 +0800835@@ -1129,14 +1129,14 @@ mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy,
developereb6a0182022-12-12 18:53:32 +0800836 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
837 bf->ibf_ncol = bf->ncol;
838
839- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
840+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
841 bf->nrow = 1;
842 } else {
843 bf->nrow = tx_ant;
844 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
845 bf->ibf_ncol = nss_mcs;
846
847- if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160)
848+ if (sta->bandwidth == IEEE80211_STA_RX_BW_160)
849 bf->ibf_nrow = 1;
850 }
851 }
developer4be8f972022-12-13 16:02:25 +0800852@@ -1145,7 +1145,7 @@ static void
developereb6a0182022-12-12 18:53:32 +0800853 mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
854 struct mt7915_phy *phy, struct sta_rec_bf *bf)
855 {
856- struct ieee80211_sta_he_cap *pc = &sta->deflink.he_cap;
857+ struct ieee80211_sta_he_cap *pc = &sta->he_cap;
858 struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem;
859 const struct ieee80211_sta_he_cap *vc =
860 mt76_connac_get_he_phy_cap(phy->mt76, vif);
developer4be8f972022-12-13 16:02:25 +0800861@@ -1170,7 +1170,7 @@ mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +0800862 bf->ncol = min_t(u8, nss_mcs, bf->nrow);
863 bf->ibf_ncol = bf->ncol;
864
865- if (sta->deflink.bandwidth != IEEE80211_STA_RX_BW_160)
866+ if (sta->bandwidth != IEEE80211_STA_RX_BW_160)
867 return;
868
869 /* go over for 160MHz and 80p80 */
developer4be8f972022-12-13 16:02:25 +0800870@@ -1218,7 +1218,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800871 };
872 bool ebf;
873
874- if (!(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he))
875+ if (!(sta->ht_cap.ht_supported || sta->he_cap.has_he))
876 return;
877
878 ebf = mt7915_is_ebf_supported(phy, vif, sta, false);
developer4be8f972022-12-13 16:02:25 +0800879@@ -1232,21 +1232,21 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800880 * vht: support eBF and iBF
881 * ht: iBF only, since mac80211 lacks of eBF support
882 */
883- if (sta->deflink.he_cap.has_he && ebf)
884+ if (sta->he_cap.has_he && ebf)
885 mt7915_mcu_sta_bfer_he(sta, vif, phy, bf);
886- else if (sta->deflink.vht_cap.vht_supported)
887+ else if (sta->vht_cap.vht_supported)
888 mt7915_mcu_sta_bfer_vht(sta, phy, bf, ebf);
889- else if (sta->deflink.ht_cap.ht_supported)
890+ else if (sta->ht_cap.ht_supported)
891 mt7915_mcu_sta_bfer_ht(sta, phy, bf);
892 else
893 return;
894
895 bf->bf_cap = ebf ? ebf : dev->ibf << 1;
896- bf->bw = sta->deflink.bandwidth;
897- bf->ibf_dbw = sta->deflink.bandwidth;
898+ bf->bw = sta->bandwidth;
899+ bf->ibf_dbw = sta->bandwidth;
900 bf->ibf_nrow = tx_ant;
901
902- if (!ebf && sta->deflink.bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
903+ if (!ebf && sta->bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol)
904 bf->ibf_timeout = 0x48;
905 else
906 bf->ibf_timeout = 0x18;
developer4be8f972022-12-13 16:02:25 +0800907@@ -1256,7 +1256,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800908 else
909 bf->mem_20m = matrix[bf->nrow][bf->ncol];
910
911- switch (sta->deflink.bandwidth) {
912+ switch (sta->bandwidth) {
913 case IEEE80211_STA_RX_BW_160:
914 case IEEE80211_STA_RX_BW_80:
915 bf->mem_total = bf->mem_20m * 2;
developer4be8f972022-12-13 16:02:25 +0800916@@ -1281,7 +1281,7 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800917 struct tlv *tlv;
918 u8 nrow = 0;
919
920- if (!(sta->deflink.vht_cap.vht_supported || sta->deflink.he_cap.has_he))
921+ if (!(sta->vht_cap.vht_supported || sta->he_cap.has_he))
922 return;
923
924 if (!mt7915_is_ebf_supported(phy, vif, sta, true))
developer4be8f972022-12-13 16:02:25 +0800925@@ -1290,13 +1290,13 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
developereb6a0182022-12-12 18:53:32 +0800926 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_BFEE, sizeof(*bfee));
927 bfee = (struct sta_rec_bfee *)tlv;
928
929- if (sta->deflink.he_cap.has_he) {
930- struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem;
931+ if (sta->he_cap.has_he) {
932+ struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem;
933
934 nrow = HE_PHY(CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK,
935 pe->phy_cap_info[5]);
936- } else if (sta->deflink.vht_cap.vht_supported) {
937- struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap;
938+ } else if (sta->vht_cap.vht_supported) {
939+ struct ieee80211_sta_vht_cap *pc = &sta->vht_cap;
940
941 nrow = FIELD_GET(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK,
942 pc->cap);
developer4be8f972022-12-13 16:02:25 +0800943@@ -1352,7 +1352,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800944 ra->phy = *phy;
945 break;
946 case RATE_PARAM_MMPS_UPDATE:
947- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
948+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
949 break;
950 case RATE_PARAM_SPE_UPDATE:
951 ra->spe_idx = *(u8 *)data;
developer4be8f972022-12-13 16:02:25 +0800952@@ -1427,7 +1427,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800953 do { \
954 u8 i, gi = mask->control[band]._gi; \
955 gi = (_he) ? gi : gi == NL80211_TXRATE_FORCE_SGI; \
956- for (i = 0; i <= sta->deflink.bandwidth; i++) { \
957+ for (i = 0; i <= sta->bandwidth; i++) { \
958 phy.sgi |= gi << (i << (_he)); \
959 phy.he_ltf |= mask->control[band].he_ltf << (i << (_he));\
960 } \
developer4be8f972022-12-13 16:02:25 +0800961@@ -1441,11 +1441,11 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800962 } \
963 } while (0)
964
965- if (sta->deflink.he_cap.has_he) {
966+ if (sta->he_cap.has_he) {
967 __sta_phy_bitrate_mask_check(he_mcs, he_gi, 0, 1);
968- } else if (sta->deflink.vht_cap.vht_supported) {
969+ } else if (sta->vht_cap.vht_supported) {
970 __sta_phy_bitrate_mask_check(vht_mcs, gi, 0, 0);
971- } else if (sta->deflink.ht_cap.ht_supported) {
972+ } else if (sta->ht_cap.ht_supported) {
973 __sta_phy_bitrate_mask_check(ht_mcs, gi, 1, 0);
974 } else {
975 nrates = hweight32(mask->control[band].legacy);
developer4be8f972022-12-13 16:02:25 +0800976@@ -1479,7 +1479,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800977 * actual txrate hardware sends out.
978 */
979 addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 7);
980- if (sta->deflink.he_cap.has_he)
981+ if (sta->he_cap.has_he)
982 mt76_rmw_field(dev, addr, GENMASK(31, 24), phy.sgi);
983 else
984 mt76_rmw_field(dev, addr, GENMASK(15, 12), phy.sgi);
developer4be8f972022-12-13 16:02:25 +0800985@@ -1512,7 +1512,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800986 enum nl80211_band band = chandef->chan->band;
987 struct sta_rec_ra *ra;
988 struct tlv *tlv;
989- u32 supp_rate = sta->deflink.supp_rates[band];
990+ u32 supp_rate = sta->supp_rates[band];
991 u32 cap = sta->wme ? STA_CAP_WMM : 0;
992
993 tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra));
developer4be8f972022-12-13 16:02:25 +0800994@@ -1522,9 +1522,9 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +0800995 ra->auto_rate = true;
996 ra->phy_mode = mt76_connac_get_phy_mode(mphy, vif, band, sta);
997 ra->channel = chandef->chan->hw_value;
998- ra->bw = sta->deflink.bandwidth;
999- ra->phy.bw = sta->deflink.bandwidth;
1000- ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode);
1001+ ra->bw = sta->bandwidth;
1002+ ra->phy.bw = sta->bandwidth;
1003+ ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode);
1004
1005 if (supp_rate) {
1006 supp_rate &= mask->control[band].legacy;
developer4be8f972022-12-13 16:02:25 +08001007@@ -1544,22 +1544,22 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +08001008 }
1009 }
1010
1011- if (sta->deflink.ht_cap.ht_supported) {
1012+ if (sta->ht_cap.ht_supported) {
1013 ra->supp_mode |= MODE_HT;
1014- ra->af = sta->deflink.ht_cap.ampdu_factor;
1015- ra->ht_gf = !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
1016+ ra->af = sta->ht_cap.ampdu_factor;
1017+ ra->ht_gf = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
1018
1019 cap |= STA_CAP_HT;
1020- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
1021+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
1022 cap |= STA_CAP_SGI_20;
1023- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
1024+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
1025 cap |= STA_CAP_SGI_40;
1026- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
1027+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
1028 cap |= STA_CAP_TX_STBC;
1029- if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
1030+ if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
1031 cap |= STA_CAP_RX_STBC;
1032 if (mvif->cap.ht_ldpc &&
1033- (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
1034+ (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
1035 cap |= STA_CAP_LDPC;
1036
1037 mt7915_mcu_set_sta_ht_mcs(sta, ra->ht_mcs,
developer4be8f972022-12-13 16:02:25 +08001038@@ -1567,37 +1567,37 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev,
developereb6a0182022-12-12 18:53:32 +08001039 ra->supp_ht_mcs = *(__le32 *)ra->ht_mcs;
1040 }
1041
1042- if (sta->deflink.vht_cap.vht_supported) {
1043+ if (sta->vht_cap.vht_supported) {
1044 u8 af;
1045
1046 ra->supp_mode |= MODE_VHT;
1047 af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK,
1048- sta->deflink.vht_cap.cap);
1049+ sta->vht_cap.cap);
1050 ra->af = max_t(u8, ra->af, af);
1051
1052 cap |= STA_CAP_VHT;
1053- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
1054+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80)
1055 cap |= STA_CAP_VHT_SGI_80;
1056- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
1057+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160)
1058 cap |= STA_CAP_VHT_SGI_160;
1059- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
1060+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC)
1061 cap |= STA_CAP_VHT_TX_STBC;
1062- if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
1063+ if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1)
1064 cap |= STA_CAP_VHT_RX_STBC;
1065 if (mvif->cap.vht_ldpc &&
1066- (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
1067+ (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC))
1068 cap |= STA_CAP_VHT_LDPC;
1069
1070 mt7915_mcu_set_sta_vht_mcs(sta, ra->supp_vht_mcs,
1071 mask->control[band].vht_mcs);
1072 }
1073
1074- if (sta->deflink.he_cap.has_he) {
1075+ if (sta->he_cap.has_he) {
1076 ra->supp_mode |= MODE_HE;
1077 cap |= STA_CAP_HE;
1078
1079- if (sta->deflink.he_6ghz_capa.capa)
1080- ra->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa,
1081+ if (sta->he_6ghz_capa.capa)
1082+ ra->af = le16_get_bits(sta->he_6ghz_capa.capa,
1083 IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP);
1084 }
1085
developer4be8f972022-12-13 16:02:25 +08001086@@ -1806,7 +1806,7 @@ mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb,
developereb6a0182022-12-12 18:53:32 +08001087 if (!offs->cntdwn_counter_offs[0])
1088 return;
1089
1090- sub_tag = vif->bss_conf.csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
1091+ sub_tag = vif->csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC;
1092 tlv = mt7915_mcu_add_nested_subtlv(rskb, sub_tag, sizeof(*info),
1093 &bcn->sub_ntlv, &bcn->len);
1094 info = (struct bss_info_bcn_cntdwn *)tlv;
developer4be8f972022-12-13 16:02:25 +08001095@@ -1891,9 +1891,9 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +08001096 if (offs->cntdwn_counter_offs[0]) {
1097 u16 offset = offs->cntdwn_counter_offs[0];
1098
1099- if (vif->bss_conf.csa_active)
1100+ if (vif->csa_active)
1101 cont->csa_ofs = cpu_to_le16(offset - 4);
1102- if (vif->bss_conf.color_change_active)
1103+ if (vif->color_change_active)
1104 cont->bcc_ofs = cpu_to_le16(offset - 3);
1105 }
1106
developer4be8f972022-12-13 16:02:25 +08001107@@ -2077,7 +2077,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
developereb6a0182022-12-12 18:53:32 +08001108 if (!en)
1109 goto out;
1110
1111- skb = ieee80211_beacon_get_template(hw, vif, &offs, 0);
1112+ skb = ieee80211_beacon_get_template(hw, vif, &offs);
1113 if (!skb)
1114 return -EINVAL;
1115
developer4be8f972022-12-13 16:02:25 +08001116@@ -3278,17 +3278,17 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy,
developereb6a0182022-12-12 18:53:32 +08001117 if (txpower) {
1118 u32 offs, len, i;
1119
1120- if (sta->deflink.ht_cap.ht_supported) {
1121+ if (sta->ht_cap.ht_supported) {
1122 const u8 *sku_len = mt7915_sku_group_len;
1123
1124 offs = sku_len[SKU_CCK] + sku_len[SKU_OFDM];
1125 len = sku_len[SKU_HT_BW20] + sku_len[SKU_HT_BW40];
1126
1127- if (sta->deflink.vht_cap.vht_supported) {
1128+ if (sta->vht_cap.vht_supported) {
1129 offs += len;
1130 len = sku_len[SKU_VHT_BW20] * 4;
1131
1132- if (sta->deflink.he_cap.has_he) {
1133+ if (sta->he_cap.has_he) {
1134 offs += len + sku_len[SKU_HE_RU26] * 3;
1135 len = sku_len[SKU_HE_RU242] * 4;
1136 }
developereb6a0182022-12-12 18:53:32 +08001137diff --git a/tx.c b/tx.c
developer4be8f972022-12-13 16:02:25 +08001138index 6d55566..91c8dd8 100644
developereb6a0182022-12-12 18:53:32 +08001139--- a/tx.c
1140+++ b/tx.c
1141@@ -60,20 +60,15 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
1142 .skb = skb,
1143 .info = IEEE80211_SKB_CB(skb),
1144 };
1145- struct ieee80211_rate_status rs = {};
1146 struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
1147 struct mt76_wcid *wcid;
1148
1149 wcid = rcu_dereference(dev->wcid[cb->wcid]);
1150 if (wcid) {
1151 status.sta = wcid_to_sta(wcid);
1152- if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
1153- rs.rate_idx = wcid->rate;
1154- status.rates = &rs;
1155- status.n_rates = 1;
1156- } else {
1157- status.n_rates = 0;
1158- }
1159+
1160+ if (status.sta)
1161+ status.rate = &wcid->rate;
1162 }
1163
1164 hw = mt76_tx_status_get_hw(dev, skb);
1165--
developer4be8f972022-12-13 16:02:25 +080011662.36.1
developereb6a0182022-12-12 18:53:32 +08001167