diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-05-11 04:04:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-13 15:56:40 -0400 |
commit | b5a0c86a56e4494eab84b142ab5501eb62685150 (patch) | |
tree | dab4503f829565ff87c04030e63b3d6dd20728b7 /drivers/net/wireless/ath/ath9k/common-debug.c | |
parent | 9d83cd5cd2e43f7f24feec66f8d15457589f7033 (diff) |
ath9k & ath9k_htc: move ath_rx_stats to cmn
and use it. This move need changes in both drivers.
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/common-debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common-debug.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c b/drivers/net/wireless/ath/ath9k/common-debug.c index f2234e06a0ad..ef538d23b18c 100644 --- a/drivers/net/wireless/ath/ath9k/common-debug.c +++ b/drivers/net/wireless/ath/ath9k/common-debug.c | |||
@@ -86,3 +86,36 @@ void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy, | |||
86 | &fops_base_eeprom); | 86 | &fops_base_eeprom); |
87 | } | 87 | } |
88 | EXPORT_SYMBOL(ath9k_cmn_debug_base_eeprom); | 88 | EXPORT_SYMBOL(ath9k_cmn_debug_base_eeprom); |
89 | |||
90 | void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats, | ||
91 | struct ath_rx_status *rs) | ||
92 | { | ||
93 | #define RX_PHY_ERR_INC(c) rxstats->phy_err_stats[c]++ | ||
94 | #define RX_CMN_STAT_INC(c) (rxstats->c++) | ||
95 | |||
96 | RX_CMN_STAT_INC(rx_pkts_all); | ||
97 | rxstats->rx_bytes_all += rs->rs_datalen; | ||
98 | |||
99 | if (rs->rs_status & ATH9K_RXERR_CRC) | ||
100 | RX_CMN_STAT_INC(crc_err); | ||
101 | if (rs->rs_status & ATH9K_RXERR_DECRYPT) | ||
102 | RX_CMN_STAT_INC(decrypt_crc_err); | ||
103 | if (rs->rs_status & ATH9K_RXERR_MIC) | ||
104 | RX_CMN_STAT_INC(mic_err); | ||
105 | if (rs->rs_status & ATH9K_RX_DELIM_CRC_PRE) | ||
106 | RX_CMN_STAT_INC(pre_delim_crc_err); | ||
107 | if (rs->rs_status & ATH9K_RX_DELIM_CRC_POST) | ||
108 | RX_CMN_STAT_INC(post_delim_crc_err); | ||
109 | if (rs->rs_status & ATH9K_RX_DECRYPT_BUSY) | ||
110 | RX_CMN_STAT_INC(decrypt_busy_err); | ||
111 | |||
112 | if (rs->rs_status & ATH9K_RXERR_PHY) { | ||
113 | RX_CMN_STAT_INC(phy_err); | ||
114 | if (rs->rs_phyerr < ATH9K_PHYERR_MAX) | ||
115 | RX_PHY_ERR_INC(rs->rs_phyerr); | ||
116 | } | ||
117 | |||
118 | #undef RX_CMN_STAT_INC | ||
119 | #undef RX_PHY_ERR_INC | ||
120 | } | ||
121 | EXPORT_SYMBOL(ath9k_cmn_debug_stat_rx); | ||