Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp128445pxb; Thu, 27 Jan 2022 16:59:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCZGyjKs5y1sKz0O42uwLEwMXli8/EfkZhdY/qFz/0hEr5FXTkjyUGGWDhlP07cHaOrTNk X-Received: by 2002:a63:5166:: with SMTP id r38mr4729928pgl.99.1643331558874; Thu, 27 Jan 2022 16:59:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643331558; cv=none; d=google.com; s=arc-20160816; b=o99yRgNwoUQiKpjdG0zLZjmQWB7KlWK2txe0kX/gK5pT5TaFZ+r6P4KgzHiM7x/SHJ Xejx35lXm62mAfN+At/RgPnFaFK0+fB1nxfpCJDwITp9T7jYj7GOrKIud1Rgg943VnCw Gu96Gz9CRjOKfcMNXycV+pXoVOLMTlTWdIHY/aMJ+eYk0bYHwxA9joO6YIXvDzAKO5fS 2ex9XZzDFcZQ2LkdpFUcrwmmrJ+DqkFRrEsuqi30UZ+sUcmD4Fzrc9oJChZbdiyllSId YdVpovn9Qw70A2eis1FEIiO1X+axUezMeBo+HpHoHQf6J5m2QG8Iq6HFTqc1lnBaXSpc x8Ag== 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=CzyghJCj1RFM1lS+f8nnfCr0h+NCq47aV/CMtFm9TQA=; b=BsrnvvMiQXz+AF1FY54qr7PGZ0ruZPkO/z/ABOXdhk8mbEN6YZgWf8xquJvOGJiOQl XnWoS2BqsXEIpv4utYkylhiN5dal0QFdVffKIK8y4WAgK5bY7DyCyfHyDbzS9u3d82sC SHtCta3a8Fz4JAo3qT4myVkVuBWFovnnmktKXeWfT8MZjC60L+TU9jIdI/Fnwy2LMOKO v3S8GBcoaqtRSjenOX+wxyA0PFXY/0id+p9wLLCaDwTQ9+0Qmza02wXFmRxRaD/AfPas P4xiCFSMdr1Jc95XgSLzRo2q811sTO/ZRpGW9eKESNNflwm4aP68+nVIebm/E6iqkW4x AiUw== 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 o12si2929499pll.457.2022.01.27.16.59.02; Thu, 27 Jan 2022 16:59:18 -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 S241825AbiA0NdA (ORCPT + 72 others); Thu, 27 Jan 2022 08:33:00 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:52994 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S241952AbiA0Nce (ORCPT ); Thu, 27 Jan 2022 08:32:34 -0500 X-UUID: 7a27baa13c7d444f81263719fbb8e84d-20220127 X-UUID: 7a27baa13c7d444f81263719fbb8e84d-20220127 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1472596911; Thu, 27 Jan 2022 21:32:30 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Thu, 27 Jan 2022 21:32:28 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 Jan 2022 21:32:28 +0800 From: MeiChia Chiu To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , Ryder Lee , , , MeiChia Chiu Subject: [PATCH] mt76: mt7915: fix the nss setting in bitrates Date: Thu, 27 Jan 2022 21:32:26 +0800 Message-ID: <20220127133226.14299-1-MeiChia.Chiu@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 From: MeiChia Chiu without this change, the fixed MCS only supports 1 Nss. Fixes: 70fd1333cd32f ("mt76: mt7915: rework .set_bitrate_mask() to support more options") Reviewed-by: Ryder Lee Signed-off-by: MeiChia Chiu --- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 66f8daf3168c..69c5ac10e114 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -1420,9 +1420,12 @@ mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev, phy.sgi |= gi << (i << (_he)); \ phy.he_ltf |= mask->control[band].he_ltf << (i << (_he));\ } \ - for (i = 0; i < ARRAY_SIZE(mask->control[band]._mcs); i++) \ - nrates += hweight16(mask->control[band]._mcs[i]); \ - phy.mcs = ffs(mask->control[band]._mcs[0]) - 1; \ + for (i = 0; i < ARRAY_SIZE(mask->control[band]._mcs); i++) { \ + if (!mask->control[band]._mcs[i]) \ + continue; \ + nrates += hweight16(mask->control[band]._mcs[i]); \ + phy.mcs = ffs(mask->control[band]._mcs[i]) - 1; \ + } \ } while (0) if (sta->he_cap.has_he) { -- 2.29.2