Skip to contentSkip to conversation

ath9k: fix PHY error accounting in debugfs

PATCH New Zefir Kurtisi 2 participants 4 messages Feb 23, 2012 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: fix PHY error accounting in debugfs

ath9k_phyerr are defined as index but have been treated as bitmask (with an outdated mask used) for counting PHY errors in debugfs.

---
 drivers/net/wireless/ath/ath9k/debug.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/debug.c +4 -4
index 68d972b..3be5b83 100644
@@ -1049,8 +1049,6 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
 #define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\
 			[sc->debug.rsidx].c)
 
-	u32 phyerr;
-
 	RX_STAT_INC(rx_pkts_all);
 	sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen;
 
@@ -1068,9 +1066,11 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
 		RX_STAT_INC(decrypt_busy_err);
 
 	if (rs->rs_status & ATH9K_RXERR_PHY) {
+		u32 phyerr;
 		RX_STAT_INC(phy_err);
-		phyerr = rs->rs_phyerr & 0x24;
-		RX_PHY_ERR_INC(phyerr);
+		phyerr = rs->rs_phyerr;
+		if (phyerr < ATH9K_PHYERR_MAX)
+			RX_PHY_ERR_INC(phyerr);
 	}
 
 	sc->debug.stats.rxstats.rs_rssi_ctl0 = rs->rs_rssi_ctl0;
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 ath9k: fix PHY error accounting in debugfs

Hi Zefir,

Quoted 24 lines · Zefir Kurtisi

ath9k_phyerr are defined as index but have been treated as bitmask (with an outdated mask used) for counting PHY errors in debugfs.
---
?drivers/net/wireless/ath/ath9k/debug.c | ? ?8 ++++---- ?1 files changed, 4 insertions(+), 4 deletions(-)

drivers/net/wireless/ath/ath9k/debug.c +1 -2
index 68d972b..3be5b83 100644
@@ -1049,8 +1049,6 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
 ?#define RX_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].rs\
 ? ? ? ? ? ? ? ? ? ? ? ?[sc->debug.rsidx].c)
 
- ? ? ? u32 phyerr;
-
 ? ? ? ?RX_STAT_INC(rx_pkts_all);
 ? ? ? ?sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen;
 
@@ -1068,9 +1066,11 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
 ? ? ? ? ? ? ? ?RX_STAT_INC(decrypt_busy_err);
 
 ? ? ? ?if (rs->rs_status & ATH9K_RXERR_PHY) {
+ ? ? ? ? ? ? ? u32 phyerr;

drivers/net/wireless/ath/ath9k/debug.c void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)

Quoted 10 lines
drivers/net/wireless/ath/ath9k/debug.c +3 -3
 ? ? ? ? ? ? ? ?RX_STAT_INC(phy_err);
- ? ? ? ? ? ? ? phyerr = rs->rs_phyerr & 0x24;
- ? ? ? ? ? ? ? RX_PHY_ERR_INC(phyerr);
+ ? ? ? ? ? ? ? phyerr = rs->rs_phyerr;
+ ? ? ? ? ? ? ? if (phyerr < ATH9K_PHYERR_MAX)
+ ? ? ? ? ? ? ? ? ? ? ? RX_PHY_ERR_INC(phyerr);
 ? ? ? ?}
 
 ? ? ? ?sc->debug.stats.rxstats.rs_rssi_ctl0 = rs->rs_rssi_ctl0;
--

very recently fixed by
http://www.spinics.net/lists/linux-wireless/msg85034.html

Signature · 2 lines
thanks,
shafi