developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 1 | From 65b253209f31420ee2b1e7faf65213e858a7a001 Mon Sep 17 00:00:00 2001 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
developer | 4be8f97 | 2022-12-13 16:02:25 +0800 | [diff] [blame] | 3 | Date: Mon, 12 Dec 2022 18:17:12 +0800 |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 4 | Subject: [PATCH 4002/4002] mt76: revert for backports-5.15 wireless stack |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 5 | |
| 6 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 7 | --- |
| 8 | debugfs.c | 2 + |
| 9 | dma.c | 2 +- |
| 10 | mac80211.c | 4 +- |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 11 | mt7615/dma.c | 4 +- |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 12 | 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 +-- |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 24 | 16 files changed, 170 insertions(+), 178 deletions(-) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 25 | |
| 26 | diff --git a/debugfs.c b/debugfs.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 27 | index 79064a4d..4a8e1864 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 28 | --- 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 | } |
| 41 | diff --git a/dma.c b/dma.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 42 | index 7ef272e2..8b9fdfc5 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 43 | --- a/dma.c |
| 44 | +++ b/dma.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 45 | @@ -941,7 +941,7 @@ mt76_dma_init(struct mt76_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 46 | 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 | } |
| 54 | diff --git a/mac80211.c b/mac80211.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 55 | index 818f4f0c..909ab259 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 56 | --- a/mac80211.c |
| 57 | +++ b/mac80211.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 58 | @@ -1508,7 +1508,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power); |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 59 | 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 | |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 67 | @@ -1530,7 +1530,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 68 | { |
| 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); |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 76 | diff --git a/mt7615/dma.c b/mt7615/dma.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 77 | index f1914431..ec729dbe 100644 |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 78 | --- 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, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 91 | diff --git a/mt7615/main.c b/mt7615/main.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 92 | index ab4c1b44..8fb5b256 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 93 | --- 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 | } |
| 122 | diff --git a/mt7615/mcu.c b/mt7615/mcu.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 123 | index e917d025..b2e1f388 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 124 | --- a/mt7615/mcu.c |
| 125 | +++ b/mt7615/mcu.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 126 | @@ -353,7 +353,7 @@ out: |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 127 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 135 | @@ -699,7 +699,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 136 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 144 | @@ -1074,7 +1074,7 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 145 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 153 | @@ -2526,7 +2526,7 @@ int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 154 | 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 | }; |
| 162 | diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 163 | index d4060136..703ca736 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 164 | --- a/mt76_connac_mcu.c |
| 165 | +++ b/mt76_connac_mcu.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 166 | @@ -197,7 +197,7 @@ int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 167 | */ |
| 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) |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 175 | @@ -409,7 +409,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 176 | 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); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 184 | @@ -553,7 +553,7 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 185 | |
| 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); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 193 | @@ -602,14 +602,14 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 194 | 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; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 210 | @@ -620,7 +620,7 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 211 | 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; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 219 | @@ -708,7 +708,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 220 | |
| 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) |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 228 | @@ -753,7 +753,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 229 | 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; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 237 | @@ -764,7 +764,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 238 | 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) |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 246 | @@ -780,7 +780,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 247 | 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 |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 255 | @@ -793,9 +793,9 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 256 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 268 | @@ -844,25 +844,25 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 269 | 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 */ |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 300 | @@ -871,11 +871,11 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 301 | 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 && |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 314 | @@ -885,7 +885,7 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 315 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 323 | @@ -895,14 +895,14 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 324 | 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); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 341 | @@ -911,18 +911,18 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 342 | |
| 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 | } |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 365 | @@ -938,7 +938,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 366 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 374 | @@ -950,27 +950,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 375 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 410 | @@ -979,18 +979,18 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 411 | 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; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 432 | @@ -1000,15 +1000,15 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 433 | 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; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 453 | @@ -1294,9 +1294,9 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 454 | 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 466 | @@ -1616,7 +1616,6 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 467 | 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); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 474 | @@ -1749,7 +1748,6 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 475 | 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]; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 482 | @@ -2236,10 +2234,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 483 | 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 { |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 494 | @@ -2267,7 +2263,7 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 495 | |
| 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 | } |
| 503 | diff --git a/mt76x02_mac.c b/mt76x02_mac.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 504 | index d3f74473..87ea3db1 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 505 | --- 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; |
| 528 | diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 529 | index b178036c..cecc3ef5 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 530 | --- a/mt7915/debugfs.c |
| 531 | +++ b/mt7915/debugfs.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 532 | @@ -1905,8 +1905,8 @@ static ssize_t mt7915_sta_fixed_rate_set(struct file *file, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 533 | |
| 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 | |
| 543 | diff --git a/mt7915/dma.c b/mt7915/dma.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 544 | index 9cbd3625..5743dc54 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 545 | --- a/mt7915/dma.c |
| 546 | +++ b/mt7915/dma.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 547 | @@ -553,8 +553,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 548 | 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); |
| 558 | diff --git a/mt7915/init.c b/mt7915/init.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 559 | index ef752e10..9ccbc7bc 100755 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 560 | --- a/mt7915/init.c |
| 561 | +++ b/mt7915/init.c |
developer | 9851a29 | 2022-12-15 17:33:43 +0800 | [diff] [blame] | 562 | @@ -1152,8 +1152,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 563 | 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) { |
| 572 | diff --git a/mt7915/mac.c b/mt7915/mac.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 573 | index 0d0ae7ab..d759912c 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 574 | --- a/mt7915/mac.c |
| 575 | +++ b/mt7915/mac.c |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 576 | @@ -915,7 +915,7 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 577 | 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); |
| 585 | diff --git a/mt7915/main.c b/mt7915/main.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 586 | index c87f04b1..28509d94 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 587 | --- a/mt7915/main.c |
| 588 | +++ b/mt7915/main.c |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 589 | @@ -523,7 +523,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 590 | |
| 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; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 598 | @@ -618,7 +618,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 599 | 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 607 | @@ -638,7 +638,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 608 | } |
| 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 616 | @@ -1223,10 +1223,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 617 | { |
| 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); |
| 629 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 630 | index 88ce44f9..f2c848dd 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 631 | --- a/mt7915/mcu.c |
| 632 | +++ b/mt7915/mcu.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 633 | @@ -64,7 +64,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 634 | 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; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 642 | @@ -104,7 +104,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 643 | |
| 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 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 651 | @@ -117,8 +117,8 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 652 | { |
| 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) { |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 662 | @@ -140,7 +140,7 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 663 | |
| 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 | } |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 671 | @@ -149,10 +149,10 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 672 | 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 |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 684 | @@ -231,7 +231,7 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 685 | 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 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 693 | @@ -332,7 +332,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 694 | 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 702 | @@ -745,13 +745,13 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 703 | 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)); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 718 | @@ -837,8 +837,8 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 719 | |
| 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) |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 729 | @@ -888,7 +888,7 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 730 | 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 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 738 | @@ -912,11 +912,11 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 739 | 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 = |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 753 | @@ -950,13 +950,13 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 754 | 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 |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 769 | @@ -965,15 +965,15 @@ mt7915_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 770 | 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 |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 789 | @@ -988,7 +988,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 790 | 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)); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 798 | @@ -997,7 +997,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 799 | 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 = |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 807 | @@ -1060,8 +1060,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 808 | 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 && |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 818 | @@ -1071,8 +1071,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 819 | 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 && |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 829 | @@ -1098,7 +1098,7 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 830 | 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; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 838 | @@ -1123,7 +1123,7 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 839 | 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 847 | @@ -1144,14 +1144,14 @@ mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 848 | 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 | } |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 864 | @@ -1160,7 +1160,7 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 865 | 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 873 | @@ -1185,7 +1185,7 @@ mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 874 | 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 */ |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 882 | @@ -1233,7 +1233,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 883 | }; |
| 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 891 | @@ -1247,21 +1247,21 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 892 | * 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; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 919 | @@ -1271,7 +1271,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 920 | 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; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 928 | @@ -1296,7 +1296,7 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 929 | 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)) |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 937 | @@ -1305,13 +1305,13 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 938 | 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 955 | @@ -1367,7 +1367,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 956 | 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; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 964 | @@ -1442,7 +1442,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 965 | 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 | } \ |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 973 | @@ -1456,11 +1456,11 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 974 | } \ |
| 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 988 | @@ -1494,7 +1494,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 989 | * 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); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 997 | @@ -1527,7 +1527,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 998 | 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)); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1006 | @@ -1537,9 +1537,9 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1007 | 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; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1019 | @@ -1559,22 +1559,22 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1020 | } |
| 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, |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1050 | @@ -1582,37 +1582,37 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1051 | 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 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1098 | @@ -1821,7 +1821,7 @@ mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1099 | 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; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1107 | @@ -1906,9 +1906,9 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1108 | 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 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1119 | @@ -2092,7 +2092,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1120 | 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 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1128 | @@ -3308,17 +3308,17 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1129 | 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 | } |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 1149 | diff --git a/mt7915/testmode.c b/mt7915/testmode.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 1150 | index 70382b9b..5c711167 100644 |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 1151 | --- a/mt7915/testmode.c |
| 1152 | +++ b/mt7915/testmode.c |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1153 | @@ -397,12 +397,12 @@ mt7915_tm_entry_add(struct mt7915_phy *phy, u8 aid) |
| 1154 | memcpy(sta->addr, td->addr[0], ETH_ALEN); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 1155 | |
| 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 | |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1170 | diff --git a/tx.c b/tx.c |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 1171 | index a72b7779..04b6f2e7 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1172 | --- 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 | -- |
developer | 30d39c2 | 2022-12-16 10:29:49 +0800 | [diff] [blame] | 1199 | 2.25.1 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1200 | |