From patchwork Tue Dec 17 16:18:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 11298147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 464886C1 for ; Tue, 17 Dec 2019 16:18:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2380B21835 for ; Tue, 17 Dec 2019 16:18:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vvo/Xs9+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2380B21835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=phrozen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FfWHkwDDY8xac5qrudJOu0i/AI4D+9FPaLTv1IYzW6g=; b=Vvo/Xs9+1icAT9 xjDwHy9RFkuPg8v2a434cYGzJAn7a/eiF1f2ihynf/XmMkQ2oonQ08ei37/iMvTkoklksxmF2T5e7 5QbqGwwh6S0K/LQNfMCVhYXlVhHSA7VQ5JAx4u0P9AtngqFBnRjyl2sVOLkHG+eDQo/IwnLDzO7nX uHomoasCx8e0DC6naUNNX35V15a2Cf2VGq7M8yDvXMG+02QYLkm5zJ2wnvJY9EIILbaD5uGpMEHpG 4MRkW1yvoirKzQebm79t29zQ8lCws+4XXK+ddSbbX9Fv/mDArDuFKSX45j+0Cd1yMkLP6OQbnHp/n HhRLapvjGsWGVPn+og/A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihFYV-0000eI-Pm; Tue, 17 Dec 2019 16:18:39 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ihFYT-0000d8-0m for ath11k@lists.infradead.org; Tue, 17 Dec 2019 16:18:38 +0000 Received: from pd95fd66b.dip0.t-ipconnect.de ([217.95.214.107] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1ihFYR-0003HI-1s; Tue, 17 Dec 2019 17:18:35 +0100 From: John Crispin To: Kalle Valo Subject: [PATCH] ath11k: properly convert peer stats Date: Tue, 17 Dec 2019 17:18:28 +0100 Message-Id: <20191217161828.1318-1-john@phrozen.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191217_081837_216543_34229113 X-CRM114-Status: UNSURE ( 9.50 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Venkateswara Naralasetty , linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org From: Venkateswara Naralasetty The bandwidth was not converted from mac80211 to ath11k values correctly. This patch adds a helper function to do it for us. Signed-off-by: John Crispin Signed-off-by: Venkateswara Naralasetty --- drivers/net/wireless/ath/ath11k/debugfs_sta.c | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/debugfs_sta.c b/drivers/net/wireless/ath/ath11k/debugfs_sta.c index d851d87e8a37..1d562133ae1e 100644 --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c @@ -11,6 +11,28 @@ #include "dp_tx.h" #include "debug_htt_stats.h" +static u8 mac80211_bw_to_ath11k_bw(u8 bw) +{ + u8 ret = 0; + + switch (bw) { + case RATE_INFO_BW_20: + ret = ATH11K_BW_20; + break; + case RATE_INFO_BW_40: + ret = ATH11K_BW_40; + break; + case RATE_INFO_BW_80: + ret = ATH11K_BW_80; + break; + case RATE_INFO_BW_160: + ret = ATH11K_BW_160; + break; + } + + return ret; +} + void ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta, struct ath11k_per_peer_tx_stats *peer_stats, @@ -26,7 +48,7 @@ ath11k_accumulate_per_peer_tx_stats(struct ath11k_sta *arsta, tx_stats = arsta->tx_stats; gi = FIELD_GET(RATE_INFO_FLAGS_SHORT_GI, arsta->txrate.flags); mcs = txrate->mcs; - bw = txrate->bw; + bw = mac80211_bw_to_ath11k_bw(txrate->bw); nss = txrate->nss - 1; #define STATS_OP_FMT(name) tx_stats->stats[ATH11K_STATS_TYPE_##name]