Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp829031pxb; Tue, 3 Nov 2020 13:44:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsu4UL89iD6aa5XD3YwxafMG6zyKFk+QLnw64oLSjPdCt7BlBouYlZ+HSV5EXEzAk7B7Kk X-Received: by 2002:aa7:cc0e:: with SMTP id q14mr23329021edt.326.1604439871038; Tue, 03 Nov 2020 13:44:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439871; cv=none; d=google.com; s=arc-20160816; b=T+Dfx4ty8ruDDg3owhgRFCK+6rc3nI4+hTPiHTTZELT5X7pKXYdvaS2dnJBzvcHupB CNWAtpXAvgWm0sgAanFb7O9yvWd1Z4FrEKYhSGrD9nW8EsE7gtFx9PSPRi0+vMX7Nv1u zELWIEk+3bb2ZkanD7KSbjL3n2FkJGMwTQWj/z36/nG85t4A83yKxXslOBDZTEPnU7oN CMizk1NB9gXCRt7BKR1omUAluRWraOJVwDfbNcfmd1BHANqr+bFTexTtTckVaV/rv/N6 TzYRqwBE8t8QNN8SBBXF9bZCpEEH8KwfyRQ9A1vNer1q16gZZQt0U2n5rINIwkSz8cKO 8+WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p//c6lgPrjgNdhYQkr4XJ3sfc1XwTgllHHpgmO3lA7E=; b=lC6IaPlzQf478qRJ6f3Ew6BJaIBD0VUTL0P0cy5rMHdokkWg94YPAmcdjT7r+gtTbd 3dGGALj3eFZDxLiyimEbS6Pum8XpmTfruOcKzQvQWUcq1tm7jZSTCPXMh/P7sK6Out1A J1avYJncZVsghuQNZ/H7wT8pUlCwTz10eQtW07AOGMhp8h3lUq02BuQXJSdMK4AYvGR0 am3jkez7vbIW37hw8r/3bWQqUZWCF2o4ghQTbdV7++QXuiAWDzWKm3hSwc4IXwGA4qWz zbmGZY2DuXENEkHPeF5Ik1XDvh2mxVIq324yyGkVrYggtXUi52K79HtV6rKj0BtZMHmd TUmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GPglBkPy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si36061ejx.98.2020.11.03.13.44.08; Tue, 03 Nov 2020 13:44:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GPglBkPy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732365AbgKCUzk (ORCPT + 99 others); Tue, 3 Nov 2020 15:55:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:56312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732356AbgKCUzg (ORCPT ); Tue, 3 Nov 2020 15:55:36 -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 9A24722226; Tue, 3 Nov 2020 20:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436936; bh=Nf5fYs/RzYOmfwtH/Nb7YpKEX9Euk0tNiAOKPexxcdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GPglBkPyw9EjtuJSwNDftmmPCzHOrqs5F7UWYRw9nZaGexRirkimdAvqWQ7tF3aeo OvOomL6pom2ntv5TYR5vLpQACKrRfDgPm+ju5jeXbAX39wzkDGKh4SSwIRzI4x8Ol2 hFOUuY6DreBX3nOouSwqp+vDCYAqdrvlOcuEKHuE= 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 5.4 037/214] ath10k: fix VHT NSS calculation when STBC is enabled Date: Tue, 3 Nov 2020 21:34:45 +0100 Message-Id: <20201103203253.560516807@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 8ca0a808a644d..04095f91d3014 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -949,6 +949,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); @@ -993,11 +994,16 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar, */ 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 -- 2.27.0