Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1786280rwb; Thu, 10 Nov 2022 23:41:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hzp0FxhrfgpuG+T8w+RpOOgmHbY02SnXHC011zEslBM8gap3DCRNE7je/UuuU/BsFezlr X-Received: by 2002:a17:907:cb85:b0:7ad:b9a0:8a9b with SMTP id un5-20020a170907cb8500b007adb9a08a9bmr939970ejc.509.1668152509234; Thu, 10 Nov 2022 23:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668152509; cv=none; d=google.com; s=arc-20160816; b=VByfqxFFjGqm+BFHj7D5daOSy7vpHOzO/psKNX1JTN/CN/qg1IwNkeOHXubO6HcJFe xXm3WuBIesxT7sA4GG3zADY8LsW3V1fRjfotWLecF8CXPt4VeE6jxy9oqTYGh/b+1O64 wDkirIB+bB1G2mmm3eLEcKsIvLEXKiNpuLVUcnnFvapEvVCv7HumGQ6Lmw6hWzmmf7DE DeyeWXzORaNa/ObILa6u53Rj6ikITd+TVYzh8WWsgas52fxa2kXPKhYmN/iYxLRPktTV U5/vWXVwusD2sugAhd2P1fmYBdbXXAXXqjopZtX9PQQWNfcwyKow9oUfpIWd1xSJHWdO SH9Q== 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 :dkim-signature; bh=TL1DUTNfvzaTDC5V59A/ZBBk1n7wWZR3gc8cGOLQ5D4=; b=ZNess1nz+E3T0Y3zfNxwWMgYGr9bOq4uOD+wL9hS5L+GrJ4rBnNMfu3pWKvMZ88Nf+ 1qkR88Z0S3pBPQN8YEB7gaHS2KsQUiD7hNP09hT0QsQgOBDzS/9LkrZocURsufUVKw09 9JRrOUBRJ7fJO9UuXUKFAn5lhIC2UOmKDuq9R/6qlXHGJugLDXWGb81nsGL6ervyZoCe VTysDZ5RtBoDMAbefj2pcD64LqPBtFk0t/H8e56p2oFolHYQJIzW47u7GK/iIa9rU/pu OkdE1+2BkLptFtmcL4pwCRKPHRE3kX0UBmnPT6xEVJlq9h3Z5fN3lu4NsNG4Q0+ROtN3 r6Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=euRNAwOz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a1709063ecf00b007ad8bc64c89si1016091ejj.701.2022.11.10.23.41.27; Thu, 10 Nov 2022 23:41:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=euRNAwOz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbiKKHg2 (ORCPT + 66 others); Fri, 11 Nov 2022 02:36:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbiKKHg0 (ORCPT ); Fri, 11 Nov 2022 02:36:26 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B152BC14 for ; Thu, 10 Nov 2022 23:36:21 -0800 (PST) X-UUID: 411b14f236ca4e89a47293c71972efb6-20221111 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=TL1DUTNfvzaTDC5V59A/ZBBk1n7wWZR3gc8cGOLQ5D4=; b=euRNAwOzB8yEiRwTM3nZe5E2XO7WcRKyHzROM78uNIVY6350LfBM4lGJkAmyAf5mAfb7VynW/HN+ck/t1+J3GsCtlTX8SHQg44wo77xXeWYixeiMthS6qsSuvlskJZn/4AyC033v6RKd8edur/HyGbK1Dd43d0UKEcsknUoR4dc=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.13,REQID:cfd32e8c-432a-4ea1-80e7-59d78b194fa0,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:d12e911,CLOUDID:37fdfe85-088c-4756-8f76-577be701e693,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 411b14f236ca4e89a47293c71972efb6-20221111 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1711142073; Fri, 11 Nov 2022 15:36:17 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Fri, 11 Nov 2022 15:36:16 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Fri, 11 Nov 2022 15:36:16 +0800 From: Evelyn Tsai To: Felix Fietkau CC: Lorenzo Bianconi , Ryder Lee , Shayne Chen , Evelyn Tsai , , , Peter Chiu Subject: [PATCH] wifi: mt76: connac: update nss calculation in txs Date: Fri, 11 Nov 2022 15:36:15 +0800 Message-ID: <20221111073615.25666-1-evelyn.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Co-developed-by: Peter Chiu Signed-off-by: Peter Chiu Signed-off-by: Evelyn Tsai --- drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c index 8b7ec64abc95..fd60123fb284 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c @@ -567,7 +567,7 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid, struct mt76_phy *mphy; struct rate_info rate = {}; bool cck = false; - u32 txrate, txs, mode; + u32 txrate, txs, mode, stbc; txs = le32_to_cpu(txs_data[0]); @@ -587,6 +587,10 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid, rate.mcs = FIELD_GET(MT_TX_RATE_IDX, txrate); rate.nss = FIELD_GET(MT_TX_RATE_NSS, txrate) + 1; + stbc = FIELD_GET(MT_TX_RATE_STBC, txrate); + + if (stbc && rate.nss > 1) + rate.nss >>= 1; if (rate.nss - 1 < ARRAY_SIZE(stats->tx_nss)) stats->tx_nss[rate.nss - 1]++; -- 2.18.0