linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: ath9k-devel@lists.ath9k.org, linux-wireless@vger.kernel.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH RFC] ath9k: collect statistics about Rx-Dup and Rx-STBC packets
Date: Sat, 27 Apr 2013 17:25:26 +0200	[thread overview]
Message-ID: <1367076326-21616-1-git-send-email-linux@rempel-privat.de> (raw)

Collect statistics about recived duplicate and STBC packets.
This information should help see if STBC is actually working.

Tested on ar9285;

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
 drivers/net/wireless/ath/ath9k/debug.c | 20 +++++++++++++++++++-
 drivers/net/wireless/ath/ath9k/debug.h |  4 ++++
 drivers/net/wireless/ath/ath9k/mac.c   |  5 +++++
 drivers/net/wireless/ath/ath9k/mac.h   | 14 +++++++++++---
 4 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index e6307b8..f6c0288 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -848,7 +848,7 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
 
 	struct ath_softc *sc = file->private_data;
 	char *buf;
-	unsigned int len = 0, size = 1600;
+	unsigned int len = 0, size = 2048;
 	ssize_t retval = 0;
 
 	buf = kzalloc(size, GFP_KERNEL);
@@ -900,6 +900,11 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
 	RXS_ERR("RX-Frags", rx_frags);
 	RXS_ERR("RX-Spectral", rx_spectral);
 
+	RXS_ERR("RX-GI", rx_gi);
+	RXS_ERR("RX-HT40", rx_ht40);
+	RXS_ERR("RX-Duplicate", rx_duplicate);
+	RXS_ERR("RX-STBC", rx_stbc);
+
 	if (len > size)
 		len = size;
 
@@ -939,6 +944,14 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
 		if (rs->rs_phyerr < ATH9K_PHYERR_MAX)
 			RX_PHY_ERR_INC(rs->rs_phyerr);
 	}
+	if (rs->rs_flags & ATH9K_RX_GI)
+		RX_STAT_INC(rx_gi);
+	if (rs->rs_flags & ATH9K_RX_2040)
+		RX_STAT_INC(rx_ht40);
+	if (rs->rs_flags_2 & ATH9K_RX_DUP)
+		RX_STAT_INC(rx_duplicate);
+	if (rs->rs_flags_2 & ATH9K_RX_STBC)
+		RX_STAT_INC(rx_stbc);
 
 #ifdef CONFIG_ATH9K_MAC_DEBUG
 	spin_lock(&sc->debug.samp_lock);
