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