All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] [PATCH RFC] ath9k: collect statistics about Rx-Dup and Rx-STBC packets
@ 2013-04-27 15:25 ` Oleksij Rempel
  0 siblings, 0 replies; 44+ messages in thread
From: Oleksij Rempel @ 2013-04-27 15:25 UTC (permalink / raw)
  To: ath9k-devel

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

^ permalink raw reply related	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2013-05-08 22:45 UTC | newest]

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.