developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 1 | From fb3205686d76d409b1cdd4a25c2dd526fda4b2e4 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 | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 3 | Date: Fri, 30 Dec 2022 11:12:07 +0800 |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 4004/4006] mt76: revert for backports-5.15 wireless stack |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 5 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 6 | --- |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 7 | dma.c | 2 +- |
| 8 | mac80211.c | 4 +- |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 9 | mt7615/dma.c | 4 +- |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 10 | mt7615/main.c | 6 +- |
| 11 | mt7615/mcu.c | 8 +-- |
| 12 | mt76_connac_mcu.c | 108 +++++++++++++++--------------- |
| 13 | mt76x02_mac.c | 6 +- |
| 14 | mt7915/debugfs.c | 4 +- |
| 15 | mt7915/dma.c | 4 +- |
| 16 | mt7915/init.c | 3 +- |
| 17 | mt7915/mac.c | 2 +- |
| 18 | mt7915/main.c | 10 +-- |
| 19 | mt7915/mcu.c | 166 +++++++++++++++++++++++----------------------- |
| 20 | mt7915/testmode.c | 8 +-- |
| 21 | tx.c | 11 +-- |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 22 | 15 files changed, 168 insertions(+), 178 deletions(-) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 23 | |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 24 | diff --git a/dma.c b/dma.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 25 | index e6021369..c2125106 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 26 | --- a/dma.c |
| 27 | +++ b/dma.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 28 | @@ -995,7 +995,7 @@ mt76_dma_init(struct mt76_dev *dev, |
| 29 | init_completion(&dev->mmio.wed_reset_complete); |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 30 | |
| 31 | mt76_for_each_q_rx(dev, i) { |
| 32 | - netif_napi_add(&dev->napi_dev, &dev->napi[i], poll); |
| 33 | + netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64); |
| 34 | mt76_dma_rx_fill(dev, &dev->q_rx[i]); |
| 35 | napi_enable(&dev->napi[i]); |
| 36 | } |
| 37 | diff --git a/mac80211.c b/mac80211.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 38 | index 90447472..14a02c01 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 39 | --- a/mac80211.c |
| 40 | +++ b/mac80211.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 41 | @@ -1509,7 +1509,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power); |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 42 | static void |
| 43 | __mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 44 | { |
| 45 | - if (vif->bss_conf.csa_active && ieee80211_beacon_cntdwn_is_complete(vif)) |
| 46 | + if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif)) |
| 47 | ieee80211_csa_finish(vif); |
| 48 | } |
| 49 | |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 50 | @@ -1531,7 +1531,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 51 | { |
| 52 | struct mt76_dev *dev = priv; |
| 53 | |
| 54 | - if (!vif->bss_conf.csa_active) |
| 55 | + if (!vif->csa_active) |
| 56 | return; |
| 57 | |
| 58 | dev->csa_complete |= ieee80211_beacon_cntdwn_is_complete(vif); |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 59 | diff --git a/mt7615/dma.c b/mt7615/dma.c |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 60 | index f1914431..ec729dbe 100644 |
developer | f0de14b | 2022-12-14 23:07:34 +0800 | [diff] [blame] | 61 | --- a/mt7615/dma.c |
| 62 | +++ b/mt7615/dma.c |
| 63 | @@ -281,8 +281,8 @@ int mt7615_dma_init(struct mt7615_dev *dev) |
| 64 | if (ret < 0) |
| 65 | return ret; |
| 66 | |
| 67 | - netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 68 | - mt7615_poll_tx); |
| 69 | + netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 70 | + mt7615_poll_tx, NAPI_POLL_WEIGHT); |
| 71 | napi_enable(&dev->mt76.tx_napi); |
| 72 | |
| 73 | mt76_poll(dev, MT_WPDMA_GLO_CFG, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 74 | diff --git a/mt7615/main.c b/mt7615/main.c |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 75 | index ab4c1b44..8fb5b256 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 76 | --- a/mt7615/main.c |
| 77 | +++ b/mt7615/main.c |
| 78 | @@ -474,7 +474,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed) |
| 79 | |
| 80 | static int |
| 81 | mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 82 | - unsigned int link_id, u16 queue, |
| 83 | + u16 queue, |
| 84 | const struct ieee80211_tx_queue_params *params) |
| 85 | { |
| 86 | struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv; |
| 87 | @@ -556,7 +556,7 @@ static void mt7615_configure_filter(struct ieee80211_hw *hw, |
| 88 | static void mt7615_bss_info_changed(struct ieee80211_hw *hw, |
| 89 | struct ieee80211_vif *vif, |
| 90 | struct ieee80211_bss_conf *info, |
| 91 | - u64 changed) |
| 92 | + u32 changed) |
| 93 | { |
| 94 | struct mt7615_dev *dev = mt7615_hw_dev(hw); |
| 95 | struct mt7615_phy *phy = mt7615_hw_phy(hw); |
| 96 | @@ -599,7 +599,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw, |
| 97 | } |
| 98 | |
| 99 | if (changed & BSS_CHANGED_ASSOC) |
| 100 | - mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc); |
| 101 | + mt7615_mac_set_beacon_filter(phy, vif, info->assoc); |
| 102 | |
| 103 | mt7615_mutex_release(dev); |
| 104 | } |
| 105 | diff --git a/mt7615/mcu.c b/mt7615/mcu.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 106 | index 4593b2e1..39e81d26 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 107 | --- a/mt7615/mcu.c |
| 108 | +++ b/mt7615/mcu.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 109 | @@ -353,7 +353,7 @@ out: |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 110 | static void |
| 111 | mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 112 | { |
| 113 | - if (vif->bss_conf.csa_active) |
| 114 | + if (vif->csa_active) |
| 115 | ieee80211_csa_finish(vif); |
| 116 | } |
| 117 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 118 | @@ -699,7 +699,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 119 | if (!enable) |
| 120 | goto out; |
| 121 | |
| 122 | - skb = ieee80211_beacon_get_template(hw, vif, &offs, 0); |
| 123 | + skb = ieee80211_beacon_get_template(hw, vif, &offs); |
| 124 | if (!skb) |
| 125 | return -EINVAL; |
| 126 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 127 | @@ -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] | 128 | if (!enable) |
| 129 | goto out; |
| 130 | |
| 131 | - skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs, 0); |
| 132 | + skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs); |
| 133 | if (!skb) |
| 134 | return -EINVAL; |
| 135 | |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 136 | @@ -2525,7 +2525,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] | 137 | u8 pad; |
| 138 | } req = { |
| 139 | .bss_idx = mvif->mt76.idx, |
| 140 | - .aid = cpu_to_le16(vif->cfg.aid), |
| 141 | + .aid = cpu_to_le16(vif->bss_conf.aid), |
| 142 | .dtim_period = vif->bss_conf.dtim_period, |
| 143 | .bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int), |
| 144 | }; |
| 145 | diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 146 | index 1baa4a03..d7d85291 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 147 | --- a/mt76_connac_mcu.c |
| 148 | +++ b/mt76_connac_mcu.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 149 | @@ -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] | 150 | */ |
| 151 | } req = { |
| 152 | .bss_idx = mvif->idx, |
| 153 | - .ps_state = vif->cfg.ps ? 2 : 0, |
| 154 | + .ps_state = vif->bss_conf.ps ? 2 : 0, |
| 155 | }; |
| 156 | |
| 157 | if (vif->type != NL80211_IFTYPE_STATION) |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 158 | @@ -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] | 159 | else |
| 160 | conn_type = CONNECTION_INFRA_AP; |
| 161 | basic->conn_type = cpu_to_le32(conn_type); |
| 162 | - basic->aid = cpu_to_le16(vif->cfg.aid); |
| 163 | + basic->aid = cpu_to_le16(vif->bss_conf.aid); |
| 164 | break; |
| 165 | case NL80211_IFTYPE_ADHOC: |
| 166 | basic->conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 167 | @@ -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] | 168 | |
| 169 | if (sta) { |
| 170 | if (vif->type == NL80211_IFTYPE_STATION) |
| 171 | - generic->partial_aid = cpu_to_le16(vif->cfg.aid); |
| 172 | + generic->partial_aid = cpu_to_le16(vif->bss_conf.aid); |
| 173 | else |
| 174 | generic->partial_aid = cpu_to_le16(sta->aid); |
| 175 | memcpy(generic->peer_addr, sta->addr, ETH_ALEN); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 176 | @@ -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] | 177 | vif->type != NL80211_IFTYPE_STATION) |
| 178 | return; |
| 179 | |
| 180 | - if (!sta->deflink.agg.max_amsdu_len) |
| 181 | + if (!sta->max_amsdu_len) |
| 182 | return; |
| 183 | |
| 184 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu)); |
| 185 | amsdu = (struct sta_rec_amsdu *)tlv; |
| 186 | amsdu->max_amsdu_num = 8; |
| 187 | amsdu->amsdu_en = true; |
| 188 | - amsdu->max_mpdu_size = sta->deflink.agg.max_amsdu_len >= |
| 189 | + amsdu->max_mpdu_size = sta->max_amsdu_len >= |
| 190 | IEEE80211_MAX_MPDU_LEN_VHT_7991; |
| 191 | |
| 192 | wcid->amsdu = true; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 193 | @@ -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] | 194 | static void |
| 195 | mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
| 196 | { |
| 197 | - struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; |
| 198 | + struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; |
| 199 | struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; |
| 200 | struct sta_rec_he *he; |
| 201 | struct tlv *tlv; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 202 | @@ -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] | 203 | |
| 204 | he->he_cap = cpu_to_le32(cap); |
| 205 | |
| 206 | - switch (sta->deflink.bandwidth) { |
| 207 | + switch (sta->bandwidth) { |
| 208 | case IEEE80211_STA_RX_BW_160: |
| 209 | if (elem->phy_cap_info[0] & |
| 210 | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 211 | @@ -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] | 212 | static void |
| 213 | mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta) |
| 214 | { |
| 215 | - struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; |
| 216 | + struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; |
| 217 | struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; |
| 218 | struct sta_rec_he_v2 *he; |
| 219 | struct tlv *tlv; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 220 | @@ -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] | 221 | memcpy(he->he_phy_cap, elem->phy_cap_info, sizeof(he->he_phy_cap)); |
| 222 | memcpy(he->he_mac_cap, elem->mac_cap_info, sizeof(he->he_mac_cap)); |
| 223 | |
| 224 | - switch (sta->deflink.bandwidth) { |
| 225 | + switch (sta->bandwidth) { |
| 226 | case IEEE80211_STA_RX_BW_160: |
| 227 | if (elem->phy_cap_info[0] & |
| 228 | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 229 | @@ -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] | 230 | break; |
| 231 | } |
| 232 | |
| 233 | - he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US; |
| 234 | + he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US; |
| 235 | } |
| 236 | |
| 237 | static u8 |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 238 | @@ -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] | 239 | u8 mode = 0; |
| 240 | |
| 241 | if (sta) { |
| 242 | - ht_cap = &sta->deflink.ht_cap; |
| 243 | - vht_cap = &sta->deflink.vht_cap; |
| 244 | - he_cap = &sta->deflink.he_cap; |
| 245 | + ht_cap = &sta->ht_cap; |
| 246 | + vht_cap = &sta->vht_cap; |
| 247 | + he_cap = &sta->he_cap; |
| 248 | } else { |
| 249 | struct ieee80211_supported_band *sband; |
| 250 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 251 | @@ -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] | 252 | u16 supp_rates; |
| 253 | |
| 254 | /* starec ht */ |
| 255 | - if (sta->deflink.ht_cap.ht_supported) { |
| 256 | + if (sta->ht_cap.ht_supported) { |
| 257 | struct sta_rec_ht *ht; |
| 258 | |
| 259 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht)); |
| 260 | ht = (struct sta_rec_ht *)tlv; |
| 261 | - ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap); |
| 262 | + ht->ht_cap = cpu_to_le16(sta->ht_cap.cap); |
| 263 | } |
| 264 | |
| 265 | /* starec vht */ |
| 266 | - if (sta->deflink.vht_cap.vht_supported) { |
| 267 | + if (sta->vht_cap.vht_supported) { |
| 268 | struct sta_rec_vht *vht; |
| 269 | int len; |
| 270 | |
| 271 | len = is_mt7921(dev) ? sizeof(*vht) : sizeof(*vht) - 4; |
| 272 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, len); |
| 273 | vht = (struct sta_rec_vht *)tlv; |
| 274 | - vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); |
| 275 | - vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; |
| 276 | - vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map; |
| 277 | + vht->vht_cap = cpu_to_le32(sta->vht_cap.cap); |
| 278 | + vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map; |
| 279 | + vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map; |
| 280 | } |
| 281 | |
| 282 | /* starec uapsd */ |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 283 | @@ -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] | 284 | if (!is_mt7921(dev)) |
| 285 | return; |
| 286 | |
| 287 | - if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he) |
| 288 | + if (sta->ht_cap.ht_supported || sta->he_cap.has_he) |
| 289 | mt76_connac_mcu_sta_amsdu_tlv(skb, sta, vif); |
| 290 | |
| 291 | /* starec he */ |
| 292 | - if (sta->deflink.he_cap.has_he) { |
| 293 | + if (sta->he_cap.has_he) { |
| 294 | mt76_connac_mcu_sta_he_tlv(skb, sta); |
| 295 | mt76_connac_mcu_sta_he_tlv_v2(skb, sta); |
| 296 | if (band == NL80211_BAND_6GHZ && |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 297 | @@ -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] | 298 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE_6G, |
| 299 | sizeof(*he_6g_capa)); |
| 300 | he_6g_capa = (struct sta_rec_he_6g_capa *)tlv; |
| 301 | - he_6g_capa->capa = sta->deflink.he_6ghz_capa.capa; |
| 302 | + he_6g_capa->capa = sta->he_6ghz_capa.capa; |
| 303 | } |
| 304 | } |
| 305 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 306 | @@ -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] | 307 | phy->basic_rate = cpu_to_le16((u16)vif->bss_conf.basic_rates); |
| 308 | phy->rcpi = rcpi; |
| 309 | phy->ampdu = FIELD_PREP(IEEE80211_HT_AMPDU_PARM_FACTOR, |
| 310 | - sta->deflink.ht_cap.ampdu_factor) | |
| 311 | + sta->ht_cap.ampdu_factor) | |
| 312 | FIELD_PREP(IEEE80211_HT_AMPDU_PARM_DENSITY, |
| 313 | - sta->deflink.ht_cap.ampdu_density); |
| 314 | + sta->ht_cap.ampdu_density); |
| 315 | |
| 316 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra_info)); |
| 317 | ra_info = (struct sta_rec_ra_info *)tlv; |
| 318 | |
| 319 | - supp_rates = sta->deflink.supp_rates[band]; |
| 320 | + supp_rates = sta->supp_rates[band]; |
| 321 | if (band == NL80211_BAND_2GHZ) |
| 322 | supp_rates = FIELD_PREP(RA_LEGACY_OFDM, supp_rates >> 4) | |
| 323 | FIELD_PREP(RA_LEGACY_CCK, supp_rates & 0xf); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 324 | @@ -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] | 325 | |
| 326 | ra_info->legacy = cpu_to_le16(supp_rates); |
| 327 | |
| 328 | - if (sta->deflink.ht_cap.ht_supported) |
| 329 | + if (sta->ht_cap.ht_supported) |
| 330 | memcpy(ra_info->rx_mcs_bitmask, |
| 331 | - sta->deflink.ht_cap.mcs.rx_mask, |
| 332 | + sta->ht_cap.mcs.rx_mask, |
| 333 | HT_MCS_MASK_NUM); |
| 334 | |
| 335 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_STATE, sizeof(*state)); |
| 336 | state = (struct sta_rec_state *)tlv; |
| 337 | state->state = sta_state; |
| 338 | |
| 339 | - if (sta->deflink.vht_cap.vht_supported) { |
| 340 | - state->vht_opmode = sta->deflink.bandwidth; |
| 341 | - state->vht_opmode |= (sta->deflink.rx_nss - 1) << |
| 342 | + if (sta->vht_cap.vht_supported) { |
| 343 | + state->vht_opmode = sta->bandwidth; |
| 344 | + state->vht_opmode |= (sta->rx_nss - 1) << |
| 345 | IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT; |
| 346 | } |
| 347 | } |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 348 | @@ -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] | 349 | tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_SMPS, sizeof(*smps), |
| 350 | wtbl_tlv, sta_wtbl); |
| 351 | smps = (struct wtbl_smps *)tlv; |
| 352 | - smps->smps = (sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC); |
| 353 | + smps->smps = (sta->smps_mode == IEEE80211_SMPS_DYNAMIC); |
| 354 | } |
| 355 | EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_smps_tlv); |
| 356 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 357 | @@ -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] | 358 | struct tlv *tlv; |
| 359 | u32 flags = 0; |
| 360 | |
| 361 | - if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_6ghz_capa.capa) { |
| 362 | + if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) { |
| 363 | tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht), |
| 364 | wtbl_tlv, sta_wtbl); |
| 365 | ht = (struct wtbl_ht *)tlv; |
| 366 | ht->ldpc = ht_ldpc && |
| 367 | - !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING); |
| 368 | + !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING); |
| 369 | |
| 370 | - if (sta->deflink.ht_cap.ht_supported) { |
| 371 | - ht->af = sta->deflink.ht_cap.ampdu_factor; |
| 372 | - ht->mm = sta->deflink.ht_cap.ampdu_density; |
| 373 | + if (sta->ht_cap.ht_supported) { |
| 374 | + ht->af = sta->ht_cap.ampdu_factor; |
| 375 | + ht->mm = sta->ht_cap.ampdu_density; |
| 376 | } else { |
| 377 | - ht->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa, |
| 378 | + ht->af = le16_get_bits(sta->he_6ghz_capa.capa, |
| 379 | IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP); |
| 380 | - ht->mm = le16_get_bits(sta->deflink.he_6ghz_capa.capa, |
| 381 | + ht->mm = le16_get_bits(sta->he_6ghz_capa.capa, |
| 382 | IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START); |
| 383 | } |
| 384 | |
| 385 | ht->ht = true; |
| 386 | } |
| 387 | |
| 388 | - if (sta->deflink.vht_cap.vht_supported || sta->deflink.he_6ghz_capa.capa) { |
| 389 | + if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) { |
| 390 | struct wtbl_vht *vht; |
| 391 | u8 af; |
| 392 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 393 | @@ -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] | 394 | sta_wtbl); |
| 395 | vht = (struct wtbl_vht *)tlv; |
| 396 | vht->ldpc = vht_ldpc && |
| 397 | - !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC); |
| 398 | + !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC); |
| 399 | vht->vht = true; |
| 400 | |
| 401 | af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK, |
| 402 | - sta->deflink.vht_cap.cap); |
| 403 | + sta->vht_cap.cap); |
| 404 | if (ht) |
| 405 | ht->af = max(ht->af, af); |
| 406 | } |
| 407 | |
| 408 | mt76_connac_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_tlv); |
| 409 | |
| 410 | - if (is_connac_v1(dev) && sta->deflink.ht_cap.ht_supported) { |
| 411 | + if (is_connac_v1(dev) && sta->ht_cap.ht_supported) { |
| 412 | /* sgi */ |
| 413 | u32 msk = MT_WTBL_W5_SHORT_GI_20 | MT_WTBL_W5_SHORT_GI_40 | |
| 414 | MT_WTBL_W5_SHORT_GI_80 | MT_WTBL_W5_SHORT_GI_160; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 415 | @@ -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] | 416 | sizeof(*raw), wtbl_tlv, |
| 417 | sta_wtbl); |
| 418 | |
| 419 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 420 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 421 | flags |= MT_WTBL_W5_SHORT_GI_20; |
| 422 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 423 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 424 | flags |= MT_WTBL_W5_SHORT_GI_40; |
| 425 | |
| 426 | - if (sta->deflink.vht_cap.vht_supported) { |
| 427 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 428 | + if (sta->vht_cap.vht_supported) { |
| 429 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 430 | flags |= MT_WTBL_W5_SHORT_GI_80; |
| 431 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 432 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 433 | flags |= MT_WTBL_W5_SHORT_GI_160; |
| 434 | } |
| 435 | raw = (struct wtbl_raw *)tlv; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 436 | @@ -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] | 437 | return 0x38; |
| 438 | |
| 439 | if (sta) { |
| 440 | - ht_cap = &sta->deflink.ht_cap; |
| 441 | - vht_cap = &sta->deflink.vht_cap; |
| 442 | - he_cap = &sta->deflink.he_cap; |
| 443 | + ht_cap = &sta->ht_cap; |
| 444 | + vht_cap = &sta->vht_cap; |
| 445 | + he_cap = &sta->he_cap; |
| 446 | } else { |
| 447 | struct ieee80211_supported_band *sband; |
| 448 | |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 449 | @@ -1662,7 +1662,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] | 450 | for (i = 0; i < sreq->n_ssids; i++) { |
| 451 | if (!sreq->ssids[i].ssid_len) |
| 452 | continue; |
| 453 | - |
| 454 | req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len); |
| 455 | memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid, |
| 456 | sreq->ssids[i].ssid_len); |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 457 | @@ -1795,7 +1794,6 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 458 | memcpy(req->ssids[i].ssid, ssid->ssid, ssid->ssid_len); |
| 459 | req->ssids[i].ssid_len = cpu_to_le32(ssid->ssid_len); |
| 460 | } |
| 461 | - |
| 462 | req->match_num = sreq->n_match_sets; |
| 463 | for (i = 0; i < req->match_num; i++) { |
| 464 | match = &sreq->match_sets[i]; |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 465 | @@ -2282,10 +2280,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 466 | struct mt76_vif *vif, |
| 467 | struct ieee80211_bss_conf *info) |
| 468 | { |
| 469 | - struct ieee80211_vif *mvif = container_of(info, struct ieee80211_vif, |
| 470 | - bss_conf); |
| 471 | struct sk_buff *skb; |
| 472 | - int i, len = min_t(int, mvif->cfg.arp_addr_cnt, |
| 473 | + int i, len = min_t(int, info->arp_addr_cnt, |
| 474 | IEEE80211_BSS_ARP_ADDR_LIST_LEN); |
| 475 | struct { |
| 476 | struct { |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 477 | @@ -2313,7 +2309,7 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 478 | |
| 479 | skb_put_data(skb, &req_hdr, sizeof(req_hdr)); |
| 480 | for (i = 0; i < len; i++) |
| 481 | - skb_put_data(skb, &mvif->cfg.arp_addr_list[i], sizeof(__be32)); |
| 482 | + skb_put_data(skb, &info->arp_addr_list[i], sizeof(__be32)); |
| 483 | |
| 484 | return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true); |
| 485 | } |
| 486 | diff --git a/mt76x02_mac.c b/mt76x02_mac.c |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 487 | index d3f74473..87ea3db1 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 488 | --- a/mt76x02_mac.c |
| 489 | +++ b/mt76x02_mac.c |
| 490 | @@ -404,7 +404,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi, |
| 491 | txwi->rate |= cpu_to_le16(MT_RXWI_RATE_LDPC); |
| 492 | if ((info->flags & IEEE80211_TX_CTL_STBC) && nss == 1) |
| 493 | txwi->rate |= cpu_to_le16(MT_RXWI_RATE_STBC); |
| 494 | - if (nss > 1 && sta && sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC) |
| 495 | + if (nss > 1 && sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC) |
| 496 | txwi_flags |= MT_TXWI_FLAGS_MMPS; |
| 497 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
| 498 | txwi->ack_ctl |= MT_TXWI_ACK_CTL_REQ; |
| 499 | @@ -412,9 +412,9 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi, |
| 500 | txwi->ack_ctl |= MT_TXWI_ACK_CTL_NSEQ; |
| 501 | if ((info->flags & IEEE80211_TX_CTL_AMPDU) && sta) { |
| 502 | u8 ba_size = IEEE80211_MIN_AMPDU_BUF; |
| 503 | - u8 ampdu_density = sta->deflink.ht_cap.ampdu_density; |
| 504 | + u8 ampdu_density = sta->ht_cap.ampdu_density; |
| 505 | |
| 506 | - ba_size <<= sta->deflink.ht_cap.ampdu_factor; |
| 507 | + ba_size <<= sta->ht_cap.ampdu_factor; |
| 508 | ba_size = min_t(int, 63, ba_size - 1); |
| 509 | if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) |
| 510 | ba_size = 0; |
| 511 | diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 512 | index b178036c..cecc3ef5 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 513 | --- a/mt7915/debugfs.c |
| 514 | +++ b/mt7915/debugfs.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 515 | @@ -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] | 516 | |
| 517 | phy.ldpc = (phy.bw || phy.ldpc) * GENMASK(2, 0); |
| 518 | for (i = 0; i <= phy.bw; i++) { |
| 519 | - phy.sgi |= gi << (i << sta->deflink.he_cap.has_he); |
| 520 | - phy.he_ltf |= he_ltf << (i << sta->deflink.he_cap.has_he); |
| 521 | + phy.sgi |= gi << (i << sta->he_cap.has_he); |
| 522 | + phy.he_ltf |= he_ltf << (i << sta->he_cap.has_he); |
| 523 | } |
| 524 | field = RATE_PARAM_FIXED; |
| 525 | |
| 526 | diff --git a/mt7915/dma.c b/mt7915/dma.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 527 | index 4dd321ee..354d1e0e 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 528 | --- a/mt7915/dma.c |
| 529 | +++ b/mt7915/dma.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 530 | @@ -552,8 +552,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 531 | if (ret < 0) |
| 532 | return ret; |
| 533 | |
| 534 | - netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 535 | - mt7915_poll_tx); |
| 536 | + netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 537 | + mt7915_poll_tx, NAPI_POLL_WEIGHT); |
| 538 | napi_enable(&dev->mt76.tx_napi); |
| 539 | |
| 540 | mt7915_dma_enable(dev); |
| 541 | diff --git a/mt7915/init.c b/mt7915/init.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 542 | index 92977b98..25aa44f6 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 543 | --- a/mt7915/init.c |
| 544 | +++ b/mt7915/init.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 545 | @@ -1132,8 +1132,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 546 | mt7915_gen_ppe_thresh(he_cap->ppe_thres, nss); |
| 547 | } else { |
| 548 | he_cap_elem->phy_cap_info[9] |= |
| 549 | - u8_encode_bits(IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US, |
| 550 | - IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK); |
| 551 | + IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US; |
| 552 | } |
| 553 | |
| 554 | if (band == NL80211_BAND_6GHZ) { |
| 555 | diff --git a/mt7915/mac.c b/mt7915/mac.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 556 | index 175498b1..c2e3048c 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 557 | --- a/mt7915/mac.c |
| 558 | +++ b/mt7915/mac.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 559 | @@ -902,7 +902,7 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi) |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 560 | u16 fc, tid; |
| 561 | u32 val; |
| 562 | |
| 563 | - if (!sta || !(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)) |
| 564 | + if (!sta || !(sta->ht_cap.ht_supported || sta->he_cap.has_he)) |
| 565 | return; |
| 566 | |
| 567 | tid = le32_get_bits(txwi[1], MT_TXD1_TID); |
| 568 | diff --git a/mt7915/main.c b/mt7915/main.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 569 | index 5307e15d..ac62f0be 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 570 | --- a/mt7915/main.c |
| 571 | +++ b/mt7915/main.c |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 572 | @@ -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] | 573 | |
| 574 | static int |
| 575 | mt7915_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 576 | - unsigned int link_id, u16 queue, |
| 577 | + u16 queue, |
| 578 | const struct ieee80211_tx_queue_params *params) |
| 579 | { |
| 580 | struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 581 | @@ -618,7 +618,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 582 | static void mt7915_bss_info_changed(struct ieee80211_hw *hw, |
| 583 | struct ieee80211_vif *vif, |
| 584 | struct ieee80211_bss_conf *info, |
| 585 | - u64 changed) |
| 586 | + u32 changed) |
| 587 | { |
| 588 | struct mt7915_phy *phy = mt7915_hw_phy(hw); |
| 589 | struct mt7915_dev *dev = mt7915_hw_dev(hw); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 590 | @@ -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] | 591 | } |
| 592 | |
| 593 | if (changed & BSS_CHANGED_ASSOC) |
| 594 | - mt7915_mcu_add_bss_info(phy, vif, vif->cfg.assoc); |
| 595 | + mt7915_mcu_add_bss_info(phy, vif, info->assoc); |
| 596 | |
| 597 | if (changed & BSS_CHANGED_ERP_CTS_PROT) |
| 598 | mt7915_mac_enable_rtscts(dev, vif, info->use_cts_prot); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 599 | @@ -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] | 600 | { |
| 601 | struct mt7915_phy *phy = mt7915_hw_phy(hw); |
| 602 | struct mt7915_dev *dev = mt7915_hw_dev(hw); |
| 603 | - s16 txpower = sta->deflink.txpwr.power; |
| 604 | + s16 txpower = sta->txpwr.power; |
| 605 | int ret; |
| 606 | |
| 607 | - if (sta->deflink.txpwr.type == NL80211_TX_POWER_AUTOMATIC) |
| 608 | + if (sta->txpwr.type == NL80211_TX_POWER_AUTOMATIC) |
| 609 | txpower = 0; |
| 610 | |
| 611 | mutex_lock(&dev->mt76.mutex); |
| 612 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 613 | index f4867ea7..9005ce2b 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 614 | --- a/mt7915/mcu.c |
| 615 | +++ b/mt7915/mcu.c |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 616 | @@ -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] | 617 | struct mt7915_dev *dev = msta->vif->phy->dev; |
| 618 | enum nl80211_band band = msta->vif->phy->mt76->chandef.chan->band; |
| 619 | const u16 *mask = msta->vif->bitrate_mask.control[band].he_mcs; |
| 620 | - int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss; |
| 621 | + int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss; |
| 622 | |
| 623 | for (nss = 0; nss < max_nss; nss++) { |
| 624 | int mcs; |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 625 | @@ -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] | 626 | |
| 627 | /* only support 2ss on 160MHz for mt7915 */ |
| 628 | if (is_mt7915(&dev->mt76) && nss > 1 && |
| 629 | - sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 630 | + sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 631 | break; |
| 632 | } |
| 633 | |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 634 | @@ -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] | 635 | { |
| 636 | struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; |
| 637 | struct mt7915_dev *dev = msta->vif->phy->dev; |
| 638 | - u16 mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map); |
| 639 | - int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss; |
| 640 | + u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map); |
| 641 | + int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss; |
| 642 | u16 mcs; |
| 643 | |
| 644 | for (nss = 0; nss < max_nss; nss++, mcs_map >>= 2) { |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 645 | @@ -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] | 646 | |
| 647 | /* only support 2ss on 160MHz for mt7915 */ |
| 648 | if (is_mt7915(&dev->mt76) && nss > 1 && |
| 649 | - sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 650 | + sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 651 | break; |
| 652 | } |
| 653 | } |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 654 | @@ -149,10 +149,10 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 655 | mt7915_mcu_set_sta_ht_mcs(struct ieee80211_sta *sta, u8 *ht_mcs, |
| 656 | const u8 *mask) |
| 657 | { |
| 658 | - int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss; |
| 659 | + int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss; |
| 660 | |
| 661 | for (nss = 0; nss < max_nss; nss++) |
| 662 | - ht_mcs[nss] = sta->deflink.ht_cap.mcs.rx_mask[nss] & mask[nss]; |
| 663 | + ht_mcs[nss] = sta->ht_cap.mcs.rx_mask[nss] & mask[nss]; |
| 664 | } |
| 665 | |
| 666 | static int |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 667 | @@ -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] | 668 | static void |
| 669 | mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 670 | { |
| 671 | - if (vif->bss_conf.csa_active) |
| 672 | + if (vif->csa_active) |
| 673 | ieee80211_csa_finish(vif); |
| 674 | } |
| 675 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 676 | @@ -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] | 677 | static void |
| 678 | mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 679 | { |
| 680 | - if (!vif->bss_conf.color_change_active) |
| 681 | + if (!vif->color_change_active) |
| 682 | return; |
| 683 | |
| 684 | ieee80211_color_change_finish(vif); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 685 | @@ -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] | 686 | struct ieee80211_vif *vif) |
| 687 | { |
| 688 | struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
| 689 | - struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem; |
| 690 | + struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem; |
| 691 | struct ieee80211_he_mcs_nss_supp mcs_map; |
| 692 | struct sta_rec_he *he; |
| 693 | struct tlv *tlv; |
| 694 | u32 cap = 0; |
| 695 | |
| 696 | - if (!sta->deflink.he_cap.has_he) |
| 697 | + if (!sta->he_cap.has_he) |
| 698 | return; |
| 699 | |
| 700 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE, sizeof(*he)); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 701 | @@ -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] | 702 | |
| 703 | he->he_cap = cpu_to_le32(cap); |
| 704 | |
| 705 | - mcs_map = sta->deflink.he_cap.he_mcs_nss_supp; |
| 706 | - switch (sta->deflink.bandwidth) { |
| 707 | + mcs_map = sta->he_cap.he_mcs_nss_supp; |
| 708 | + switch (sta->bandwidth) { |
| 709 | case IEEE80211_STA_RX_BW_160: |
| 710 | if (elem->phy_cap_info[0] & |
| 711 | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 712 | @@ -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] | 713 | struct ieee80211_sta *sta, struct ieee80211_vif *vif) |
| 714 | { |
| 715 | struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
| 716 | - struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem; |
| 717 | + struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem; |
| 718 | struct sta_rec_muru *muru; |
| 719 | struct tlv *tlv; |
| 720 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 721 | @@ -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] | 722 | muru->cfg.ofdma_dl_en = !!(dev->dbg.muru_onoff & OFDMA_DL); |
| 723 | muru->cfg.ofdma_ul_en = !!(dev->dbg.muru_onoff & OFDMA_UL); |
| 724 | |
| 725 | - if (sta->deflink.vht_cap.vht_supported) |
| 726 | + if (sta->vht_cap.vht_supported) |
| 727 | muru->mimo_dl.vht_mu_bfee = |
| 728 | - !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); |
| 729 | + !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); |
| 730 | |
| 731 | - if (!sta->deflink.he_cap.has_he) |
| 732 | + if (!sta->he_cap.has_he) |
| 733 | return; |
| 734 | |
| 735 | muru->mimo_dl.partial_bw_dl_mimo = |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 736 | @@ -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] | 737 | struct sta_rec_ht *ht; |
| 738 | struct tlv *tlv; |
| 739 | |
| 740 | - if (!sta->deflink.ht_cap.ht_supported) |
| 741 | + if (!sta->ht_cap.ht_supported) |
| 742 | return; |
| 743 | |
| 744 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht)); |
| 745 | |
| 746 | ht = (struct sta_rec_ht *)tlv; |
| 747 | - ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap); |
| 748 | + ht->ht_cap = cpu_to_le16(sta->ht_cap.cap); |
| 749 | } |
| 750 | |
| 751 | static void |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 752 | @@ -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] | 753 | struct sta_rec_vht *vht; |
| 754 | struct tlv *tlv; |
| 755 | |
| 756 | - if (!sta->deflink.vht_cap.vht_supported) |
| 757 | + if (!sta->vht_cap.vht_supported) |
| 758 | return; |
| 759 | |
| 760 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, sizeof(*vht)); |
| 761 | |
| 762 | vht = (struct sta_rec_vht *)tlv; |
| 763 | - vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); |
| 764 | - vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; |
| 765 | - vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map; |
| 766 | + vht->vht_cap = cpu_to_le32(sta->vht_cap.cap); |
| 767 | + vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map; |
| 768 | + vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map; |
| 769 | } |
| 770 | |
| 771 | static void |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 772 | @@ -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] | 773 | vif->type != NL80211_IFTYPE_AP) |
| 774 | return; |
| 775 | |
| 776 | - if (!sta->deflink.agg.max_amsdu_len) |
| 777 | + if (!sta->max_amsdu_len) |
| 778 | return; |
| 779 | |
| 780 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu)); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 781 | @@ -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] | 782 | amsdu->amsdu_en = true; |
| 783 | msta->wcid.amsdu = true; |
| 784 | |
| 785 | - switch (sta->deflink.agg.max_amsdu_len) { |
| 786 | + switch (sta->max_amsdu_len) { |
| 787 | case IEEE80211_MAX_MPDU_LEN_VHT_11454: |
| 788 | if (!is_mt7915(&dev->mt76)) { |
| 789 | amsdu->max_mpdu_size = |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 790 | @@ -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] | 791 | if (!bfee && tx_ant < 2) |
| 792 | return false; |
| 793 | |
| 794 | - if (sta->deflink.he_cap.has_he) { |
| 795 | - struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem; |
| 796 | + if (sta->he_cap.has_he) { |
| 797 | + struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem; |
| 798 | |
| 799 | if (bfee) |
| 800 | return mvif->cap.he_su_ebfee && |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 801 | @@ -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] | 802 | HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]); |
| 803 | } |
| 804 | |
| 805 | - if (sta->deflink.vht_cap.vht_supported) { |
| 806 | - u32 cap = sta->deflink.vht_cap.cap; |
| 807 | + if (sta->vht_cap.vht_supported) { |
| 808 | + u32 cap = sta->vht_cap.cap; |
| 809 | |
| 810 | if (bfee) |
| 811 | return mvif->cap.vht_su_ebfee && |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 812 | @@ -1098,7 +1098,7 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 813 | mt7915_mcu_sta_bfer_ht(struct ieee80211_sta *sta, struct mt7915_phy *phy, |
| 814 | struct sta_rec_bf *bf) |
| 815 | { |
| 816 | - struct ieee80211_mcs_info *mcs = &sta->deflink.ht_cap.mcs; |
| 817 | + struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs; |
| 818 | u8 n = 0; |
| 819 | |
| 820 | bf->tx_mode = MT_PHY_TYPE_HT; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 821 | @@ -1123,7 +1123,7 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 822 | mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy, |
| 823 | struct sta_rec_bf *bf, bool explicit) |
| 824 | { |
| 825 | - struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap; |
| 826 | + struct ieee80211_sta_vht_cap *pc = &sta->vht_cap; |
| 827 | struct ieee80211_sta_vht_cap *vc = &phy->mt76->sband_5g.sband.vht_cap; |
| 828 | u16 mcs_map = le16_to_cpu(pc->vht_mcs.rx_mcs_map); |
| 829 | u8 nss_mcs = mt7915_mcu_get_sta_nss(mcs_map); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 830 | @@ -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] | 831 | bf->ncol = min_t(u8, nss_mcs, bf->nrow); |
| 832 | bf->ibf_ncol = bf->ncol; |
| 833 | |
| 834 | - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 835 | + if (sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 836 | bf->nrow = 1; |
| 837 | } else { |
| 838 | bf->nrow = tx_ant; |
| 839 | bf->ncol = min_t(u8, nss_mcs, bf->nrow); |
| 840 | bf->ibf_ncol = nss_mcs; |
| 841 | |
| 842 | - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 843 | + if (sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 844 | bf->ibf_nrow = 1; |
| 845 | } |
| 846 | } |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 847 | @@ -1160,7 +1160,7 @@ static void |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 848 | mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif, |
| 849 | struct mt7915_phy *phy, struct sta_rec_bf *bf) |
| 850 | { |
| 851 | - struct ieee80211_sta_he_cap *pc = &sta->deflink.he_cap; |
| 852 | + struct ieee80211_sta_he_cap *pc = &sta->he_cap; |
| 853 | struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem; |
| 854 | const struct ieee80211_sta_he_cap *vc = |
| 855 | mt76_connac_get_he_phy_cap(phy->mt76, vif); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 856 | @@ -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] | 857 | bf->ncol = min_t(u8, nss_mcs, bf->nrow); |
| 858 | bf->ibf_ncol = bf->ncol; |
| 859 | |
| 860 | - if (sta->deflink.bandwidth != IEEE80211_STA_RX_BW_160) |
| 861 | + if (sta->bandwidth != IEEE80211_STA_RX_BW_160) |
| 862 | return; |
| 863 | |
| 864 | /* go over for 160MHz and 80p80 */ |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 865 | @@ -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] | 866 | }; |
| 867 | bool ebf; |
| 868 | |
| 869 | - if (!(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)) |
| 870 | + if (!(sta->ht_cap.ht_supported || sta->he_cap.has_he)) |
| 871 | return; |
| 872 | |
| 873 | ebf = mt7915_is_ebf_supported(phy, vif, sta, false); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 874 | @@ -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] | 875 | * vht: support eBF and iBF |
| 876 | * ht: iBF only, since mac80211 lacks of eBF support |
| 877 | */ |
| 878 | - if (sta->deflink.he_cap.has_he && ebf) |
| 879 | + if (sta->he_cap.has_he && ebf) |
| 880 | mt7915_mcu_sta_bfer_he(sta, vif, phy, bf); |
| 881 | - else if (sta->deflink.vht_cap.vht_supported) |
| 882 | + else if (sta->vht_cap.vht_supported) |
| 883 | mt7915_mcu_sta_bfer_vht(sta, phy, bf, ebf); |
| 884 | - else if (sta->deflink.ht_cap.ht_supported) |
| 885 | + else if (sta->ht_cap.ht_supported) |
| 886 | mt7915_mcu_sta_bfer_ht(sta, phy, bf); |
| 887 | else |
| 888 | return; |
| 889 | |
| 890 | bf->bf_cap = ebf ? ebf : dev->ibf << 1; |
| 891 | - bf->bw = sta->deflink.bandwidth; |
| 892 | - bf->ibf_dbw = sta->deflink.bandwidth; |
| 893 | + bf->bw = sta->bandwidth; |
| 894 | + bf->ibf_dbw = sta->bandwidth; |
| 895 | bf->ibf_nrow = tx_ant; |
| 896 | |
| 897 | - if (!ebf && sta->deflink.bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol) |
| 898 | + if (!ebf && sta->bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol) |
| 899 | bf->ibf_timeout = 0x48; |
| 900 | else |
| 901 | bf->ibf_timeout = 0x18; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 902 | @@ -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] | 903 | else |
| 904 | bf->mem_20m = matrix[bf->nrow][bf->ncol]; |
| 905 | |
| 906 | - switch (sta->deflink.bandwidth) { |
| 907 | + switch (sta->bandwidth) { |
| 908 | case IEEE80211_STA_RX_BW_160: |
| 909 | case IEEE80211_STA_RX_BW_80: |
| 910 | bf->mem_total = bf->mem_20m * 2; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 911 | @@ -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] | 912 | struct tlv *tlv; |
| 913 | u8 nrow = 0; |
| 914 | |
| 915 | - if (!(sta->deflink.vht_cap.vht_supported || sta->deflink.he_cap.has_he)) |
| 916 | + if (!(sta->vht_cap.vht_supported || sta->he_cap.has_he)) |
| 917 | return; |
| 918 | |
| 919 | if (!mt7915_is_ebf_supported(phy, vif, sta, true)) |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 920 | @@ -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] | 921 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_BFEE, sizeof(*bfee)); |
| 922 | bfee = (struct sta_rec_bfee *)tlv; |
| 923 | |
| 924 | - if (sta->deflink.he_cap.has_he) { |
| 925 | - struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem; |
| 926 | + if (sta->he_cap.has_he) { |
| 927 | + struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem; |
| 928 | |
| 929 | nrow = HE_PHY(CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK, |
| 930 | pe->phy_cap_info[5]); |
| 931 | - } else if (sta->deflink.vht_cap.vht_supported) { |
| 932 | - struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap; |
| 933 | + } else if (sta->vht_cap.vht_supported) { |
| 934 | + struct ieee80211_sta_vht_cap *pc = &sta->vht_cap; |
| 935 | |
| 936 | nrow = FIELD_GET(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK, |
| 937 | pc->cap); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 938 | @@ -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] | 939 | ra->phy = *phy; |
| 940 | break; |
| 941 | case RATE_PARAM_MMPS_UPDATE: |
| 942 | - ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode); |
| 943 | + ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode); |
| 944 | break; |
| 945 | case RATE_PARAM_SPE_UPDATE: |
| 946 | ra->spe_idx = *(u8 *)data; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 947 | @@ -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] | 948 | do { \ |
| 949 | u8 i, gi = mask->control[band]._gi; \ |
| 950 | gi = (_he) ? gi : gi == NL80211_TXRATE_FORCE_SGI; \ |
| 951 | - for (i = 0; i <= sta->deflink.bandwidth; i++) { \ |
| 952 | + for (i = 0; i <= sta->bandwidth; i++) { \ |
| 953 | phy.sgi |= gi << (i << (_he)); \ |
| 954 | phy.he_ltf |= mask->control[band].he_ltf << (i << (_he));\ |
| 955 | } \ |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 956 | @@ -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] | 957 | } \ |
| 958 | } while (0) |
| 959 | |
| 960 | - if (sta->deflink.he_cap.has_he) { |
| 961 | + if (sta->he_cap.has_he) { |
| 962 | __sta_phy_bitrate_mask_check(he_mcs, he_gi, 0, 1); |
| 963 | - } else if (sta->deflink.vht_cap.vht_supported) { |
| 964 | + } else if (sta->vht_cap.vht_supported) { |
| 965 | __sta_phy_bitrate_mask_check(vht_mcs, gi, 0, 0); |
| 966 | - } else if (sta->deflink.ht_cap.ht_supported) { |
| 967 | + } else if (sta->ht_cap.ht_supported) { |
| 968 | __sta_phy_bitrate_mask_check(ht_mcs, gi, 1, 0); |
| 969 | } else { |
| 970 | nrates = hweight32(mask->control[band].legacy); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 971 | @@ -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] | 972 | * actual txrate hardware sends out. |
| 973 | */ |
| 974 | addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 7); |
| 975 | - if (sta->deflink.he_cap.has_he) |
| 976 | + if (sta->he_cap.has_he) |
| 977 | mt76_rmw_field(dev, addr, GENMASK(31, 24), phy.sgi); |
| 978 | else |
| 979 | mt76_rmw_field(dev, addr, GENMASK(15, 12), phy.sgi); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 980 | @@ -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] | 981 | enum nl80211_band band = chandef->chan->band; |
| 982 | struct sta_rec_ra *ra; |
| 983 | struct tlv *tlv; |
| 984 | - u32 supp_rate = sta->deflink.supp_rates[band]; |
| 985 | + u32 supp_rate = sta->supp_rates[band]; |
| 986 | u32 cap = sta->wme ? STA_CAP_WMM : 0; |
| 987 | |
| 988 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra)); |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 989 | @@ -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] | 990 | ra->auto_rate = true; |
| 991 | ra->phy_mode = mt76_connac_get_phy_mode(mphy, vif, band, sta); |
| 992 | ra->channel = chandef->chan->hw_value; |
| 993 | - ra->bw = sta->deflink.bandwidth; |
| 994 | - ra->phy.bw = sta->deflink.bandwidth; |
| 995 | - ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode); |
| 996 | + ra->bw = sta->bandwidth; |
| 997 | + ra->phy.bw = sta->bandwidth; |
| 998 | + ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode); |
| 999 | |
| 1000 | if (supp_rate) { |
| 1001 | supp_rate &= mask->control[band].legacy; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1002 | @@ -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] | 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | - if (sta->deflink.ht_cap.ht_supported) { |
| 1007 | + if (sta->ht_cap.ht_supported) { |
| 1008 | ra->supp_mode |= MODE_HT; |
| 1009 | - ra->af = sta->deflink.ht_cap.ampdu_factor; |
| 1010 | - ra->ht_gf = !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD); |
| 1011 | + ra->af = sta->ht_cap.ampdu_factor; |
| 1012 | + ra->ht_gf = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD); |
| 1013 | |
| 1014 | cap |= STA_CAP_HT; |
| 1015 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 1016 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 1017 | cap |= STA_CAP_SGI_20; |
| 1018 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 1019 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 1020 | cap |= STA_CAP_SGI_40; |
| 1021 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_TX_STBC) |
| 1022 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC) |
| 1023 | cap |= STA_CAP_TX_STBC; |
| 1024 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC) |
| 1025 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC) |
| 1026 | cap |= STA_CAP_RX_STBC; |
| 1027 | if (mvif->cap.ht_ldpc && |
| 1028 | - (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING)) |
| 1029 | + (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING)) |
| 1030 | cap |= STA_CAP_LDPC; |
| 1031 | |
| 1032 | mt7915_mcu_set_sta_ht_mcs(sta, ra->ht_mcs, |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1033 | @@ -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] | 1034 | ra->supp_ht_mcs = *(__le32 *)ra->ht_mcs; |
| 1035 | } |
| 1036 | |
| 1037 | - if (sta->deflink.vht_cap.vht_supported) { |
| 1038 | + if (sta->vht_cap.vht_supported) { |
| 1039 | u8 af; |
| 1040 | |
| 1041 | ra->supp_mode |= MODE_VHT; |
| 1042 | af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK, |
| 1043 | - sta->deflink.vht_cap.cap); |
| 1044 | + sta->vht_cap.cap); |
| 1045 | ra->af = max_t(u8, ra->af, af); |
| 1046 | |
| 1047 | cap |= STA_CAP_VHT; |
| 1048 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 1049 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 1050 | cap |= STA_CAP_VHT_SGI_80; |
| 1051 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 1052 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 1053 | cap |= STA_CAP_VHT_SGI_160; |
| 1054 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC) |
| 1055 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC) |
| 1056 | cap |= STA_CAP_VHT_TX_STBC; |
| 1057 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1) |
| 1058 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1) |
| 1059 | cap |= STA_CAP_VHT_RX_STBC; |
| 1060 | if (mvif->cap.vht_ldpc && |
| 1061 | - (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC)) |
| 1062 | + (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC)) |
| 1063 | cap |= STA_CAP_VHT_LDPC; |
| 1064 | |
| 1065 | mt7915_mcu_set_sta_vht_mcs(sta, ra->supp_vht_mcs, |
| 1066 | mask->control[band].vht_mcs); |
| 1067 | } |
| 1068 | |
| 1069 | - if (sta->deflink.he_cap.has_he) { |
| 1070 | + if (sta->he_cap.has_he) { |
| 1071 | ra->supp_mode |= MODE_HE; |
| 1072 | cap |= STA_CAP_HE; |
| 1073 | |
| 1074 | - if (sta->deflink.he_6ghz_capa.capa) |
| 1075 | - ra->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa, |
| 1076 | + if (sta->he_6ghz_capa.capa) |
| 1077 | + ra->af = le16_get_bits(sta->he_6ghz_capa.capa, |
| 1078 | IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP); |
| 1079 | } |
| 1080 | |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1081 | @@ -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] | 1082 | if (!offs->cntdwn_counter_offs[0]) |
| 1083 | return; |
| 1084 | |
| 1085 | - sub_tag = vif->bss_conf.csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC; |
| 1086 | + sub_tag = vif->csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC; |
| 1087 | tlv = mt7915_mcu_add_nested_subtlv(rskb, sub_tag, sizeof(*info), |
| 1088 | &bcn->sub_ntlv, &bcn->len); |
| 1089 | info = (struct bss_info_bcn_cntdwn *)tlv; |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1090 | @@ -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] | 1091 | if (offs->cntdwn_counter_offs[0]) { |
| 1092 | u16 offset = offs->cntdwn_counter_offs[0]; |
| 1093 | |
| 1094 | - if (vif->bss_conf.csa_active) |
| 1095 | + if (vif->csa_active) |
| 1096 | cont->csa_ofs = cpu_to_le16(offset - 4); |
| 1097 | - if (vif->bss_conf.color_change_active) |
| 1098 | + if (vif->color_change_active) |
| 1099 | cont->bcc_ofs = cpu_to_le16(offset - 3); |
| 1100 | } |
| 1101 | |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 1102 | @@ -2093,7 +2093,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] | 1103 | if (!en) |
| 1104 | goto out; |
| 1105 | |
| 1106 | - skb = ieee80211_beacon_get_template(hw, vif, &offs, 0); |
| 1107 | + skb = ieee80211_beacon_get_template(hw, vif, &offs); |
| 1108 | if (!skb) |
| 1109 | return -EINVAL; |
| 1110 | |
developer | c04f540 | 2023-02-03 09:22:26 +0800 | [diff] [blame^] | 1111 | @@ -3354,17 +3354,17 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy, |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1112 | if (txpower) { |
| 1113 | u32 offs, len, i; |
| 1114 | |
| 1115 | - if (sta->deflink.ht_cap.ht_supported) { |
| 1116 | + if (sta->ht_cap.ht_supported) { |
| 1117 | const u8 *sku_len = mt7915_sku_group_len; |
| 1118 | |
| 1119 | offs = sku_len[SKU_CCK] + sku_len[SKU_OFDM]; |
| 1120 | len = sku_len[SKU_HT_BW20] + sku_len[SKU_HT_BW40]; |
| 1121 | |
| 1122 | - if (sta->deflink.vht_cap.vht_supported) { |
| 1123 | + if (sta->vht_cap.vht_supported) { |
| 1124 | offs += len; |
| 1125 | len = sku_len[SKU_VHT_BW20] * 4; |
| 1126 | |
| 1127 | - if (sta->deflink.he_cap.has_he) { |
| 1128 | + if (sta->he_cap.has_he) { |
| 1129 | offs += len + sku_len[SKU_HE_RU26] * 3; |
| 1130 | len = sku_len[SKU_HE_RU242] * 4; |
| 1131 | } |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 1132 | diff --git a/mt7915/testmode.c b/mt7915/testmode.c |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 1133 | index e4af5e1c..19dfb354 100644 |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 1134 | --- a/mt7915/testmode.c |
| 1135 | +++ b/mt7915/testmode.c |
developer | 1346ce5 | 2022-12-15 21:36:14 +0800 | [diff] [blame] | 1136 | @@ -397,12 +397,12 @@ mt7915_tm_entry_add(struct mt7915_phy *phy, u8 aid) |
| 1137 | memcpy(sta->addr, td->addr[0], ETH_ALEN); |
developer | fe7be7f | 2022-12-13 21:40:24 +0800 | [diff] [blame] | 1138 | |
| 1139 | if (td->tx_rate_mode >= MT76_TM_TX_MODE_HT) |
| 1140 | - memcpy(&sta->deflink.ht_cap, &sband->ht_cap, sizeof(sta->deflink.ht_cap)); |
| 1141 | + memcpy(&sta->ht_cap, &sband->ht_cap, sizeof(sta->ht_cap)); |
| 1142 | if (td->tx_rate_mode >= MT76_TM_TX_MODE_VHT) |
| 1143 | - memcpy(&sta->deflink.vht_cap, &sband->vht_cap, sizeof(sta->deflink.vht_cap)); |
| 1144 | + memcpy(&sta->vht_cap, &sband->vht_cap, sizeof(sta->vht_cap)); |
| 1145 | if (td->tx_rate_mode >= MT76_TM_TX_MODE_HE_SU) |
| 1146 | - memcpy(&sta->deflink.he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap, |
| 1147 | - sizeof(sta->deflink.he_cap)); |
| 1148 | + memcpy(&sta->he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap, |
| 1149 | + sizeof(sta->he_cap)); |
| 1150 | sta->aid = aid; |
| 1151 | sta->wme = 1; |
| 1152 | |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1153 | diff --git a/tx.c b/tx.c |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 1154 | index a72b7779..04b6f2e7 100644 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1155 | --- a/tx.c |
| 1156 | +++ b/tx.c |
| 1157 | @@ -60,20 +60,15 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list) |
| 1158 | .skb = skb, |
| 1159 | .info = IEEE80211_SKB_CB(skb), |
| 1160 | }; |
| 1161 | - struct ieee80211_rate_status rs = {}; |
| 1162 | struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb); |
| 1163 | struct mt76_wcid *wcid; |
| 1164 | |
| 1165 | wcid = rcu_dereference(dev->wcid[cb->wcid]); |
| 1166 | if (wcid) { |
| 1167 | status.sta = wcid_to_sta(wcid); |
| 1168 | - if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { |
| 1169 | - rs.rate_idx = wcid->rate; |
| 1170 | - status.rates = &rs; |
| 1171 | - status.n_rates = 1; |
| 1172 | - } else { |
| 1173 | - status.n_rates = 0; |
| 1174 | - } |
| 1175 | + |
| 1176 | + if (status.sta) |
| 1177 | + status.rate = &wcid->rate; |
| 1178 | } |
| 1179 | |
| 1180 | hw = mt76_tx_status_get_hw(dev, skb); |
| 1181 | -- |
developer | 61526b7 | 2022-12-30 11:15:01 +0800 | [diff] [blame] | 1182 | 2.18.0 |
developer | eb6a018 | 2022-12-12 18:53:32 +0800 | [diff] [blame] | 1183 | |