developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 1 | From 87cc43ed074bca81b765e0961bd24da23f6e997e Mon Sep 17 00:00:00 2001 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 2 | From: Evelyn Tsai <evelyn.tsai@mediatek.com> |
| 3 | Date: Wed, 5 Apr 2023 08:29:19 +0800 |
developer | 23d6e27 | 2023-08-28 11:10:51 +0800 | [diff] [blame] | 4 | Subject: [PATCH] mt76: revert for backports-5.15 wireless stack |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 5 | |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 6 | wifi: mt76: mt7915: add support for he ldpc control from hostapd |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 7 | --- |
| 8 | dma.c | 2 +- |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 9 | mac80211.c | 15 +-- |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 10 | mt7615/dma.c | 4 +- |
| 11 | mt7615/main.c | 6 +- |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 12 | mt7615/mcu.c | 8 +- |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 13 | mt76_connac_mac.c | 2 +- |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 14 | mt76_connac_mcu.c | 117 ++++++++++------------ |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 15 | mt76x02_mac.c | 6 +- |
| 16 | mt7915/debugfs.c | 4 +- |
| 17 | mt7915/dma.c | 4 +- |
| 18 | mt7915/init.c | 3 +- |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 19 | mt7915/main.c | 36 ++----- |
| 20 | mt7915/mcu.c | 246 ++++++++++++++++++++++++++++++---------------- |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 21 | mt7915/mmio.c | 2 +- |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 22 | mt7915/testmode.c | 8 +- |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 23 | tx.c | 22 ++--- |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 24 | 16 files changed, 259 insertions(+), 226 deletions(-) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 25 | |
| 26 | diff --git a/dma.c b/dma.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 27 | index 7c5e623c..908852c0 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 28 | --- a/dma.c |
| 29 | +++ b/dma.c |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 30 | @@ -996,7 +996,7 @@ mt76_dma_init(struct mt76_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 31 | init_completion(&dev->mmio.wed_reset_complete); |
| 32 | |
| 33 | mt76_for_each_q_rx(dev, i) { |
| 34 | - netif_napi_add(&dev->napi_dev, &dev->napi[i], poll); |
| 35 | + netif_napi_add(&dev->napi_dev, &dev->napi[i], poll, 64); |
| 36 | mt76_dma_rx_fill(dev, &dev->q_rx[i]); |
| 37 | napi_enable(&dev->napi[i]); |
| 38 | } |
| 39 | diff --git a/mac80211.c b/mac80211.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 40 | index 62325345..137c5204 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 41 | --- a/mac80211.c |
| 42 | +++ b/mac80211.c |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 43 | @@ -1046,14 +1046,9 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb, |
| 44 | status->enc_flags = mstat.enc_flags; |
| 45 | status->encoding = mstat.encoding; |
| 46 | status->bw = mstat.bw; |
| 47 | - if (status->encoding == RX_ENC_EHT) { |
| 48 | - status->eht.ru = mstat.eht.ru; |
| 49 | - status->eht.gi = mstat.eht.gi; |
| 50 | - } else { |
| 51 | - status->he_ru = mstat.he_ru; |
| 52 | - status->he_gi = mstat.he_gi; |
| 53 | - status->he_dcm = mstat.he_dcm; |
| 54 | - } |
| 55 | + status->he_ru = mstat.he_ru; |
| 56 | + status->he_gi = mstat.he_gi; |
| 57 | + status->he_dcm = mstat.he_dcm; |
| 58 | status->rate_idx = mstat.rate_idx; |
| 59 | status->nss = mstat.nss; |
| 60 | status->band = mstat.band; |
| 61 | @@ -1573,7 +1568,7 @@ EXPORT_SYMBOL_GPL(mt76_get_sar_power); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 62 | static void |
| 63 | __mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 64 | { |
| 65 | - if (vif->bss_conf.csa_active && ieee80211_beacon_cntdwn_is_complete(vif)) |
| 66 | + if (vif->csa_active && ieee80211_beacon_cntdwn_is_complete(vif)) |
| 67 | ieee80211_csa_finish(vif); |
| 68 | } |
| 69 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 70 | @@ -1595,7 +1590,7 @@ __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 71 | { |
| 72 | struct mt76_dev *dev = priv; |
| 73 | |
| 74 | - if (!vif->bss_conf.csa_active) |
| 75 | + if (!vif->csa_active) |
| 76 | return; |
| 77 | |
| 78 | dev->csa_complete |= ieee80211_beacon_cntdwn_is_complete(vif); |
| 79 | diff --git a/mt7615/dma.c b/mt7615/dma.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 80 | index 0ce01ccc..ad324850 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 81 | --- a/mt7615/dma.c |
| 82 | +++ b/mt7615/dma.c |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 83 | @@ -282,8 +282,8 @@ int mt7615_dma_init(struct mt7615_dev *dev) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 84 | if (ret < 0) |
| 85 | return ret; |
| 86 | |
| 87 | - netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 88 | - mt7615_poll_tx); |
| 89 | + netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 90 | + mt7615_poll_tx, NAPI_POLL_WEIGHT); |
| 91 | napi_enable(&dev->mt76.tx_napi); |
| 92 | |
| 93 | mt76_poll(dev, MT_WPDMA_GLO_CFG, |
| 94 | diff --git a/mt7615/main.c b/mt7615/main.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 95 | index dab16b5f..d32a7520 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 96 | --- a/mt7615/main.c |
| 97 | +++ b/mt7615/main.c |
developer | 22eedcc | 2023-05-03 22:59:35 +0800 | [diff] [blame] | 98 | @@ -473,7 +473,7 @@ static int mt7615_config(struct ieee80211_hw *hw, u32 changed) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 99 | |
| 100 | static int |
| 101 | mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 102 | - unsigned int link_id, u16 queue, |
| 103 | + u16 queue, |
| 104 | const struct ieee80211_tx_queue_params *params) |
| 105 | { |
| 106 | struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv; |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 107 | @@ -581,7 +581,7 @@ mt7615_update_mu_group(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 108 | static void mt7615_bss_info_changed(struct ieee80211_hw *hw, |
| 109 | struct ieee80211_vif *vif, |
| 110 | struct ieee80211_bss_conf *info, |
| 111 | - u64 changed) |
| 112 | + u32 changed) |
| 113 | { |
| 114 | struct mt7615_dev *dev = mt7615_hw_dev(hw); |
| 115 | struct mt7615_phy *phy = mt7615_hw_phy(hw); |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 116 | @@ -624,7 +624,7 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | if (changed & BSS_CHANGED_ASSOC) |
| 120 | - mt7615_mac_set_beacon_filter(phy, vif, vif->cfg.assoc); |
| 121 | + mt7615_mac_set_beacon_filter(phy, vif, info->assoc); |
| 122 | |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 123 | if (changed & BSS_CHANGED_MU_GROUPS) |
| 124 | mt7615_update_mu_group(hw, vif, info); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 125 | diff --git a/mt7615/mcu.c b/mt7615/mcu.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 126 | index db337aad..c4d97434 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 127 | --- a/mt7615/mcu.c |
| 128 | +++ b/mt7615/mcu.c |
| 129 | @@ -353,7 +353,7 @@ out: |
| 130 | static void |
| 131 | mt7615_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 132 | { |
| 133 | - if (vif->bss_conf.csa_active) |
| 134 | + if (vif->csa_active) |
| 135 | ieee80211_csa_finish(vif); |
| 136 | } |
| 137 | |
| 138 | @@ -699,7 +699,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev, |
| 139 | if (!enable) |
| 140 | goto out; |
| 141 | |
| 142 | - skb = ieee80211_beacon_get_template(hw, vif, &offs, 0); |
| 143 | + skb = ieee80211_beacon_get_template(hw, vif, &offs); |
| 144 | if (!skb) |
| 145 | return -EINVAL; |
| 146 | |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 147 | @@ -1075,7 +1075,7 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 148 | if (!enable) |
| 149 | goto out; |
| 150 | |
| 151 | - skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs, 0); |
| 152 | + skb = ieee80211_beacon_get_template(mt76_hw(dev), vif, &offs); |
| 153 | if (!skb) |
| 154 | return -EINVAL; |
| 155 | |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 156 | @@ -2526,7 +2526,7 @@ int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 157 | u8 pad; |
| 158 | } req = { |
| 159 | .bss_idx = mvif->mt76.idx, |
| 160 | - .aid = cpu_to_le16(vif->cfg.aid), |
| 161 | + .aid = cpu_to_le16(vif->bss_conf.aid), |
| 162 | .dtim_period = vif->bss_conf.dtim_period, |
| 163 | .bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int), |
| 164 | }; |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 165 | diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 166 | index 02d52328..faeae26d 100644 |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 167 | --- a/mt76_connac_mac.c |
| 168 | +++ b/mt76_connac_mac.c |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 169 | @@ -1110,7 +1110,7 @@ void mt76_connac2_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi) |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 170 | u32 val; |
| 171 | |
| 172 | if (!sta || |
| 173 | - !(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)) |
| 174 | + !(sta->ht_cap.ht_supported || sta->he_cap.has_he)) |
| 175 | return; |
| 176 | |
| 177 | tid = le32_get_bits(txwi[1], MT_TXD1_TID); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 178 | diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 179 | index 07bd57b8..aa99bd78 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 180 | --- a/mt76_connac_mcu.c |
| 181 | +++ b/mt76_connac_mcu.c |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 182 | @@ -198,7 +198,7 @@ int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 183 | */ |
| 184 | } req = { |
| 185 | .bss_idx = mvif->idx, |
| 186 | - .ps_state = vif->cfg.ps ? 2 : 0, |
| 187 | + .ps_state = vif->bss_conf.ps ? 2 : 0, |
| 188 | }; |
| 189 | |
| 190 | if (vif->type != NL80211_IFTYPE_STATION) |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 191 | @@ -410,7 +410,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 192 | else |
| 193 | conn_type = CONNECTION_INFRA_AP; |
| 194 | basic->conn_type = cpu_to_le32(conn_type); |
| 195 | - basic->aid = cpu_to_le16(vif->cfg.aid); |
| 196 | + basic->aid = cpu_to_le16(vif->bss_conf.aid); |
| 197 | break; |
| 198 | case NL80211_IFTYPE_ADHOC: |
| 199 | basic->conn_type = cpu_to_le32(CONNECTION_IBSS_ADHOC); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 200 | @@ -554,7 +554,7 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 201 | |
| 202 | if (sta) { |
| 203 | if (vif->type == NL80211_IFTYPE_STATION) |
| 204 | - generic->partial_aid = cpu_to_le16(vif->cfg.aid); |
| 205 | + generic->partial_aid = cpu_to_le16(vif->bss_conf.aid); |
| 206 | else |
| 207 | generic->partial_aid = cpu_to_le16(sta->aid); |
| 208 | memcpy(generic->peer_addr, sta->addr, ETH_ALEN); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 209 | @@ -603,14 +603,14 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 210 | vif->type != NL80211_IFTYPE_STATION) |
| 211 | return; |
| 212 | |
| 213 | - if (!sta->deflink.agg.max_amsdu_len) |
| 214 | + if (!sta->max_amsdu_len) |
| 215 | return; |
| 216 | |
| 217 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu)); |
| 218 | amsdu = (struct sta_rec_amsdu *)tlv; |
| 219 | amsdu->max_amsdu_num = 8; |
| 220 | amsdu->amsdu_en = true; |
| 221 | - amsdu->max_mpdu_size = sta->deflink.agg.max_amsdu_len >= |
| 222 | + amsdu->max_mpdu_size = sta->max_amsdu_len >= |
| 223 | IEEE80211_MAX_MPDU_LEN_VHT_7991; |
| 224 | |
| 225 | wcid->amsdu = true; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 226 | @@ -621,7 +621,7 @@ mt76_connac_mcu_sta_amsdu_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 227 | static void |
| 228 | mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
| 229 | { |
| 230 | - struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; |
| 231 | + struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; |
| 232 | struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; |
| 233 | struct sta_rec_he *he; |
| 234 | struct tlv *tlv; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 235 | @@ -709,7 +709,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 236 | |
| 237 | he->he_cap = cpu_to_le32(cap); |
| 238 | |
| 239 | - switch (sta->deflink.bandwidth) { |
| 240 | + switch (sta->bandwidth) { |
| 241 | case IEEE80211_STA_RX_BW_160: |
| 242 | if (elem->phy_cap_info[0] & |
| 243 | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 244 | @@ -754,7 +754,7 @@ mt76_connac_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
| 245 | void |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 246 | mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta) |
| 247 | { |
| 248 | - struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; |
| 249 | + struct ieee80211_sta_he_cap *he_cap = &sta->he_cap; |
| 250 | struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; |
| 251 | struct sta_rec_he_v2 *he; |
| 252 | struct tlv *tlv; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 253 | @@ -765,7 +765,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 254 | memcpy(he->he_phy_cap, elem->phy_cap_info, sizeof(he->he_phy_cap)); |
| 255 | memcpy(he->he_mac_cap, elem->mac_cap_info, sizeof(he->he_mac_cap)); |
| 256 | |
| 257 | - switch (sta->deflink.bandwidth) { |
| 258 | + switch (sta->bandwidth) { |
| 259 | case IEEE80211_STA_RX_BW_160: |
| 260 | if (elem->phy_cap_info[0] & |
| 261 | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 262 | @@ -781,7 +781,7 @@ mt76_connac_mcu_sta_he_tlv_v2(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 263 | break; |
| 264 | } |
| 265 | |
| 266 | - he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US; |
| 267 | + he->pkt_ext = IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US; |
| 268 | } |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 269 | EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_he_tlv_v2); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 270 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 271 | @@ -792,14 +792,12 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, |
| 272 | struct ieee80211_sta_ht_cap *ht_cap; |
| 273 | struct ieee80211_sta_vht_cap *vht_cap; |
| 274 | const struct ieee80211_sta_he_cap *he_cap; |
| 275 | - const struct ieee80211_sta_eht_cap *eht_cap; |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 276 | u8 mode = 0; |
| 277 | |
| 278 | if (sta) { |
| 279 | - ht_cap = &sta->deflink.ht_cap; |
| 280 | - vht_cap = &sta->deflink.vht_cap; |
| 281 | - he_cap = &sta->deflink.he_cap; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 282 | - eht_cap = &sta->deflink.eht_cap; |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 283 | + ht_cap = &sta->ht_cap; |
| 284 | + vht_cap = &sta->vht_cap; |
| 285 | + he_cap = &sta->he_cap; |
| 286 | } else { |
| 287 | struct ieee80211_supported_band *sband; |
| 288 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 289 | @@ -807,7 +805,6 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, |
| 290 | ht_cap = &sband->ht_cap; |
| 291 | vht_cap = &sband->vht_cap; |
| 292 | he_cap = ieee80211_get_he_iftype_cap(sband, vif->type); |
| 293 | - eht_cap = ieee80211_get_eht_iftype_cap(sband, vif->type); |
| 294 | } |
| 295 | |
| 296 | if (band == NL80211_BAND_2GHZ) { |
| 297 | @@ -818,9 +815,6 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, |
| 298 | |
| 299 | if (he_cap && he_cap->has_he) |
| 300 | mode |= PHY_TYPE_BIT_HE; |
| 301 | - |
| 302 | - if (eht_cap && eht_cap->has_eht) |
| 303 | - mode |= PHY_TYPE_BIT_BE; |
| 304 | } else if (band == NL80211_BAND_5GHZ || band == NL80211_BAND_6GHZ) { |
| 305 | mode |= PHY_TYPE_BIT_OFDM; |
| 306 | |
| 307 | @@ -832,9 +826,6 @@ mt76_connac_get_phy_mode_v2(struct mt76_phy *mphy, struct ieee80211_vif *vif, |
| 308 | |
| 309 | if (he_cap && he_cap->has_he) |
| 310 | mode |= PHY_TYPE_BIT_HE; |
| 311 | - |
| 312 | - if (eht_cap && eht_cap->has_eht) |
| 313 | - mode |= PHY_TYPE_BIT_BE; |
| 314 | } |
| 315 | |
| 316 | return mode; |
| 317 | @@ -858,25 +849,25 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 318 | u16 supp_rates; |
| 319 | |
| 320 | /* starec ht */ |
| 321 | - if (sta->deflink.ht_cap.ht_supported) { |
| 322 | + if (sta->ht_cap.ht_supported) { |
| 323 | struct sta_rec_ht *ht; |
| 324 | |
| 325 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht)); |
| 326 | ht = (struct sta_rec_ht *)tlv; |
| 327 | - ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap); |
| 328 | + ht->ht_cap = cpu_to_le16(sta->ht_cap.cap); |
| 329 | } |
| 330 | |
| 331 | /* starec vht */ |
| 332 | - if (sta->deflink.vht_cap.vht_supported) { |
| 333 | + if (sta->vht_cap.vht_supported) { |
| 334 | struct sta_rec_vht *vht; |
| 335 | int len; |
| 336 | |
| 337 | len = is_mt7921(dev) ? sizeof(*vht) : sizeof(*vht) - 4; |
| 338 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, len); |
| 339 | vht = (struct sta_rec_vht *)tlv; |
| 340 | - vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); |
| 341 | - vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; |
| 342 | - vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map; |
| 343 | + vht->vht_cap = cpu_to_le32(sta->vht_cap.cap); |
| 344 | + vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map; |
| 345 | + vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map; |
| 346 | } |
| 347 | |
| 348 | /* starec uapsd */ |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 349 | @@ -885,11 +876,11 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 350 | if (!is_mt7921(dev)) |
| 351 | return; |
| 352 | |
| 353 | - if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he) |
| 354 | + if (sta->ht_cap.ht_supported || sta->he_cap.has_he) |
| 355 | mt76_connac_mcu_sta_amsdu_tlv(skb, sta, vif); |
| 356 | |
| 357 | /* starec he */ |
| 358 | - if (sta->deflink.he_cap.has_he) { |
| 359 | + if (sta->he_cap.has_he) { |
| 360 | mt76_connac_mcu_sta_he_tlv(skb, sta); |
| 361 | mt76_connac_mcu_sta_he_tlv_v2(skb, sta); |
| 362 | if (band == NL80211_BAND_6GHZ && |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 363 | @@ -899,7 +890,7 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 364 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE_6G, |
| 365 | sizeof(*he_6g_capa)); |
| 366 | he_6g_capa = (struct sta_rec_he_6g_capa *)tlv; |
| 367 | - he_6g_capa->capa = sta->deflink.he_6ghz_capa.capa; |
| 368 | + he_6g_capa->capa = sta->he_6ghz_capa.capa; |
| 369 | } |
| 370 | } |
| 371 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 372 | @@ -909,14 +900,14 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 373 | phy->basic_rate = cpu_to_le16((u16)vif->bss_conf.basic_rates); |
| 374 | phy->rcpi = rcpi; |
| 375 | phy->ampdu = FIELD_PREP(IEEE80211_HT_AMPDU_PARM_FACTOR, |
| 376 | - sta->deflink.ht_cap.ampdu_factor) | |
| 377 | + sta->ht_cap.ampdu_factor) | |
| 378 | FIELD_PREP(IEEE80211_HT_AMPDU_PARM_DENSITY, |
| 379 | - sta->deflink.ht_cap.ampdu_density); |
| 380 | + sta->ht_cap.ampdu_density); |
| 381 | |
| 382 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra_info)); |
| 383 | ra_info = (struct sta_rec_ra_info *)tlv; |
| 384 | |
| 385 | - supp_rates = sta->deflink.supp_rates[band]; |
| 386 | + supp_rates = sta->supp_rates[band]; |
| 387 | if (band == NL80211_BAND_2GHZ) |
| 388 | supp_rates = FIELD_PREP(RA_LEGACY_OFDM, supp_rates >> 4) | |
| 389 | FIELD_PREP(RA_LEGACY_CCK, supp_rates & 0xf); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 390 | @@ -925,18 +916,18 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 391 | |
| 392 | ra_info->legacy = cpu_to_le16(supp_rates); |
| 393 | |
| 394 | - if (sta->deflink.ht_cap.ht_supported) |
| 395 | + if (sta->ht_cap.ht_supported) |
| 396 | memcpy(ra_info->rx_mcs_bitmask, |
| 397 | - sta->deflink.ht_cap.mcs.rx_mask, |
| 398 | + sta->ht_cap.mcs.rx_mask, |
| 399 | HT_MCS_MASK_NUM); |
| 400 | |
| 401 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_STATE, sizeof(*state)); |
| 402 | state = (struct sta_rec_state *)tlv; |
| 403 | state->state = sta_state; |
| 404 | |
| 405 | - if (sta->deflink.vht_cap.vht_supported) { |
| 406 | - state->vht_opmode = sta->deflink.bandwidth; |
| 407 | - state->vht_opmode |= (sta->deflink.rx_nss - 1) << |
| 408 | + if (sta->vht_cap.vht_supported) { |
| 409 | + state->vht_opmode = sta->bandwidth; |
| 410 | + state->vht_opmode |= (sta->rx_nss - 1) << |
| 411 | IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT; |
| 412 | } |
| 413 | } |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 414 | @@ -952,7 +943,7 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 415 | tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_SMPS, sizeof(*smps), |
| 416 | wtbl_tlv, sta_wtbl); |
| 417 | smps = (struct wtbl_smps *)tlv; |
| 418 | - smps->smps = (sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC); |
| 419 | + smps->smps = (sta->smps_mode == IEEE80211_SMPS_DYNAMIC); |
| 420 | } |
| 421 | EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_smps_tlv); |
| 422 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 423 | @@ -964,27 +955,27 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 424 | struct tlv *tlv; |
| 425 | u32 flags = 0; |
| 426 | |
| 427 | - if (sta->deflink.ht_cap.ht_supported || sta->deflink.he_6ghz_capa.capa) { |
| 428 | + if (sta->ht_cap.ht_supported || sta->he_6ghz_capa.capa) { |
| 429 | tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_HT, sizeof(*ht), |
| 430 | wtbl_tlv, sta_wtbl); |
| 431 | ht = (struct wtbl_ht *)tlv; |
| 432 | ht->ldpc = ht_ldpc && |
| 433 | - !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING); |
| 434 | + !!(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING); |
| 435 | |
| 436 | - if (sta->deflink.ht_cap.ht_supported) { |
| 437 | - ht->af = sta->deflink.ht_cap.ampdu_factor; |
| 438 | - ht->mm = sta->deflink.ht_cap.ampdu_density; |
| 439 | + if (sta->ht_cap.ht_supported) { |
| 440 | + ht->af = sta->ht_cap.ampdu_factor; |
| 441 | + ht->mm = sta->ht_cap.ampdu_density; |
| 442 | } else { |
| 443 | - ht->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa, |
| 444 | + ht->af = le16_get_bits(sta->he_6ghz_capa.capa, |
| 445 | IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP); |
| 446 | - ht->mm = le16_get_bits(sta->deflink.he_6ghz_capa.capa, |
| 447 | + ht->mm = le16_get_bits(sta->he_6ghz_capa.capa, |
| 448 | IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START); |
| 449 | } |
| 450 | |
| 451 | ht->ht = true; |
| 452 | } |
| 453 | |
| 454 | - if (sta->deflink.vht_cap.vht_supported || sta->deflink.he_6ghz_capa.capa) { |
| 455 | + if (sta->vht_cap.vht_supported || sta->he_6ghz_capa.capa) { |
| 456 | struct wtbl_vht *vht; |
| 457 | u8 af; |
| 458 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 459 | @@ -993,18 +984,18 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 460 | sta_wtbl); |
| 461 | vht = (struct wtbl_vht *)tlv; |
| 462 | vht->ldpc = vht_ldpc && |
| 463 | - !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC); |
| 464 | + !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC); |
| 465 | vht->vht = true; |
| 466 | |
| 467 | af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK, |
| 468 | - sta->deflink.vht_cap.cap); |
| 469 | + sta->vht_cap.cap); |
| 470 | if (ht) |
| 471 | ht->af = max(ht->af, af); |
| 472 | } |
| 473 | |
| 474 | mt76_connac_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_tlv); |
| 475 | |
| 476 | - if (is_connac_v1(dev) && sta->deflink.ht_cap.ht_supported) { |
| 477 | + if (is_connac_v1(dev) && sta->ht_cap.ht_supported) { |
| 478 | /* sgi */ |
| 479 | u32 msk = MT_WTBL_W5_SHORT_GI_20 | MT_WTBL_W5_SHORT_GI_40 | |
| 480 | MT_WTBL_W5_SHORT_GI_80 | MT_WTBL_W5_SHORT_GI_160; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 481 | @@ -1014,15 +1005,15 @@ void mt76_connac_mcu_wtbl_ht_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 482 | sizeof(*raw), wtbl_tlv, |
| 483 | sta_wtbl); |
| 484 | |
| 485 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 486 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 487 | flags |= MT_WTBL_W5_SHORT_GI_20; |
| 488 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 489 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 490 | flags |= MT_WTBL_W5_SHORT_GI_40; |
| 491 | |
| 492 | - if (sta->deflink.vht_cap.vht_supported) { |
| 493 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 494 | + if (sta->vht_cap.vht_supported) { |
| 495 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 496 | flags |= MT_WTBL_W5_SHORT_GI_80; |
| 497 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 498 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 499 | flags |= MT_WTBL_W5_SHORT_GI_160; |
| 500 | } |
| 501 | raw = (struct wtbl_raw *)tlv; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 502 | @@ -1311,9 +1302,9 @@ u8 mt76_connac_get_phy_mode(struct mt76_phy *phy, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 503 | return 0x38; |
| 504 | |
| 505 | if (sta) { |
| 506 | - ht_cap = &sta->deflink.ht_cap; |
| 507 | - vht_cap = &sta->deflink.vht_cap; |
| 508 | - he_cap = &sta->deflink.he_cap; |
| 509 | + ht_cap = &sta->ht_cap; |
| 510 | + vht_cap = &sta->vht_cap; |
| 511 | + he_cap = &sta->he_cap; |
| 512 | } else { |
| 513 | struct ieee80211_supported_band *sband; |
| 514 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 515 | @@ -1636,7 +1627,6 @@ int mt76_connac_mcu_hw_scan(struct mt76_phy *phy, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 516 | for (i = 0; i < sreq->n_ssids; i++) { |
| 517 | if (!sreq->ssids[i].ssid_len) |
| 518 | continue; |
| 519 | - |
| 520 | req->ssids[i].ssid_len = cpu_to_le32(sreq->ssids[i].ssid_len); |
| 521 | memcpy(req->ssids[i].ssid, sreq->ssids[i].ssid, |
| 522 | sreq->ssids[i].ssid_len); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 523 | @@ -1776,7 +1766,6 @@ int mt76_connac_mcu_sched_scan_req(struct mt76_phy *phy, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 524 | memcpy(req->ssids[i].ssid, ssid->ssid, ssid->ssid_len); |
| 525 | req->ssids[i].ssid_len = cpu_to_le32(ssid->ssid_len); |
| 526 | } |
| 527 | - |
| 528 | req->match_num = sreq->n_match_sets; |
| 529 | for (i = 0; i < req->match_num; i++) { |
| 530 | match = &sreq->match_sets[i]; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 531 | @@ -2272,10 +2261,8 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 532 | struct mt76_vif *vif, |
| 533 | struct ieee80211_bss_conf *info) |
| 534 | { |
| 535 | - struct ieee80211_vif *mvif = container_of(info, struct ieee80211_vif, |
| 536 | - bss_conf); |
| 537 | struct sk_buff *skb; |
| 538 | - int i, len = min_t(int, mvif->cfg.arp_addr_cnt, |
| 539 | + int i, len = min_t(int, info->arp_addr_cnt, |
| 540 | IEEE80211_BSS_ARP_ADDR_LIST_LEN); |
| 541 | struct { |
| 542 | struct { |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 543 | @@ -2303,7 +2290,7 @@ int mt76_connac_mcu_update_arp_filter(struct mt76_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 544 | |
| 545 | skb_put_data(skb, &req_hdr, sizeof(req_hdr)); |
| 546 | for (i = 0; i < len; i++) |
| 547 | - skb_put_data(skb, &mvif->cfg.arp_addr_list[i], sizeof(__be32)); |
| 548 | + skb_put_data(skb, &info->arp_addr_list[i], sizeof(__be32)); |
| 549 | |
| 550 | return mt76_mcu_skb_send_msg(dev, skb, MCU_UNI_CMD(OFFLOAD), true); |
| 551 | } |
| 552 | diff --git a/mt76x02_mac.c b/mt76x02_mac.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 553 | index d5db6ffd..fec3d10d 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 554 | --- a/mt76x02_mac.c |
| 555 | +++ b/mt76x02_mac.c |
| 556 | @@ -404,7 +404,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi, |
| 557 | txwi->rate |= cpu_to_le16(MT_RXWI_RATE_LDPC); |
| 558 | if ((info->flags & IEEE80211_TX_CTL_STBC) && nss == 1) |
| 559 | txwi->rate |= cpu_to_le16(MT_RXWI_RATE_STBC); |
| 560 | - if (nss > 1 && sta && sta->deflink.smps_mode == IEEE80211_SMPS_DYNAMIC) |
| 561 | + if (nss > 1 && sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC) |
| 562 | txwi_flags |= MT_TXWI_FLAGS_MMPS; |
| 563 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
| 564 | txwi->ack_ctl |= MT_TXWI_ACK_CTL_REQ; |
| 565 | @@ -412,9 +412,9 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi, |
| 566 | txwi->ack_ctl |= MT_TXWI_ACK_CTL_NSEQ; |
| 567 | if ((info->flags & IEEE80211_TX_CTL_AMPDU) && sta) { |
| 568 | u8 ba_size = IEEE80211_MIN_AMPDU_BUF; |
| 569 | - u8 ampdu_density = sta->deflink.ht_cap.ampdu_density; |
| 570 | + u8 ampdu_density = sta->ht_cap.ampdu_density; |
| 571 | |
| 572 | - ba_size <<= sta->deflink.ht_cap.ampdu_factor; |
| 573 | + ba_size <<= sta->ht_cap.ampdu_factor; |
| 574 | ba_size = min_t(int, 63, ba_size - 1); |
| 575 | if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) |
| 576 | ba_size = 0; |
| 577 | diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 578 | index fd35b579..117ebb56 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 579 | --- a/mt7915/debugfs.c |
| 580 | +++ b/mt7915/debugfs.c |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 581 | @@ -2049,8 +2049,8 @@ static ssize_t mt7915_sta_fixed_rate_set(struct file *file, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 582 | |
| 583 | phy.ldpc = (phy.bw || phy.ldpc) * GENMASK(2, 0); |
| 584 | for (i = 0; i <= phy.bw; i++) { |
| 585 | - phy.sgi |= gi << (i << sta->deflink.he_cap.has_he); |
| 586 | - phy.he_ltf |= he_ltf << (i << sta->deflink.he_cap.has_he); |
| 587 | + phy.sgi |= gi << (i << sta->he_cap.has_he); |
| 588 | + phy.he_ltf |= he_ltf << (i << sta->he_cap.has_he); |
| 589 | } |
| 590 | field = RATE_PARAM_FIXED; |
| 591 | |
| 592 | diff --git a/mt7915/dma.c b/mt7915/dma.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 593 | index f71ec55b..b4e231b7 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 594 | --- a/mt7915/dma.c |
| 595 | +++ b/mt7915/dma.c |
developer | 2324aa2 | 2023-04-12 11:30:15 +0800 | [diff] [blame] | 596 | @@ -590,8 +590,8 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 597 | if (ret < 0) |
| 598 | return ret; |
| 599 | |
| 600 | - netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 601 | - mt7915_poll_tx); |
| 602 | + netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi, |
| 603 | + mt7915_poll_tx, NAPI_POLL_WEIGHT); |
| 604 | napi_enable(&dev->mt76.tx_napi); |
| 605 | |
developer | 2324aa2 | 2023-04-12 11:30:15 +0800 | [diff] [blame] | 606 | mt7915_dma_enable(dev, false); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 607 | diff --git a/mt7915/init.c b/mt7915/init.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 608 | index db627500..0ce17775 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 609 | --- a/mt7915/init.c |
| 610 | +++ b/mt7915/init.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 611 | @@ -1173,8 +1173,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 612 | mt76_connac_gen_ppe_thresh(he_cap->ppe_thres, nss); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 613 | } else { |
| 614 | he_cap_elem->phy_cap_info[9] |= |
| 615 | - u8_encode_bits(IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US, |
| 616 | - IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK); |
| 617 | + IEEE80211_HE_PHY_CAP9_NOMIMAL_PKT_PADDING_16US; |
| 618 | } |
| 619 | |
| 620 | if (band == NL80211_BAND_6GHZ) { |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 621 | diff --git a/mt7915/main.c b/mt7915/main.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 622 | index 8bcffd3f..7af49404 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 623 | --- a/mt7915/main.c |
| 624 | +++ b/mt7915/main.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 625 | @@ -538,7 +538,7 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 626 | |
| 627 | static int |
| 628 | mt7915_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 629 | - unsigned int link_id, u16 queue, |
| 630 | + u16 queue, |
| 631 | const struct ieee80211_tx_queue_params *params) |
| 632 | { |
| 633 | struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 634 | @@ -639,7 +639,7 @@ mt7915_update_bss_color(struct ieee80211_hw *hw, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 635 | static void mt7915_bss_info_changed(struct ieee80211_hw *hw, |
| 636 | struct ieee80211_vif *vif, |
| 637 | struct ieee80211_bss_conf *info, |
| 638 | - u64 changed) |
| 639 | + u32 changed) |
| 640 | { |
| 641 | struct mt7915_phy *phy = mt7915_hw_phy(hw); |
| 642 | struct mt7915_dev *dev = mt7915_hw_dev(hw); |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 643 | @@ -655,7 +655,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw, |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 644 | vif->type == NL80211_IFTYPE_STATION) |
| 645 | set_bss_info = set_sta = !is_zero_ether_addr(info->bssid); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 646 | if (changed & BSS_CHANGED_ASSOC) |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 647 | - set_bss_info = vif->cfg.assoc; |
| 648 | + set_bss_info = info->assoc; |
| 649 | if (changed & BSS_CHANGED_BEACON_ENABLED && |
| 650 | vif->type != NL80211_IFTYPE_AP) |
| 651 | set_bss_info = set_sta = info->enable_beacon; |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 652 | @@ -703,27 +703,8 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw, |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 653 | mutex_unlock(&dev->mt76.mutex); |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 654 | } |
| 655 | |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 656 | -static void |
| 657 | -mt7915_vif_check_caps(struct mt7915_phy *phy, struct ieee80211_vif *vif) |
| 658 | -{ |
| 659 | - struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
| 660 | - struct mt7915_vif_cap *vc = &mvif->cap; |
| 661 | - |
| 662 | - vc->ht_ldpc = vif->bss_conf.ht_ldpc; |
| 663 | - vc->vht_ldpc = vif->bss_conf.vht_ldpc; |
| 664 | - vc->vht_su_ebfer = vif->bss_conf.vht_su_beamformer; |
| 665 | - vc->vht_su_ebfee = vif->bss_conf.vht_su_beamformee; |
| 666 | - vc->vht_mu_ebfer = vif->bss_conf.vht_mu_beamformer; |
| 667 | - vc->vht_mu_ebfee = vif->bss_conf.vht_mu_beamformee; |
| 668 | - vc->he_ldpc = vif->bss_conf.he_ldpc; |
| 669 | - vc->he_su_ebfer = vif->bss_conf.he_su_beamformer; |
| 670 | - vc->he_su_ebfee = vif->bss_conf.he_su_beamformee; |
| 671 | - vc->he_mu_ebfer = vif->bss_conf.he_mu_beamformer; |
| 672 | -} |
| 673 | - |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 674 | static int |
| 675 | -mt7915_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 676 | - struct ieee80211_bss_conf *link_conf) |
| 677 | +mt7915_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 678 | { |
| 679 | struct mt7915_phy *phy = mt7915_hw_phy(hw); |
| 680 | struct mt7915_dev *dev = mt7915_hw_dev(hw); |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 681 | @@ -731,8 +712,6 @@ mt7915_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 682 | |
| 683 | mutex_lock(&dev->mt76.mutex); |
| 684 | |
| 685 | - mt7915_vif_check_caps(phy, vif); |
| 686 | - |
| 687 | err = mt7915_mcu_add_bss_info(phy, vif, true); |
| 688 | if (err) |
| 689 | goto out; |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 690 | @@ -744,8 +723,7 @@ out: |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 691 | } |
| 692 | |
| 693 | static void |
| 694 | -mt7915_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 695 | - struct ieee80211_bss_conf *link_conf) |
| 696 | +mt7915_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
| 697 | { |
| 698 | struct mt7915_dev *dev = mt7915_hw_dev(hw); |
| 699 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 700 | @@ -1307,10 +1285,10 @@ static int mt7915_sta_set_txpwr(struct ieee80211_hw *hw, |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 701 | { |
| 702 | struct mt7915_phy *phy = mt7915_hw_phy(hw); |
| 703 | struct mt7915_dev *dev = mt7915_hw_dev(hw); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 704 | - s16 txpower = sta->deflink.txpwr.power; |
| 705 | + s16 txpower = sta->txpwr.power; |
| 706 | int ret; |
| 707 | |
| 708 | - if (sta->deflink.txpwr.type == NL80211_TX_POWER_AUTOMATIC) |
| 709 | + if (sta->txpwr.type == NL80211_TX_POWER_AUTOMATIC) |
| 710 | txpower = 0; |
| 711 | |
| 712 | mutex_lock(&dev->mt76.mutex); |
| 713 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 714 | index ebacfd27..95c4188d 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 715 | --- a/mt7915/mcu.c |
| 716 | +++ b/mt7915/mcu.c |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 717 | @@ -67,7 +67,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 718 | struct mt7915_dev *dev = msta->vif->phy->dev; |
| 719 | enum nl80211_band band = msta->vif->phy->mt76->chandef.chan->band; |
| 720 | const u16 *mask = msta->vif->bitrate_mask.control[band].he_mcs; |
| 721 | - int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss; |
| 722 | + int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss; |
| 723 | |
| 724 | for (nss = 0; nss < max_nss; nss++) { |
| 725 | int mcs; |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 726 | @@ -107,7 +107,7 @@ mt7915_mcu_set_sta_he_mcs(struct ieee80211_sta *sta, __le16 *he_mcs, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 727 | |
| 728 | /* only support 2ss on 160MHz for mt7915 */ |
| 729 | if (is_mt7915(&dev->mt76) && nss > 1 && |
| 730 | - sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 731 | + sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 732 | break; |
| 733 | } |
| 734 | |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 735 | @@ -120,8 +120,8 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 736 | { |
| 737 | struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; |
| 738 | struct mt7915_dev *dev = msta->vif->phy->dev; |
| 739 | - u16 mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map); |
| 740 | - int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss; |
| 741 | + u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map); |
| 742 | + int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss; |
| 743 | u16 mcs; |
| 744 | |
| 745 | for (nss = 0; nss < max_nss; nss++, mcs_map >>= 2) { |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 746 | @@ -143,7 +143,7 @@ mt7915_mcu_set_sta_vht_mcs(struct ieee80211_sta *sta, __le16 *vht_mcs, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 747 | |
| 748 | /* only support 2ss on 160MHz for mt7915 */ |
| 749 | if (is_mt7915(&dev->mt76) && nss > 1 && |
| 750 | - sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 751 | + sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 752 | break; |
| 753 | } |
| 754 | } |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 755 | @@ -152,10 +152,10 @@ static void |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 756 | mt7915_mcu_set_sta_ht_mcs(struct ieee80211_sta *sta, u8 *ht_mcs, |
| 757 | const u8 *mask) |
| 758 | { |
| 759 | - int nss, max_nss = sta->deflink.rx_nss > 3 ? 4 : sta->deflink.rx_nss; |
| 760 | + int nss, max_nss = sta->rx_nss > 3 ? 4 : sta->rx_nss; |
| 761 | |
| 762 | for (nss = 0; nss < max_nss; nss++) |
| 763 | - ht_mcs[nss] = sta->deflink.ht_cap.mcs.rx_mask[nss] & mask[nss]; |
| 764 | + ht_mcs[nss] = sta->ht_cap.mcs.rx_mask[nss] & mask[nss]; |
| 765 | } |
| 766 | |
| 767 | static int |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 768 | @@ -236,7 +236,7 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 769 | static void |
| 770 | mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 771 | { |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 772 | - if (!vif->bss_conf.csa_active || vif->type == NL80211_IFTYPE_STATION) |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 773 | + if (!vif->csa_active || vif->type == NL80211_IFTYPE_STATION) |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 774 | return; |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 775 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 776 | ieee80211_csa_finish(vif); |
| 777 | @@ -339,7 +339,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 778 | static void |
| 779 | mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) |
| 780 | { |
developer | 23d6e27 | 2023-08-28 11:10:51 +0800 | [diff] [blame] | 781 | - if (!vif->bss_conf.color_change_active || vif->type == NL80211_IFTYPE_STATION) |
| 782 | + if (!vif->color_change_active || vif->type == NL80211_IFTYPE_STATION) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 783 | return; |
| 784 | |
| 785 | ieee80211_color_change_finish(vif); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 786 | @@ -754,13 +754,13 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 787 | struct ieee80211_vif *vif) |
| 788 | { |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 789 | struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 790 | - struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem; |
| 791 | + struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem; |
| 792 | struct ieee80211_he_mcs_nss_supp mcs_map; |
| 793 | struct sta_rec_he *he; |
| 794 | struct tlv *tlv; |
| 795 | u32 cap = 0; |
| 796 | |
| 797 | - if (!sta->deflink.he_cap.has_he) |
| 798 | + if (!sta->he_cap.has_he) |
| 799 | return; |
| 800 | |
| 801 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HE, sizeof(*he)); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 802 | @@ -846,8 +846,8 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 803 | |
| 804 | he->he_cap = cpu_to_le32(cap); |
| 805 | |
| 806 | - mcs_map = sta->deflink.he_cap.he_mcs_nss_supp; |
| 807 | - switch (sta->deflink.bandwidth) { |
| 808 | + mcs_map = sta->he_cap.he_mcs_nss_supp; |
| 809 | + switch (sta->bandwidth) { |
| 810 | case IEEE80211_STA_RX_BW_160: |
| 811 | if (elem->phy_cap_info[0] & |
| 812 | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 813 | @@ -897,7 +897,7 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 814 | struct ieee80211_sta *sta, struct ieee80211_vif *vif) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 815 | { |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 816 | struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 817 | - struct ieee80211_he_cap_elem *elem = &sta->deflink.he_cap.he_cap_elem; |
| 818 | + struct ieee80211_he_cap_elem *elem = &sta->he_cap.he_cap_elem; |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 819 | struct mt7915_phy *phy = mvif->phy; |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 820 | struct sta_rec_muru *muru; |
| 821 | struct tlv *tlv; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 822 | @@ -922,11 +922,11 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 823 | muru->cfg.ofdma_dl_en = !!(phy->muru_onoff & OFDMA_DL); |
| 824 | muru->cfg.ofdma_ul_en = !!(phy->muru_onoff & OFDMA_UL); |
| 825 | |
| 826 | - if (sta->deflink.vht_cap.vht_supported) |
| 827 | + if (sta->vht_cap.vht_supported) |
| 828 | muru->mimo_dl.vht_mu_bfee = |
| 829 | - !!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); |
| 830 | + !!(sta->vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); |
| 831 | |
| 832 | - if (!sta->deflink.he_cap.has_he) |
| 833 | + if (!sta->he_cap.has_he) |
| 834 | return; |
| 835 | |
| 836 | muru->mimo_dl.partial_bw_dl_mimo = |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 837 | @@ -962,13 +962,13 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 838 | struct sta_rec_ht *ht; |
| 839 | struct tlv *tlv; |
| 840 | |
| 841 | - if (!sta->deflink.ht_cap.ht_supported) |
| 842 | + if (!sta->ht_cap.ht_supported) |
| 843 | return; |
| 844 | |
| 845 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht)); |
| 846 | |
| 847 | ht = (struct sta_rec_ht *)tlv; |
| 848 | - ht->ht_cap = cpu_to_le16(sta->deflink.ht_cap.cap); |
| 849 | + ht->ht_cap = cpu_to_le16(sta->ht_cap.cap); |
| 850 | } |
| 851 | |
| 852 | static void |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 853 | @@ -977,15 +977,15 @@ mt7915_mcu_sta_vht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 854 | struct sta_rec_vht *vht; |
| 855 | struct tlv *tlv; |
| 856 | |
| 857 | - if (!sta->deflink.vht_cap.vht_supported) |
| 858 | + if (!sta->vht_cap.vht_supported) |
| 859 | return; |
| 860 | |
| 861 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_VHT, sizeof(*vht)); |
| 862 | |
| 863 | vht = (struct sta_rec_vht *)tlv; |
| 864 | - vht->vht_cap = cpu_to_le32(sta->deflink.vht_cap.cap); |
| 865 | - vht->vht_rx_mcs_map = sta->deflink.vht_cap.vht_mcs.rx_mcs_map; |
| 866 | - vht->vht_tx_mcs_map = sta->deflink.vht_cap.vht_mcs.tx_mcs_map; |
| 867 | + vht->vht_cap = cpu_to_le32(sta->vht_cap.cap); |
| 868 | + vht->vht_rx_mcs_map = sta->vht_cap.vht_mcs.rx_mcs_map; |
| 869 | + vht->vht_tx_mcs_map = sta->vht_cap.vht_mcs.tx_mcs_map; |
| 870 | } |
| 871 | |
| 872 | static void |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 873 | @@ -1000,7 +1000,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 874 | vif->type != NL80211_IFTYPE_AP) |
| 875 | return; |
| 876 | |
| 877 | - if (!sta->deflink.agg.max_amsdu_len) |
| 878 | + if (!sta->max_amsdu_len) |
| 879 | return; |
| 880 | |
| 881 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HW_AMSDU, sizeof(*amsdu)); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 882 | @@ -1009,7 +1009,7 @@ mt7915_mcu_sta_amsdu_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 883 | amsdu->amsdu_en = true; |
| 884 | msta->wcid.amsdu = true; |
| 885 | |
| 886 | - switch (sta->deflink.agg.max_amsdu_len) { |
| 887 | + switch (sta->max_amsdu_len) { |
| 888 | case IEEE80211_MAX_MPDU_LEN_VHT_11454: |
| 889 | if (!is_mt7915(&dev->mt76)) { |
| 890 | amsdu->max_mpdu_size = |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 891 | @@ -1072,8 +1072,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif, |
developer | 69542b5 | 2023-04-13 10:46:44 +0800 | [diff] [blame] | 892 | if (!bfee && sts < 2) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 893 | return false; |
| 894 | |
| 895 | - if (sta->deflink.he_cap.has_he) { |
| 896 | - struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem; |
| 897 | + if (sta->he_cap.has_he) { |
| 898 | + struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem; |
| 899 | |
| 900 | if (bfee) |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 901 | return mvif->cap.he_su_ebfee && |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 902 | @@ -1083,8 +1083,8 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 903 | HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]); |
| 904 | } |
| 905 | |
| 906 | - if (sta->deflink.vht_cap.vht_supported) { |
| 907 | - u32 cap = sta->deflink.vht_cap.cap; |
| 908 | + if (sta->vht_cap.vht_supported) { |
| 909 | + u32 cap = sta->vht_cap.cap; |
| 910 | |
| 911 | if (bfee) |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 912 | return mvif->cap.vht_su_ebfee && |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 913 | @@ -1110,7 +1110,7 @@ static void |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 914 | mt7915_mcu_sta_bfer_ht(struct ieee80211_sta *sta, struct mt7915_phy *phy, |
| 915 | struct sta_rec_bf *bf) |
| 916 | { |
| 917 | - struct ieee80211_mcs_info *mcs = &sta->deflink.ht_cap.mcs; |
| 918 | + struct ieee80211_mcs_info *mcs = &sta->ht_cap.mcs; |
| 919 | u8 n = 0; |
| 920 | |
| 921 | bf->tx_mode = MT_PHY_TYPE_HT; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 922 | @@ -1135,7 +1135,7 @@ static void |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 923 | mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy, |
| 924 | struct sta_rec_bf *bf, bool explicit) |
| 925 | { |
| 926 | - struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap; |
| 927 | + struct ieee80211_sta_vht_cap *pc = &sta->vht_cap; |
| 928 | struct ieee80211_sta_vht_cap *vc = &phy->mt76->sband_5g.sband.vht_cap; |
| 929 | u16 mcs_map = le16_to_cpu(pc->vht_mcs.rx_mcs_map); |
| 930 | u8 nss_mcs = mt7915_mcu_get_sta_nss(mcs_map); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 931 | @@ -1156,14 +1156,14 @@ mt7915_mcu_sta_bfer_vht(struct ieee80211_sta *sta, struct mt7915_phy *phy, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 932 | bf->ncol = min_t(u8, nss_mcs, bf->nrow); |
| 933 | bf->ibf_ncol = bf->ncol; |
| 934 | |
| 935 | - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 936 | + if (sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 937 | bf->nrow = 1; |
| 938 | } else { |
| 939 | bf->nrow = tx_ant; |
| 940 | bf->ncol = min_t(u8, nss_mcs, bf->nrow); |
| 941 | bf->ibf_ncol = nss_mcs; |
| 942 | |
| 943 | - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) |
| 944 | + if (sta->bandwidth == IEEE80211_STA_RX_BW_160) |
| 945 | bf->ibf_nrow = 1; |
| 946 | } |
| 947 | } |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 948 | @@ -1172,7 +1172,7 @@ static void |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 949 | mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif, |
| 950 | struct mt7915_phy *phy, struct sta_rec_bf *bf) |
| 951 | { |
| 952 | - struct ieee80211_sta_he_cap *pc = &sta->deflink.he_cap; |
| 953 | + struct ieee80211_sta_he_cap *pc = &sta->he_cap; |
| 954 | struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem; |
| 955 | const struct ieee80211_sta_he_cap *vc = |
| 956 | mt76_connac_get_he_phy_cap(phy->mt76, vif); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 957 | @@ -1197,7 +1197,7 @@ mt7915_mcu_sta_bfer_he(struct ieee80211_sta *sta, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 958 | bf->ncol = min_t(u8, nss_mcs, bf->nrow); |
| 959 | bf->ibf_ncol = bf->ncol; |
| 960 | |
| 961 | - if (sta->deflink.bandwidth != IEEE80211_STA_RX_BW_160) |
| 962 | + if (sta->bandwidth != IEEE80211_STA_RX_BW_160) |
| 963 | return; |
| 964 | |
| 965 | /* go over for 160MHz and 80p80 */ |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 966 | @@ -1245,7 +1245,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 967 | }; |
| 968 | bool ebf; |
| 969 | |
| 970 | - if (!(sta->deflink.ht_cap.ht_supported || sta->deflink.he_cap.has_he)) |
| 971 | + if (!(sta->ht_cap.ht_supported || sta->he_cap.has_he)) |
| 972 | return; |
| 973 | |
| 974 | ebf = mt7915_is_ebf_supported(phy, vif, sta, false); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 975 | @@ -1259,21 +1259,21 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 976 | * vht: support eBF and iBF |
| 977 | * ht: iBF only, since mac80211 lacks of eBF support |
| 978 | */ |
| 979 | - if (sta->deflink.he_cap.has_he && ebf) |
| 980 | + if (sta->he_cap.has_he && ebf) |
| 981 | mt7915_mcu_sta_bfer_he(sta, vif, phy, bf); |
| 982 | - else if (sta->deflink.vht_cap.vht_supported) |
| 983 | + else if (sta->vht_cap.vht_supported) |
| 984 | mt7915_mcu_sta_bfer_vht(sta, phy, bf, ebf); |
| 985 | - else if (sta->deflink.ht_cap.ht_supported) |
| 986 | + else if (sta->ht_cap.ht_supported) |
| 987 | mt7915_mcu_sta_bfer_ht(sta, phy, bf); |
| 988 | else |
| 989 | return; |
| 990 | |
| 991 | bf->bf_cap = ebf ? ebf : dev->ibf << 1; |
| 992 | - bf->bw = sta->deflink.bandwidth; |
| 993 | - bf->ibf_dbw = sta->deflink.bandwidth; |
| 994 | + bf->bw = sta->bandwidth; |
| 995 | + bf->ibf_dbw = sta->bandwidth; |
| 996 | bf->ibf_nrow = tx_ant; |
| 997 | |
| 998 | - if (!ebf && sta->deflink.bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol) |
| 999 | + if (!ebf && sta->bandwidth <= IEEE80211_STA_RX_BW_40 && !bf->ncol) |
| 1000 | bf->ibf_timeout = 0x48; |
| 1001 | else |
| 1002 | bf->ibf_timeout = 0x18; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1003 | @@ -1283,7 +1283,7 @@ mt7915_mcu_sta_bfer_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1004 | else |
| 1005 | bf->mem_20m = matrix[bf->nrow][bf->ncol]; |
| 1006 | |
| 1007 | - switch (sta->deflink.bandwidth) { |
| 1008 | + switch (sta->bandwidth) { |
| 1009 | case IEEE80211_STA_RX_BW_160: |
| 1010 | case IEEE80211_STA_RX_BW_80: |
| 1011 | bf->mem_total = bf->mem_20m * 2; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1012 | @@ -1308,7 +1308,7 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1013 | struct tlv *tlv; |
| 1014 | u8 nrow = 0; |
| 1015 | |
| 1016 | - if (!(sta->deflink.vht_cap.vht_supported || sta->deflink.he_cap.has_he)) |
| 1017 | + if (!(sta->vht_cap.vht_supported || sta->he_cap.has_he)) |
| 1018 | return; |
| 1019 | |
| 1020 | if (!mt7915_is_ebf_supported(phy, vif, sta, true)) |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1021 | @@ -1317,13 +1317,13 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1022 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_BFEE, sizeof(*bfee)); |
| 1023 | bfee = (struct sta_rec_bfee *)tlv; |
| 1024 | |
| 1025 | - if (sta->deflink.he_cap.has_he) { |
| 1026 | - struct ieee80211_he_cap_elem *pe = &sta->deflink.he_cap.he_cap_elem; |
| 1027 | + if (sta->he_cap.has_he) { |
| 1028 | + struct ieee80211_he_cap_elem *pe = &sta->he_cap.he_cap_elem; |
| 1029 | |
| 1030 | nrow = HE_PHY(CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK, |
| 1031 | pe->phy_cap_info[5]); |
| 1032 | - } else if (sta->deflink.vht_cap.vht_supported) { |
| 1033 | - struct ieee80211_sta_vht_cap *pc = &sta->deflink.vht_cap; |
| 1034 | + } else if (sta->vht_cap.vht_supported) { |
| 1035 | + struct ieee80211_sta_vht_cap *pc = &sta->vht_cap; |
| 1036 | |
| 1037 | nrow = FIELD_GET(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK, |
| 1038 | pc->cap); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1039 | @@ -1379,7 +1379,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1040 | ra->phy = *phy; |
| 1041 | break; |
| 1042 | case RATE_PARAM_MMPS_UPDATE: |
| 1043 | - ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode); |
| 1044 | + ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode); |
| 1045 | break; |
| 1046 | case RATE_PARAM_SPE_UPDATE: |
| 1047 | ra->spe_idx = *(u8 *)data; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1048 | @@ -1454,7 +1454,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1049 | do { \ |
| 1050 | u8 i, gi = mask->control[band]._gi; \ |
| 1051 | gi = (_he) ? gi : gi == NL80211_TXRATE_FORCE_SGI; \ |
| 1052 | - for (i = 0; i <= sta->deflink.bandwidth; i++) { \ |
| 1053 | + for (i = 0; i <= sta->bandwidth; i++) { \ |
| 1054 | phy.sgi |= gi << (i << (_he)); \ |
| 1055 | phy.he_ltf |= mask->control[band].he_ltf << (i << (_he));\ |
| 1056 | } \ |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1057 | @@ -1468,11 +1468,11 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1058 | } \ |
| 1059 | } while (0) |
| 1060 | |
| 1061 | - if (sta->deflink.he_cap.has_he) { |
| 1062 | + if (sta->he_cap.has_he) { |
| 1063 | __sta_phy_bitrate_mask_check(he_mcs, he_gi, 0, 1); |
| 1064 | - } else if (sta->deflink.vht_cap.vht_supported) { |
| 1065 | + } else if (sta->vht_cap.vht_supported) { |
| 1066 | __sta_phy_bitrate_mask_check(vht_mcs, gi, 0, 0); |
| 1067 | - } else if (sta->deflink.ht_cap.ht_supported) { |
| 1068 | + } else if (sta->ht_cap.ht_supported) { |
| 1069 | __sta_phy_bitrate_mask_check(ht_mcs, gi, 1, 0); |
| 1070 | } else { |
| 1071 | nrates = hweight32(mask->control[band].legacy); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1072 | @@ -1506,7 +1506,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1073 | * actual txrate hardware sends out. |
| 1074 | */ |
| 1075 | addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 7); |
| 1076 | - if (sta->deflink.he_cap.has_he) |
| 1077 | + if (sta->he_cap.has_he) |
| 1078 | mt76_rmw_field(dev, addr, GENMASK(31, 24), phy.sgi); |
| 1079 | else |
| 1080 | mt76_rmw_field(dev, addr, GENMASK(15, 12), phy.sgi); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1081 | @@ -1539,7 +1539,7 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1082 | enum nl80211_band band = chandef->chan->band; |
| 1083 | struct sta_rec_ra *ra; |
| 1084 | struct tlv *tlv; |
| 1085 | - u32 supp_rate = sta->deflink.supp_rates[band]; |
| 1086 | + u32 supp_rate = sta->supp_rates[band]; |
| 1087 | u32 cap = sta->wme ? STA_CAP_WMM : 0; |
| 1088 | |
| 1089 | tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra)); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1090 | @@ -1549,9 +1549,9 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1091 | ra->auto_rate = true; |
| 1092 | ra->phy_mode = mt76_connac_get_phy_mode(mphy, vif, band, sta); |
| 1093 | ra->channel = chandef->chan->hw_value; |
| 1094 | - ra->bw = sta->deflink.bandwidth; |
| 1095 | - ra->phy.bw = sta->deflink.bandwidth; |
| 1096 | - ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode); |
| 1097 | + ra->bw = sta->bandwidth; |
| 1098 | + ra->phy.bw = sta->bandwidth; |
| 1099 | + ra->mmps_mode = mt7915_mcu_get_mmps_mode(sta->smps_mode); |
| 1100 | |
| 1101 | if (supp_rate) { |
| 1102 | supp_rate &= mask->control[band].legacy; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1103 | @@ -1571,22 +1571,22 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1104 | } |
| 1105 | } |
| 1106 | |
| 1107 | - if (sta->deflink.ht_cap.ht_supported) { |
| 1108 | + if (sta->ht_cap.ht_supported) { |
| 1109 | ra->supp_mode |= MODE_HT; |
| 1110 | - ra->af = sta->deflink.ht_cap.ampdu_factor; |
| 1111 | - ra->ht_gf = !!(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD); |
| 1112 | + ra->af = sta->ht_cap.ampdu_factor; |
| 1113 | + ra->ht_gf = !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD); |
| 1114 | |
| 1115 | cap |= STA_CAP_HT; |
| 1116 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 1117 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) |
| 1118 | cap |= STA_CAP_SGI_20; |
| 1119 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 1120 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) |
| 1121 | cap |= STA_CAP_SGI_40; |
| 1122 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_TX_STBC) |
| 1123 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC) |
| 1124 | cap |= STA_CAP_TX_STBC; |
| 1125 | - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC) |
| 1126 | + if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC) |
| 1127 | cap |= STA_CAP_RX_STBC; |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 1128 | if (mvif->cap.ht_ldpc && |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1129 | - (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING)) |
| 1130 | + (sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING)) |
| 1131 | cap |= STA_CAP_LDPC; |
| 1132 | |
| 1133 | mt7915_mcu_set_sta_ht_mcs(sta, ra->ht_mcs, |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1134 | @@ -1594,37 +1594,37 @@ mt7915_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb, struct mt7915_dev *dev, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1135 | ra->supp_ht_mcs = *(__le32 *)ra->ht_mcs; |
| 1136 | } |
| 1137 | |
| 1138 | - if (sta->deflink.vht_cap.vht_supported) { |
| 1139 | + if (sta->vht_cap.vht_supported) { |
| 1140 | u8 af; |
| 1141 | |
| 1142 | ra->supp_mode |= MODE_VHT; |
| 1143 | af = FIELD_GET(IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK, |
| 1144 | - sta->deflink.vht_cap.cap); |
| 1145 | + sta->vht_cap.cap); |
| 1146 | ra->af = max_t(u8, ra->af, af); |
| 1147 | |
| 1148 | cap |= STA_CAP_VHT; |
| 1149 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 1150 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80) |
| 1151 | cap |= STA_CAP_VHT_SGI_80; |
| 1152 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 1153 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_160) |
| 1154 | cap |= STA_CAP_VHT_SGI_160; |
| 1155 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC) |
| 1156 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_TXSTBC) |
| 1157 | cap |= STA_CAP_VHT_TX_STBC; |
| 1158 | - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1) |
| 1159 | + if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_1) |
| 1160 | cap |= STA_CAP_VHT_RX_STBC; |
developer | c1571f9 | 2023-07-04 22:11:24 +0800 | [diff] [blame] | 1161 | if (mvif->cap.vht_ldpc && |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1162 | - (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC)) |
| 1163 | + (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC)) |
| 1164 | cap |= STA_CAP_VHT_LDPC; |
| 1165 | |
| 1166 | mt7915_mcu_set_sta_vht_mcs(sta, ra->supp_vht_mcs, |
| 1167 | mask->control[band].vht_mcs); |
| 1168 | } |
| 1169 | |
| 1170 | - if (sta->deflink.he_cap.has_he) { |
| 1171 | + if (sta->he_cap.has_he) { |
| 1172 | ra->supp_mode |= MODE_HE; |
| 1173 | cap |= STA_CAP_HE; |
| 1174 | |
| 1175 | - if (sta->deflink.he_6ghz_capa.capa) |
| 1176 | - ra->af = le16_get_bits(sta->deflink.he_6ghz_capa.capa, |
| 1177 | + if (sta->he_6ghz_capa.capa) |
| 1178 | + ra->af = le16_get_bits(sta->he_6ghz_capa.capa, |
| 1179 | IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP); |
| 1180 | } |
| 1181 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1182 | @@ -1833,7 +1833,7 @@ mt7915_mcu_beacon_cntdwn(struct ieee80211_vif *vif, struct sk_buff *rskb, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1183 | if (!offs->cntdwn_counter_offs[0]) |
| 1184 | return; |
| 1185 | |
| 1186 | - sub_tag = vif->bss_conf.csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC; |
| 1187 | + sub_tag = vif->csa_active ? BSS_INFO_BCN_CSA : BSS_INFO_BCN_BCC; |
| 1188 | tlv = mt7915_mcu_add_nested_subtlv(rskb, sub_tag, sizeof(*info), |
| 1189 | &bcn->sub_ntlv, &bcn->len); |
| 1190 | info = (struct bss_info_bcn_cntdwn *)tlv; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1191 | @@ -1918,9 +1918,9 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1192 | if (offs->cntdwn_counter_offs[0]) { |
| 1193 | u16 offset = offs->cntdwn_counter_offs[0]; |
| 1194 | |
| 1195 | - if (vif->bss_conf.csa_active) |
| 1196 | + if (vif->csa_active) |
| 1197 | cont->csa_ofs = cpu_to_le16(offset - 4); |
| 1198 | - if (vif->bss_conf.color_change_active) |
| 1199 | + if (vif->color_change_active) |
| 1200 | cont->bcc_ofs = cpu_to_le16(offset - 3); |
| 1201 | } |
| 1202 | |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1203 | @@ -1930,6 +1930,85 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif, |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 1204 | memcpy(buf + MT_TXD_SIZE, skb->data, skb->len); |
| 1205 | } |
| 1206 | |
| 1207 | +static void |
| 1208 | +mt7915_mcu_beacon_check_caps(struct mt7915_phy *phy, struct ieee80211_vif *vif, |
| 1209 | + struct sk_buff *skb) |
| 1210 | +{ |
| 1211 | + struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv; |
| 1212 | + struct mt7915_vif_cap *vc = &mvif->cap; |
| 1213 | + const struct ieee80211_he_cap_elem *he; |
| 1214 | + const struct ieee80211_vht_cap *vht; |
| 1215 | + const struct ieee80211_ht_cap *ht; |
| 1216 | + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; |
| 1217 | + const u8 *ie; |
| 1218 | + u32 len, bc; |
| 1219 | + |
| 1220 | + /* Check missing configuration options to allow AP mode in mac80211 |
| 1221 | + * to remain in sync with hostapd settings, and get a subset of |
| 1222 | + * beacon and hardware capabilities. |
| 1223 | + */ |
| 1224 | + if (WARN_ON_ONCE(skb->len <= (mgmt->u.beacon.variable - skb->data))) |
| 1225 | + return; |
| 1226 | + |
| 1227 | + memset(vc, 0, sizeof(*vc)); |
| 1228 | + |
| 1229 | + len = skb->len - (mgmt->u.beacon.variable - skb->data); |
| 1230 | + |
| 1231 | + ie = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, mgmt->u.beacon.variable, |
| 1232 | + len); |
| 1233 | + if (ie && ie[1] >= sizeof(*ht)) { |
| 1234 | + ht = (void *)(ie + 2); |
| 1235 | + vc->ht_ldpc = !!(le16_to_cpu(ht->cap_info) & |
| 1236 | + IEEE80211_HT_CAP_LDPC_CODING); |
| 1237 | + } |
| 1238 | + |
| 1239 | + ie = cfg80211_find_ie(WLAN_EID_VHT_CAPABILITY, mgmt->u.beacon.variable, |
| 1240 | + len); |
| 1241 | + if (ie && ie[1] >= sizeof(*vht)) { |
| 1242 | + u32 pc = phy->mt76->sband_5g.sband.vht_cap.cap; |
| 1243 | + |
| 1244 | + vht = (void *)(ie + 2); |
| 1245 | + bc = le32_to_cpu(vht->vht_cap_info); |
| 1246 | + |
| 1247 | + vc->vht_ldpc = !!(bc & IEEE80211_VHT_CAP_RXLDPC); |
| 1248 | + vc->vht_su_ebfer = |
| 1249 | + (bc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE) && |
| 1250 | + (pc & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE); |
| 1251 | + vc->vht_su_ebfee = |
| 1252 | + (bc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE) && |
| 1253 | + (pc & IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE); |
| 1254 | + vc->vht_mu_ebfer = |
| 1255 | + (bc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE) && |
| 1256 | + (pc & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE); |
| 1257 | + vc->vht_mu_ebfee = |
| 1258 | + (bc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE) && |
| 1259 | + (pc & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE); |
| 1260 | + } |
| 1261 | + |
| 1262 | + ie = cfg80211_find_ext_ie(WLAN_EID_EXT_HE_CAPABILITY, |
| 1263 | + mgmt->u.beacon.variable, len); |
| 1264 | + if (ie && ie[1] >= sizeof(*he) + 1) { |
| 1265 | + const struct ieee80211_sta_he_cap *pc = |
| 1266 | + mt76_connac_get_he_phy_cap(phy->mt76, vif); |
| 1267 | + const struct ieee80211_he_cap_elem *pe = &pc->he_cap_elem; |
| 1268 | + |
| 1269 | + he = (void *)(ie + 3); |
| 1270 | + |
| 1271 | + vc->he_ldpc = |
| 1272 | + HE_PHY(CAP1_LDPC_CODING_IN_PAYLOAD, he->phy_cap_info[1]) && |
| 1273 | + HE_PHY(CAP1_LDPC_CODING_IN_PAYLOAD, pe->phy_cap_info[1]); |
| 1274 | + vc->he_su_ebfer = |
| 1275 | + HE_PHY(CAP3_SU_BEAMFORMER, he->phy_cap_info[3]) && |
| 1276 | + HE_PHY(CAP3_SU_BEAMFORMER, pe->phy_cap_info[3]); |
| 1277 | + vc->he_su_ebfee = |
| 1278 | + HE_PHY(CAP4_SU_BEAMFORMEE, he->phy_cap_info[4]) && |
| 1279 | + HE_PHY(CAP4_SU_BEAMFORMEE, pe->phy_cap_info[4]); |
| 1280 | + vc->he_mu_ebfer = |
| 1281 | + HE_PHY(CAP4_MU_BEAMFORMER, he->phy_cap_info[4]) && |
| 1282 | + HE_PHY(CAP4_MU_BEAMFORMER, pe->phy_cap_info[4]); |
| 1283 | + } |
| 1284 | +} |
| 1285 | + |
| 1286 | int |
| 1287 | mt7915_mcu_add_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif, |
| 1288 | u32 changed) |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1289 | @@ -2043,7 +2122,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1290 | if (!en) |
| 1291 | goto out; |
| 1292 | |
| 1293 | - skb = ieee80211_beacon_get_template(hw, vif, &offs, 0); |
| 1294 | + skb = ieee80211_beacon_get_template(hw, vif, &offs); |
developer | d8ca5d3 | 2023-08-30 19:05:17 +0800 | [diff] [blame] | 1295 | if (!skb) { |
| 1296 | dev_kfree_skb(rskb); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1297 | return -EINVAL; |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1298 | @@ -2059,6 +2138,7 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 1299 | info = IEEE80211_SKB_CB(skb); |
| 1300 | info->hw_queue = FIELD_PREP(MT_TX_HW_QUEUE_PHY, ext_phy); |
| 1301 | |
| 1302 | + mt7915_mcu_beacon_check_caps(phy, vif, skb); |
| 1303 | mt7915_mcu_beacon_cntdwn(vif, rskb, skb, bcn, &offs); |
| 1304 | mt7915_mcu_beacon_mbss(rskb, skb, vif, bcn, &offs); |
| 1305 | mt7915_mcu_beacon_cont(dev, vif, rskb, skb, bcn, &offs); |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1306 | @@ -3331,17 +3411,17 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy, |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1307 | if (txpower) { |
| 1308 | u32 offs, len, i; |
| 1309 | |
| 1310 | - if (sta->deflink.ht_cap.ht_supported) { |
| 1311 | + if (sta->ht_cap.ht_supported) { |
| 1312 | const u8 *sku_len = mt7915_sku_group_len; |
| 1313 | |
| 1314 | offs = sku_len[SKU_CCK] + sku_len[SKU_OFDM]; |
| 1315 | len = sku_len[SKU_HT_BW20] + sku_len[SKU_HT_BW40]; |
| 1316 | |
| 1317 | - if (sta->deflink.vht_cap.vht_supported) { |
| 1318 | + if (sta->vht_cap.vht_supported) { |
| 1319 | offs += len; |
| 1320 | len = sku_len[SKU_VHT_BW20] * 4; |
| 1321 | |
| 1322 | - if (sta->deflink.he_cap.has_he) { |
| 1323 | + if (sta->he_cap.has_he) { |
| 1324 | offs += len + sku_len[SKU_HE_RU26] * 3; |
| 1325 | len = sku_len[SKU_HE_RU242] * 4; |
| 1326 | } |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1327 | diff --git a/mt7915/mmio.c b/mt7915/mmio.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 1328 | index b6779474..1e998113 100644 |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1329 | --- a/mt7915/mmio.c |
| 1330 | +++ b/mt7915/mmio.c |
developer | 23d6e27 | 2023-08-28 11:10:51 +0800 | [diff] [blame] | 1331 | @@ -689,7 +689,7 @@ static u32 mt7915_mmio_wed_init_rx_buf(struct mtk_wed_device *wed, int size) |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1332 | phy_addr = dma_map_single(dev->mt76.dma_dev, ptr, |
| 1333 | wed->wlan.rx_size, |
| 1334 | DMA_TO_DEVICE); |
| 1335 | - |
| 1336 | + |
| 1337 | if (unlikely(dma_mapping_error(dev->mt76.dev, phy_addr))) { |
| 1338 | skb_free_frag(ptr); |
| 1339 | mt76_put_rxwi(&dev->mt76, r); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1340 | diff --git a/mt7915/testmode.c b/mt7915/testmode.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 1341 | index 5e20cb9e..a765f387 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1342 | --- a/mt7915/testmode.c |
| 1343 | +++ b/mt7915/testmode.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 1344 | @@ -418,12 +418,12 @@ mt7915_tm_entry_add(struct mt7915_phy *phy, u8 aid) |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1345 | memcpy(sta->addr, td->addr[0], ETH_ALEN); |
| 1346 | |
| 1347 | if (td->tx_rate_mode >= MT76_TM_TX_MODE_HT) |
| 1348 | - memcpy(&sta->deflink.ht_cap, &sband->ht_cap, sizeof(sta->deflink.ht_cap)); |
| 1349 | + memcpy(&sta->ht_cap, &sband->ht_cap, sizeof(sta->ht_cap)); |
| 1350 | if (td->tx_rate_mode >= MT76_TM_TX_MODE_VHT) |
| 1351 | - memcpy(&sta->deflink.vht_cap, &sband->vht_cap, sizeof(sta->deflink.vht_cap)); |
| 1352 | + memcpy(&sta->vht_cap, &sband->vht_cap, sizeof(sta->vht_cap)); |
| 1353 | if (td->tx_rate_mode >= MT76_TM_TX_MODE_HE_SU) |
| 1354 | - memcpy(&sta->deflink.he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap, |
| 1355 | - sizeof(sta->deflink.he_cap)); |
| 1356 | + memcpy(&sta->he_cap, &sdata[NL80211_IFTYPE_STATION].he_cap, |
| 1357 | + sizeof(sta->he_cap)); |
| 1358 | sta->aid = aid; |
| 1359 | sta->wme = 1; |
| 1360 | |
| 1361 | diff --git a/tx.c b/tx.c |
developer | 3524ece | 2023-10-12 10:46:59 +0800 | [diff] [blame] | 1362 | index 96f9009b..23a1e4e2 100644 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1363 | --- a/tx.c |
| 1364 | +++ b/tx.c |
| 1365 | @@ -60,20 +60,15 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list) |
| 1366 | .skb = skb, |
| 1367 | .info = IEEE80211_SKB_CB(skb), |
| 1368 | }; |
| 1369 | - struct ieee80211_rate_status rs = {}; |
| 1370 | struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb); |
| 1371 | struct mt76_wcid *wcid; |
| 1372 | |
| 1373 | wcid = rcu_dereference(dev->wcid[cb->wcid]); |
| 1374 | if (wcid) { |
| 1375 | status.sta = wcid_to_sta(wcid); |
| 1376 | - if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { |
| 1377 | - rs.rate_idx = wcid->rate; |
| 1378 | - status.rates = &rs; |
| 1379 | - status.n_rates = 1; |
| 1380 | - } else { |
| 1381 | - status.n_rates = 0; |
| 1382 | - } |
| 1383 | + |
| 1384 | + if (status.sta) |
| 1385 | + status.rate = &wcid->rate; |
| 1386 | } |
| 1387 | |
| 1388 | hw = mt76_tx_status_get_hw(dev, skb); |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1389 | @@ -239,6 +234,7 @@ mt76_tx_check_non_aql(struct mt76_dev *dev, struct mt76_wcid *wcid, |
developer | 22eedcc | 2023-05-03 22:59:35 +0800 | [diff] [blame] | 1390 | void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *skb, |
| 1391 | struct list_head *free_list) |
| 1392 | { |
| 1393 | + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
| 1394 | struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb); |
| 1395 | struct ieee80211_tx_status status = { |
| 1396 | .skb = skb, |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1397 | @@ -269,15 +265,13 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff * |
developer | 22eedcc | 2023-05-03 22:59:35 +0800 | [diff] [blame] | 1398 | #endif |
| 1399 | |
| 1400 | if (cb->pktid < MT_PACKET_ID_FIRST) { |
developer | 22eedcc | 2023-05-03 22:59:35 +0800 | [diff] [blame] | 1401 | - struct ieee80211_rate_status rs = {}; |
| 1402 | - |
| 1403 | hw = mt76_tx_status_get_hw(dev, skb); |
| 1404 | status.sta = wcid_to_sta(wcid); |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1405 | - if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { |
| 1406 | - rs.rate_idx = wcid->rate; |
| 1407 | - status.rates = &rs; |
| 1408 | - status.n_rates = 1; |
| 1409 | + if (status.sta) { |
| 1410 | + info->status.rates[0].idx = -1; |
| 1411 | + status.rate = &wcid->rate; |
developer | 22eedcc | 2023-05-03 22:59:35 +0800 | [diff] [blame] | 1412 | } |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1413 | + |
developer | bbd45e1 | 2023-05-19 08:22:06 +0800 | [diff] [blame] | 1414 | spin_lock_bh(&dev->rx_lock); |
developer | 2157bf8 | 2023-06-26 02:27:49 +0800 | [diff] [blame] | 1415 | ieee80211_tx_status_ext(hw, &status); |
| 1416 | spin_unlock_bh(&dev->rx_lock); |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1417 | -- |
developer | 0443cd3 | 2023-09-19 14:11:49 +0800 | [diff] [blame] | 1418 | 2.18.0 |
developer | 6100db2 | 2023-04-05 13:22:26 +0800 | [diff] [blame] | 1419 | |