Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp199739pxa; Fri, 14 Aug 2020 01:20:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbusXfkTTA2MQOumJ3t0HX7iIoV5lgivHNRj/VoC2ZmYsH7HpuNoWTt6d2r8qFpLUREBfm X-Received: by 2002:a17:906:68da:: with SMTP id y26mr1300804ejr.250.1597393209693; Fri, 14 Aug 2020 01:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597393209; cv=none; d=google.com; s=arc-20160816; b=yvSgbh1qO4Wl4uhM5ye2oOLz+WpCrTlrU6FbAVRepvDXJegkRcDKUxWETJlQt/ehbT +FZ6hQeSB1BMk+yYrHTMAb65s2ZPmKfRqm3LNeDhk2RtXC0h/pz+3AB5AeLK03YwJRdX gM4w1Qf7tDoBCsfSmdUYr7Q9e4mbzH9oU05TNnhuVbMk7MvLBHsGzmXWLOPUothcFD6m FVYVWy/JtEiycZXmGptgqsT1SqPK6gzn0FjSOSdEIwyiCiKlIpzDlerxJ557L6u82vJp t/NKHzzpZfoRwEmhEhCCFhCiCQGLkf0y2hiPdTDzU/qjEcapuGuytphCciTR5BYflqcD XJ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=lnzaU5x/eb/SY6vqMa8f2socCUuckZSYtZCe7OACABo=; b=gzKIImrEmugs2rvd9UU/FLjieA1gS0Y1oURw97181bO38nKaBvxvv99/r91V+CVaD6 1A6FdVT1b7krbHbqSmiVtrcowu0KOX8LsJW3ssHSNK7CjGQID3PW4dzAvrhyMENG368k HPMebwOAe188xFMo01TrSCkduDwiujWxuz/zsixMHnaV+8pQRw71vmySl88LtZYDUROU bhiZzs+OPj58wxXMIV/MNerDWxbWgGL1RaWqh2866kFAntDTGlgLPmDGw/Iu3qZSU23r hazHVSQySp4VYeA0FNrpHpbPNE6TwEGKCNSYHhQEJWUd5h9ZLy/SqXHHMOKbUUvJidKV HXCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=u7ICPIWS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si4597028edx.70.2020.08.14.01.19.45; Fri, 14 Aug 2020 01:20:09 -0700 (PDT) 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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=u7ICPIWS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgHNIQm (ORCPT + 99 others); Fri, 14 Aug 2020 04:16:42 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:25177 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbgHNIQk (ORCPT ); Fri, 14 Aug 2020 04:16:40 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597393000; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=lnzaU5x/eb/SY6vqMa8f2socCUuckZSYtZCe7OACABo=; b=u7ICPIWS1OBXSdsT0tjYwGQYgsgTBM4WKJclgCG5WJxqEnNfXrFMTPz1ZUIGmAp2pUIw+w7T 6hAuDLTsBkyuBF1Eu5Yb6mZncdyLT+h8YbcMHW2N1TR0Pm99kJduamx79NExhA/5m4fHTxul TeFn114/W49hWfw/7HNWvEZvJ+M= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5f36485dc85a1092b07722bb (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 14 Aug 2020 08:16:29 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 269E6C433C6; Fri, 14 Aug 2020 08:16:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from murugana-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: murugana) by smtp.codeaurora.org (Postfix) with ESMTPSA id 66B76C433C9; Fri, 14 Aug 2020 08:16:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 66B76C433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=murugana@codeaurora.org From: Sathishkumar Muruganandam To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Sathishkumar Muruganandam Subject: [PATCH] ath10k: fix VHT NSS calculation when STBC is enabled Date: Fri, 14 Aug 2020 13:46:11 +0530 Message-Id: <1597392971-3897-1-git-send-email-murugana@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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 69ad4ca1a87c..a00498338b1c 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.7.4