Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3214068pxb; Mon, 9 Nov 2020 05:46:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPnkmMCNzNTfAoc8ehE18x83lL8o9EQv3TqsBNmtnqYJZOHQHgFZeJ8bPcSFdcPSDuZ0o2 X-Received: by 2002:a17:906:6d13:: with SMTP id m19mr15020073ejr.345.1604929586831; Mon, 09 Nov 2020 05:46:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929586; cv=none; d=google.com; s=arc-20160816; b=uSGoWkSLqJoZGbYPYC172z/xTR20mdOTFDxbSPK9GR/8zRGd1qGkmsZ8cXDCcj/kX3 MxjHRY/GZvg1iyT+W7sm+lngdAo758q9ERBDpcWxzoB0C2DAClpW5aOgS3dfCdG6P/gq CuUpgiLv+sQ9eBPkvNF6LrMXO12hwhiyjMPiaFDupHMFTELrlZNkiWElUaORbq2MMR7c w3gR6LlwpaDQVNY35tXav5LNEE6sbb4vuYBxPEJYqWFtdLVmmy29nz2b6A41bWKfRE0M iSDcy0gtnlLX2HfSXgy8cC2IdqsqJjIJwhz+hEmhOXaOkxISmbirMybkiPCLizkCD1GL iNKQ== 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=K28iC6QiTTWEe7PqYFnGUyGwqsRCZyPIMDxHwz0ohOs=; b=K53RB5kli7DKbNBlEnIYCe+LbqXwJB3xxw2TlbFRLcLJMM7hUkqY3KLwUo6kr8lM4F WcQwV8OrPyoPDOg9hKBSNT9Q7mpSB2R7NSJGTW7garzPd3x32NTh/lX0YhMQW8FY1HK6 7BLvTT4sBslmJc1/KKjJqFyz1KSg5OqKTF3mGUSvpOxIdZt28hYWjVOzLPZdGA8mZiU6 aWcDT4zdiQdOaeRjyIwGYbnaU/xL8wSg3fM/WTY6F3dIBp+VwZBPj6cpvBKOHb7qC1Qn tKl/ri7tTEYbTVvm5eQWVDls4FKKbv4+ynRxt7fvwVk6+EuTbaSEZeS3kMxiwtdMm+BE SK5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=awUEmHHe; 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 s9si7449191edu.457.2020.11.09.05.46.03; Mon, 09 Nov 2020 05:46:26 -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=awUEmHHe; 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 S1732693AbgKINmi (ORCPT + 99 others); Mon, 9 Nov 2020 08:42:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:54912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730521AbgKINAq (ORCPT ); Mon, 9 Nov 2020 08:00:46 -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 85324207BC; Mon, 9 Nov 2020 13:00:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604926844; bh=2aNpsB+247XzgCoz+6PtGmrTCTM8X6oQi8JO5s/kF2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=awUEmHHeDNRAljDJpEHErQJDa70sgZgHMxNuKtdgP/Sa16awFzykiVWVOobqk71Am 7bu32aR3EgaICM/4izz4Oigarzqh/FWCISN5W4KIsZxnQ0cRIin5vyO7idTiR28/vo JNOEY8WWzIemOHen/ZgoE6iAWPEb9y3FwCdJDcCo= 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.9 024/117] ath10k: fix VHT NSS calculation when STBC is enabled Date: Mon, 9 Nov 2020 13:54:10 +0100 Message-Id: <20201109125026.802672205@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@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 fce2064ebc469..3cbc71fa70d18 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -620,6 +620,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); @@ -663,11 +664,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 -- 2.27.0