From patchwork Mon Nov 9 12:54:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 322811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8088CC4741F for ; Mon, 9 Nov 2020 12:57:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A7D62076E for ; Mon, 9 Nov 2020 12:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926670; bh=lM/gOuG05V9bQ1POP6tN2hEdhodGCTto7IwcJTcfUjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1/4l+R07+KMOHhC1Aqx65V2q24zl2umSQp74WDtKkuCGqkYgWyBmOEskxUMTizkn2 pb8iIolfy7sOLYk0VOjEs8S8Dd8xLDvtE8ouvVWko2wKLqkABdldAknr7KePVmCiA6 a9j/ZEwn1SnriIpkrqKkY7ikExt2W/V+A/NDIaWQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730055AbgKIM5p (ORCPT ); Mon, 9 Nov 2020 07:57:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:52258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730047AbgKIM5o (ORCPT ); Mon, 9 Nov 2020 07:57:44 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F054E20789; Mon, 9 Nov 2020 12:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926663; bh=lM/gOuG05V9bQ1POP6tN2hEdhodGCTto7IwcJTcfUjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N824oq8I0EOwFkHMyehIvSp5yFAJjB8riRkfmwwhMxMh5wIx6jekF7kwsH3eo5gmQ L03wYaKd8FzvcVlJoA9LwwOk/B33ib0pvO8UGArtTzGKKxqm32Fob1eu43YRZOT1XG Tlyeblj7Ra1rWf8/vV96YqcgHxOK3EYMIoNUysqg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sathishkumar Muruganandam , Kalle Valo , Sasha Levin Subject: [PATCH 4.4 17/86] ath10k: fix VHT NSS calculation when STBC is enabled Date: Mon, 9 Nov 2020 13:54:24 +0100 Message-Id: <20201109125021.695724077@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125020.852643676@linuxfoundation.org> References: <20201109125020.852643676@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sathishkumar Muruganandam [ Upstream commit 99f41b8e43b8b4b31262adb8ac3e69088fff1289 ] When STBC is enabled, NSTS_SU value need to be accounted for VHT NSS calculation for SU case. Without this fix, 1SS + STBC enabled case was reported wrongly as 2SS in radiotap header on monitor mode capture. Tested-on: QCA9984 10.4-3.10-00047 Signed-off-by: Sathishkumar Muruganandam Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1597392971-3897-1-git-send-email-murugana@codeaurora.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/htt_rx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 1c6c422dbad64..78079ce1ad5a4 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -665,6 +665,7 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar, u8 preamble = 0; u8 group_id; u32 info1, info2, info3; + u32 stbc, nsts_su; info1 = __le32_to_cpu(rxd->ppdu_start.info1); info2 = __le32_to_cpu(rxd->ppdu_start.info2); @@ -708,11 +709,16 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar, TODO check this */ bw = info2 & 3; sgi = info3 & 1; + stbc = (info2 >> 3) & 1; group_id = (info2 >> 4) & 0x3F; if (GROUP_ID_IS_SU_MIMO(group_id)) { mcs = (info3 >> 4) & 0x0F; - nss = ((info2 >> 10) & 0x07) + 1; + nsts_su = ((info2 >> 10) & 0x07); + if (stbc) + nss = (nsts_su >> 2) + 1; + else + nss = (nsts_su + 1); } else { /* Hardware doesn't decode VHT-SIG-B into Rx descriptor * so it's impossible to decode MCS. Also since