wifi: mt76: mt7915: fix beamforming availability check
authorMeiChia Chiu <meichia.chiu@mediatek.com>
Thu, 31 Aug 2023 06:22:21 +0000 (14:22 +0800)
committerFelix Fietkau <nbd@nbd.name>
Sat, 30 Sep 2023 18:03:05 +0000 (20:03 +0200)
Without this patch, when ap sets the tx stream number to 2,
ap won't send any beamforming packet.

Fixes: f89f297aef28 ("mt76: mt7915: fix txbf starec TLV issues")
Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c

index 79d0a0f3cc579f9dbcd0cf9729167e53a4478463..b22f06d4411a821c4dd8d54d62428dd018a0a403 100644 (file)
@@ -1019,13 +1019,13 @@ mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
                        struct ieee80211_sta *sta, bool bfee)
 {
        struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
-       int tx_ant = hweight8(phy->mt76->chainmask) - 1;
+       int sts = hweight16(phy->mt76->chainmask);
 
        if (vif->type != NL80211_IFTYPE_STATION &&
            vif->type != NL80211_IFTYPE_AP)
                return false;
 
-       if (!bfee && tx_ant < 2)
+       if (!bfee && sts < 2)
                return false;
 
        if (sta->deflink.he_cap.has_he) {