From abdd471e9f2d5c2287c095df58f32432dc0ceb00 Mon Sep 17 00:00:00 2001 From: Shayne Chen Date: Thu, 26 Nov 2020 16:59:18 +0800 Subject: [PATCH] mt76: mt7915: fix ht mcs in mt7915_mcu_get_rx_rate() 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 Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau --- mt7915/mcu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mt7915/mcu.c b/mt7915/mcu.c index f3ace0a3..e555f3c3 100644 --- a/mt7915/mcu.c +++ b/mt7915/mcu.c @@ -3553,7 +3553,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)