From patchwork Tue Mar 25 07:55:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 3885421 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A63B1BF540 for ; Tue, 25 Mar 2014 07:56:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D31302020E for ; Tue, 25 Mar 2014 07:56:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01900201EC for ; Tue, 25 Mar 2014 07:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953AbaCYH4G (ORCPT ); Tue, 25 Mar 2014 03:56:06 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:50412 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751218AbaCYH4E (ORCPT ); Tue, 25 Mar 2014 03:56:04 -0400 Received: by mail-pa0-f47.google.com with SMTP id lj1so93432pab.34 for ; Tue, 25 Mar 2014 00:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=i1sBFZGmovx2Olf642awAGRZ08K3j+w4ZF9IhvF6bcs=; b=dE9mcqZYV6lkYTOdxTjA9b8LgU61rZ69A4/y15dSZl0k3ghFVZVy+NpNZn3Lxyezpv S448CxOMa7nbNuMhdaYQRWQgNKvQdsD+Nm/gEG/AoTjd5FbJbNNlOzlzGEYIqadN+ugH x1hJPT/3klZSWffHs1lQt4h8MlDRLz0cBvb02xqy0Sb/APVG6HADvS4X+sNi/LE0SGPP 9JvRASybJXpPkAS3LBkBl4E9Mzwedap7HpZqTJoYR7xNuXFlqQfxXbOO4WGzGZsULikx TTwHck6y+TCLUogli/fzOP1TJW0abRvJNnNT3ngZjaWfoIsuw2Hw5cD5ZuXzC8RfIfrO IbxQ== X-Received: by 10.66.13.138 with SMTP id h10mr8901931pac.148.1395734163378; Tue, 25 Mar 2014 00:56:03 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id x9sm40999344pbu.1.2014.03.25.00.56.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Mar 2014 00:56:02 -0700 (PDT) From: Chun-Yeow Yeoh To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, kvalo@qca.qualcomm.com, Chun-Yeow Yeoh Subject: [PATCH] ath10k: fix printing of peer stats in non-AP firmware Date: Tue, 25 Mar 2014 15:55:46 +0800 Message-Id: <1395734146-10907-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch is intended to fix the problem if we use the firmware 999.999.0.636 to get peer stats when the number of peer is more than 3. The WMI_UPDATE_STATS_EVENTID may trigger more than 1 time if the number of peers is more than 3. So this patch allows us to do the checking on this and make sure that we print the peer stats correctly. Signed-off-by: Chun-Yeow Yeoh --- drivers/net/wireless/ath/ath10k/debug.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 7be284c..4a4072e 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -245,10 +245,17 @@ void ath10k_debug_read_target_stats(struct ath10k *ar, if (num_peer_stats) { struct wmi_peer_stats_10x *peer_stats; struct ath10k_peer_stat *s; + int j = 0; + + if (!test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features) && + !num_pdev_stats) { + j = 3; + num_peer_stats += 3; + } stats->peers = num_peer_stats; - for (i = 0; i < num_peer_stats; i++) { + for (i = j; i < num_peer_stats; i++) { peer_stats = (struct wmi_peer_stats_10x *)tmp; s = &stats->peer_stat[i];