mt76: mt7915: fix ht mcs in mt7915_mcu_get_rx_rate()
authorShayne Chen <shayne.chen@mediatek.com>
Thu, 26 Nov 2020 08:59:18 +0000 (16:59 +0800)
committerFelix Fietkau <nbd@nbd.name>
Fri, 4 Dec 2020 21:24:48 +0000 (22:24 +0100)
The mcs value of HT mode reported by mt7915_mcu_get_rx_rate()
has already been converted to the expected format.

Tested-by: Yiwei Chung <yiwei.chung@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 6097653..5fdd1a6 100644 (file)
@@ -3501,7 +3501,9 @@ int mt7915_mcu_get_rx_rate(struct mt7915_phy *phy, struct ieee80211_vif *vif,
                break;
        case MT_PHY_TYPE_HT:
        case MT_PHY_TYPE_HT_GF:
-               rate->mcs += (rate->nss - 1) * 8;
+               if (rate->mcs > 31)
+                       return -EINVAL;
+
                flags |= RATE_INFO_FLAGS_MCS;
 
                if (res->gi)