@@ -1993,6 +2006,11 @@ void ath9k_get_et_stats(struct ieee80211_hw *hw,
 	AWDATA(data_underrun);
 	AWDATA(delim_underrun);
 
+	AWDATA_RX(rx_gi);
+	AWDATA_RX(rx_ht40);
+	AWDATA_RX(rx_duplicate);
+	AWDATA_RX(rx_stbc);
+
 	AWDATA_RX(crc_err);
 	AWDATA_RX(decrypt_crc_err);
 	AWDATA_RX(phy_err);
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 794a7ec..bdae1fd 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -241,6 +241,10 @@ struct ath_rx_stats {
 	u32 rx_beacons;
 	u32 rx_frags;
 	u32 rx_spectral;
+	u32 rx_gi;
+	u32 rx_ht40;
+	u32 rx_duplicate;
+	u32 rx_stbc;
 };
 
 struct ath_stats {
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 498fee0..75ea079 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -547,6 +547,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 
 	rs->rs_status = 0;
 	rs->rs_flags = 0;
+	rs->rs_flags_2 = 0;
 
 	rs->rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
 	rs->rs_tstamp = ads.AR_RcvTimestamp;
@@ -590,6 +591,10 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
 		(ads.ds_rxstatus3 & AR_GI) ? ATH9K_RX_GI : 0;
 	rs->rs_flags |=
 		(ads.ds_rxstatus3 & AR_2040) ? ATH9K_RX_2040 : 0;
+	rs->rs_flags_2 |=
+		(ads.ds_rxstatus3 & AR_RXST_DUP) ? ATH9K_RX_DUP : 0;
+	rs->rs_flags_2 |=
+		(ads.ds_rxstatus3 & AR_RXST_STBC) ? ATH9K_RX_STBC : 0;
 
 	if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
 		rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 5865f92..958d72f 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -143,6 +143,7 @@ struct ath_rx_status {
 	u8 rs_moreaggr;
 	u8 rs_num_delims;
 	u8 rs_flags;
+	u8 rs_flags_2;
 	bool is_mybeacon;
 	u32 evm0;
 	u32 evm1;
@@ -185,6 +186,7 @@ struct ath_htc_rx_status {
 #define ATH9K_RXERR_KEYMISS       0x20
 #define ATH9K_RXERR_CORRUPT_DESC  0x40
 
+/* rs_flags */
 #define ATH9K_RX_MORE             0x01
 #define ATH9K_RX_MORE_AGGR        0x02
 #define ATH9K_RX_GI               0x04
@@ -193,6 +195,10 @@ struct ath_htc_rx_status {
 #define ATH9K_RX_DELIM_CRC_POST   0x20
 #define ATH9K_RX_DECRYPT_BUSY     0x40
 
+/* rs_flags_2 */
+#define ATH9K_RX_DUP              0x01
+#define ATH9K_RX_STBC             0x02
+
 #define ATH9K_RXKEYIX_INVALID	((u8)-1)
 #define ATH9K_TXKEYIX_INVALID	((u8)-1)
 
@@ -529,11 +535,13 @@ struct ar5416_desc {
 
 #define AR_RcvTimestamp     ds_rxstatus2
 
+/* rxstatus3 */
 #define AR_GI               0x00000001
 #define AR_2040             0x00000002
-#define AR_Parallel40       0x00000004
-#define AR_Parallel40_S     2
-#define AR_RxStatusRsvd30   0x000000f8
+/* revision specific */
+#define AR_RXST_DUP         0x00000004 /* duplicate packets */
+#define AR_RXST_STBC        0x00000008
+#define AR_RxStatusRsvd30   0x000000f0
 #define AR_RxAntenna	    0xffffff00
 #define AR_RxAntenna_S	    8
 
-- 
1.8.1.2


             reply	other threads:[~2013-04-27 15:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 15:25 Oleksij Rempel [this message]
2013-04-27 18:39 ` [PATCH v2] ath9k: collect statistics about Rx-Dup and Rx-STBC packets Oleksij Rempel
2013-04-27 18:51   ` Adrian Chadd
2013-04-27 18:53     ` Oleksij Rempel
2013-04-27 19:06       ` Adrian Chadd
2013-04-27 19:13         ` Oleksij Rempel
2013-04-28  1:21         ` [ath9k-devel] " Felix Fietkau
2013-04-28  6:41 ` [PATCH v3] " Oleksij Rempel
2013-04-28 12:51 ` [PATCH RFC] " Felix Fietkau
2013-04-28 14:13   ` Oleksij Rempel
2013-04-28 15:03     ` [ath9k-devel] " Oleksij Rempel
2013-04-28 19:19       ` Oleksij Rempel
2013-04-28 19:20         ` Felix Fietkau
2013-04-29  6:45       ` Wojciech Dubowik
2013-04-29  7:20         ` Oleksij Rempel
2013-04-28 14:54   ` Ben Greear
2013-04-28 15:08     ` Felix Fietkau
2013-04-28 15:15       ` Ben Greear
2013-04-28 15:32         ` Felix Fietkau
2013-05-08  5:32       ` Sujith Manoharan
2013-05-08 16:07         ` Ben Greear
2013-05-08 22:45           ` Adrian Chadd

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=1367076326-21616-1-git-send-email-linux@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=ath9k-devel@lists.ath9k.org \
    --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;
as well as URLs for NNTP newsgroup(s).