From patchwork Fri Jan 3 09:43:27 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: 3430781 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 E4E7CC02DC for ; Fri, 3 Jan 2014 09:43:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3A022013A for ; Fri, 3 Jan 2014 09:43:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05DE120134 for ; Fri, 3 Jan 2014 09:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750863AbaACJnl (ORCPT ); Fri, 3 Jan 2014 04:43:41 -0500 Received: from mail-pb0-f53.google.com ([209.85.160.53]:58118 "EHLO mail-pb0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbaACJni (ORCPT ); Fri, 3 Jan 2014 04:43:38 -0500 Received: by mail-pb0-f53.google.com with SMTP id ma3so15424374pbc.40 for ; Fri, 03 Jan 2014 01:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=MxbO+2YrF2O9dZhU1uCuaT9CddxUutWlNrAvVclO9bQ=; b=HR1D5KmIs3anKN5c2oNce0MPOP5YRTB77nbZE4qHhu78TYHhzmuWJZ7+A/BDyetDUt bc+Xb3r8T2ksK5h4x4qrZEDV8kuR7Ew8LXswMYY7xaXqPlblcxrBOuyKgbHyktgARPCM tGqJgU/mh6kAMMEUGZpXv+OWLwOmD2ZF6796ee/ya0iGPhhx0haJWgswZ72MAxIfuJJL dpe0g1r1UZTC91U9UW4g6pi6ZE2frbHW6Zb29Zc9UE+zxP+FIKGuzLHaO+lscnYD1VBX N4UracRyoFmfsvw6wUQClTCxXEbltSkgY8Tino8zM7Rc5RxWulmdGGc1wO/vTmFIV80Z YIlA== X-Received: by 10.66.163.36 with SMTP id yf4mr28409789pab.67.1388742217858; Fri, 03 Jan 2014 01:43:37 -0800 (PST) Received: from localhost.localdomain ([58.26.233.145]) by mx.google.com with ESMTPSA id iu7sm107540620pbc.45.2014.01.03.01.43.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Jan 2014 01:43:36 -0800 (PST) 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 the MAC address of peer statistic Date: Fri, 3 Jan 2014 17:43:27 +0800 Message-Id: <1388742207-15694-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.3 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 Fix the MAC address of wmi_peer_stats so that it is printed correctly. This is tested and verified using firmware version 999.999.0.636. Signed-off-by: Chun-Yeow Yeoh --- drivers/net/wireless/ath/ath10k/debug.c | 3 +++ drivers/net/wireless/ath/ath10k/wmi.h | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 6bdfad3..eec3439 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -242,6 +242,9 @@ void ath10k_debug_read_target_stats(struct ath10k *ar, } } + /* The first peer is self MAC address, ignore this */ + num_peer_stats--; + if (num_peer_stats) { struct wmi_peer_stats *peer_stats; struct ath10k_peer_stat *s; diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 0087d69..106a23e 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -200,12 +200,12 @@ struct wmi_mac_addr { /* macro to convert MAC address from WMI word format to char array */ #define WMI_MAC_ADDR_TO_CHAR_ARRAY(pwmi_mac_addr, c_macaddr) do { \ - (c_macaddr)[0] = ((pwmi_mac_addr)->word0) & 0xff; \ - (c_macaddr)[1] = (((pwmi_mac_addr)->word0) >> 8) & 0xff; \ - (c_macaddr)[2] = (((pwmi_mac_addr)->word0) >> 16) & 0xff; \ - (c_macaddr)[3] = (((pwmi_mac_addr)->word0) >> 24) & 0xff; \ - (c_macaddr)[4] = ((pwmi_mac_addr)->word1) & 0xff; \ - (c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 8) & 0xff; \ + (c_macaddr)[0] = (((pwmi_mac_addr)->word0) >> 24) & 0xff; \ + (c_macaddr)[1] = (((pwmi_mac_addr)->word0) >> 16) & 0xff; \ + (c_macaddr)[2] = (((pwmi_mac_addr)->word0) >> 8) & 0xff; \ + (c_macaddr)[3] = ((pwmi_mac_addr)->word0) & 0xff; \ + (c_macaddr)[4] = (((pwmi_mac_addr)->word1) >> 24) & 0xff; \ + (c_macaddr)[5] = (((pwmi_mac_addr)->word1) >> 16) & 0xff; \ } while (0) struct wmi_cmd_map { @@ -2820,9 +2820,9 @@ struct wmi_vdev_stats { * TODO: add more stats */ struct wmi_peer_stats { + __le32 peer_tx_rate; /* TBA */ struct wmi_mac_addr peer_macaddr; __le32 peer_rssi; - __le32 peer_tx_rate; } __packed; struct wmi_vdev_create_cmd {