From: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
To: ath10k@lists.infradead.org
Cc: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org,
Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Subject: [PATCH v2] ath10k: fix the MAC address of peer statistic
Date: Fri, 10 Jan 2014 17:19:24 +0800 [thread overview]
Message-ID: <1389345564-21042-1-git-send-email-yeohchunyeow@gmail.com> (raw)
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.
Based on the verification, maximum only 3 peer statistics including
self STA able to be printed out.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
v2: offset the stats to ignore the first peer (Chun-Yeow)
drivers/net/wireless/ath/ath10k/debug.c | 4 ++++
drivers/net/wireless/ath/ath10k/wmi.h | 14 +++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 6bdfad3..b39bad8 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -242,6 +242,10 @@ void ath10k_debug_read_target_stats(struct ath10k *ar,
}
}
+ /* The first peer is self MAC address, ignore this */
+ num_peer_stats--;
+ tmp += sizeof(struct wmi_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 {
--
1.7.9.5
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
next reply other threads:[~2014-01-10 9:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 9:19 Chun-Yeow Yeoh [this message]
2014-01-17 12:24 ` [PATCH v2] ath10k: fix the MAC address of peer statistic Kalle Valo
2014-01-17 13:11 ` Yeoh Chun-Yeow
2014-01-17 13:18 ` Michal Kazior
2014-01-17 13:38 ` Michal Kazior
2014-01-17 13:40 ` Kalle Valo
2014-01-18 9:53 ` Yeoh Chun-Yeow
2014-01-18 10:05 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389345564-21042-1-git-send-email-yeohchunyeow@gmail.com \
--to=yeohchunyeow@gmail.com \
--cc=ath10k@lists.infradead.org \
--cc=kvalo@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox