Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp454041pxu; Thu, 26 Nov 2020 03:06:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5nh0BjZvyokVSRhuTNpLagb8hliKysTyyobROHd0DalToLVoI0uon7WRLMP/JwDh4VOIT X-Received: by 2002:a17:906:339a:: with SMTP id v26mr958817eja.107.1606388765751; Thu, 26 Nov 2020 03:06:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606388765; cv=none; d=google.com; s=arc-20160816; b=BEgDFpE97VJ4k3EmTrPkMtooYN7ORXID5uhKLyTMzsVIKRYDBbkuxuo1AXpI1+WL+H L5XittUjPatW5o4VNaNSiMK73S/vRNybxgbbS3fXTXfdeSxDo7tD24flDwFFbKtxLUHq P94fneNwIg9vfLTeISmB/Myx8bH8iHuUSekda/MT7VTfLfN52b+9wFQObff0H4BUn5x9 BA+qJeWMkFxzwLnRBHcZXk8Eny+JsW0dS+QEcJ5xZzmr6vQsbRsh+jcoHmrtT92YjvZd tgUWoTYAmfN2G42LnpomPGkVk5dVyXmxlXlb0B87E7bFVKMLX6CDDYYO2sP7j9b0YqwC g8hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=glJAN6CZ3lVLZweMz5qN0qWGxTbjDoSzwYSh8A2DGxI=; b=R/FBNEhKt3E8mzQgg14iNdUaiyuKJ1g9xgTiUEiO94RxHzIXRVtwo3EEmIqJ+8Kqnq m9Q6Va5CxND7W6GcvNW85wU7IrUA2DTAHkbdySXpZB/ahl8gZj57854rwP4mdm3Ypjeu 6hTJvuyQEqxgNQ+j8kxwAJNhSGB3jCh1tQqp0HjvfDZa3gI++90EvmMoq5Tkx7gxyTbl JHgjidEShx+iZM+q5QA+eHSOgz6NdtYld6VVS1p7Pa7JQsYCSv4eYZDXoZ8CHGMNDON1 aAw3crpuNj3/ZZX8t/Lw9Ge/x/UKoXZEev03J9EKsr1pXojDB++NFg4HCeJpCRXREq6z PlcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si2916082ejh.106.2020.11.26.03.05.33; Thu, 26 Nov 2020 03:06:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729672AbgKZJAE (ORCPT + 99 others); Thu, 26 Nov 2020 04:00:04 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:55938 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726347AbgKZJAD (ORCPT ); Thu, 26 Nov 2020 04:00:03 -0500 X-UUID: f86e15ad02114b10b3324c8af0c0d489-20201126 X-UUID: f86e15ad02114b10b3324c8af0c0d489-20201126 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2098577214; Thu, 26 Nov 2020 16:59:59 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 26 Nov 2020 16:59:58 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 26 Nov 2020 16:59:58 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , linux-mediatek , Yiwei Chung , Shayne Chen Subject: [PATCH] mt76: mt7915: fix ht mcs in mt7915_mcu_get_rx_rate() Date: Thu, 26 Nov 2020 16:59:18 +0800 Message-ID: <20201126085918.1222-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.17.1