diff options
author | Evelyn Tsai <evelyn.tsai@mediatek.com> | 2022-11-11 10:36:15 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-11-11 13:38:25 +0300 |
commit | 80bcecdbc2ff4c8519edc3262ea1df4bad7bd775 (patch) | |
tree | d68dfe7e3787f643dc9c470e93169c7b76643c96 | |
parent | daa30a31cf70ff290ab4d46cc132cdd8d35f88df (diff) |
wifi: mt76: connac: update nss calculation in txs
The hardware reports the number of transmitting antennas not the actual
number of spatial streams
Co-developed-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | mt76_connac_mac.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c index 8b7ec64a..fd60123f 100644 --- a/mt76_connac_mac.c +++ b/mt76_connac_mac.c @@ -567,7 +567,7 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid, struct mt76_phy *mphy; struct rate_info rate = {}; bool cck = false; - u32 txrate, txs, mode; + u32 txrate, txs, mode, stbc; txs = le32_to_cpu(txs_data[0]); @@ -587,6 +587,10 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid, rate.mcs = FIELD_GET(MT_TX_RATE_IDX, txrate); rate.nss = FIELD_GET(MT_TX_RATE_NSS, txrate) + 1; + stbc = FIELD_GET(MT_TX_RATE_STBC, txrate); + + if (stbc && rate.nss > 1) + rate.nss >>= 1; if (rate.nss - 1 < ARRAY_SIZE(stats->tx_nss)) stats->tx_nss[rate.nss - 1]++; |