From nobody Fri Oct 17 10:31:31 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E90BC4332F for ; Wed, 19 Oct 2022 10:38:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232007AbiJSKid (ORCPT ); Wed, 19 Oct 2022 06:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbiJSKiE (ORCPT ); Wed, 19 Oct 2022 06:38:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA65152C68; Wed, 19 Oct 2022 03:17:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BF2CFB822EA; Wed, 19 Oct 2022 08:51:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 226A8C433B5; Wed, 19 Oct 2022 08:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169472; bh=C8mJs/DW0I+lDN5k5E9k6cEFjftALrJf9Lm2fiFCk6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sew4FdAMXlO+w7FrWEvy5ZI2Q4pRE5WzS7+Ao7p4qQb2hyd7x9BCozKw57jkbQFfA 8EMtPDKKBOb1JNd73t5T4TBCrAE4RwqBgnKQgrl33/n1rQDsxNCqho0bqhQbOOJYUt nEywpRbPEfCWe1fhi01bxL5dQ3hssbiDIS78kRls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Howard Hsu , Felix Fietkau , Sasha Levin Subject: [PATCH 6.0 289/862] wifi: mt76: mt7915: fix mcs value in ht mode Date: Wed, 19 Oct 2022 10:26:16 +0200 Message-Id: <20221019083302.780637133@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Howard Hsu [ Upstream commit c6d3e16ad4362502e804a6ca01e955612f3b8222 ] Fix the error that mcs will be reduced to a range of 0 to 7 in ht mode. Fixes: 70fd1333cd32 ("mt76: mt7915: rework .set_bitrate_mask() to support m= ore options") Signed-off-by: Howard Hsu Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/= wireless/mediatek/mt76/mt7915/mcu.c index f83067961945..e99fdacc11ce 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -1360,7 +1360,7 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, struct sta_phy phy =3D {}; int ret, nrates =3D 0; =20 -#define __sta_phy_bitrate_mask_check(_mcs, _gi, _he) \ +#define __sta_phy_bitrate_mask_check(_mcs, _gi, _ht, _he) \ do { \ u8 i, gi =3D mask->control[band]._gi; \ gi =3D (_he) ? gi : gi =3D=3D NL80211_TXRATE_FORCE_SGI; \ @@ -1373,15 +1373,17 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *d= ev, continue; \ nrates +=3D hweight16(mask->control[band]._mcs[i]); \ phy.mcs =3D ffs(mask->control[band]._mcs[i]) - 1; \ + if (_ht) \ + phy.mcs +=3D 8 * i; \ } \ } while (0) =20 if (sta->deflink.he_cap.has_he) { - __sta_phy_bitrate_mask_check(he_mcs, he_gi, 1); + __sta_phy_bitrate_mask_check(he_mcs, he_gi, 0, 1); } else if (sta->deflink.vht_cap.vht_supported) { - __sta_phy_bitrate_mask_check(vht_mcs, gi, 0); + __sta_phy_bitrate_mask_check(vht_mcs, gi, 0, 0); } else if (sta->deflink.ht_cap.ht_supported) { - __sta_phy_bitrate_mask_check(ht_mcs, gi, 0); + __sta_phy_bitrate_mask_check(ht_mcs, gi, 1, 0); } else { nrates =3D hweight32(mask->control[band].legacy); phy.mcs =3D ffs(mask->control[band].legacy) - 1; --=20 2.35.1