diff mbox series

mt76: mt7915: fix ht mcs in mt7915_mcu_get_rx_rate()

Message ID 20201126085918.1222-1-shayne.chen@mediatek.com (mailing list archive)
State Accepted
Delegated to: Felix Fietkau
Headers show
Series mt76: mt7915: fix ht mcs in mt7915_mcu_get_rx_rate() | expand

Commit Message

Shayne Chen Nov. 26, 2020, 8:59 a.m. UTC
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>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 600ab7a..71f9140 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -3524,7 +3524,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)