1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun * Copyright (c) 2008-2011 Atheros Communications Inc.
3*4882a593Smuzhiyun *
4*4882a593Smuzhiyun * Permission to use, copy, modify, and/or distribute this software for any
5*4882a593Smuzhiyun * purpose with or without fee is hereby granted, provided that the above
6*4882a593Smuzhiyun * copyright notice and this permission notice appear in all copies.
7*4882a593Smuzhiyun *
8*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9*4882a593Smuzhiyun * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10*4882a593Smuzhiyun * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11*4882a593Smuzhiyun * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12*4882a593Smuzhiyun * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13*4882a593Smuzhiyun * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14*4882a593Smuzhiyun * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*4882a593Smuzhiyun */
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun /**
20*4882a593Smuzhiyun * struct ath_rx_stats - RX Statistics
21*4882a593Smuzhiyun * @rx_pkts_all: No. of total frames received, including ones that
22*4882a593Smuzhiyun may have had errors.
23*4882a593Smuzhiyun * @rx_bytes_all: No. of total bytes received, including ones that
24*4882a593Smuzhiyun may have had errors.
25*4882a593Smuzhiyun * @crc_err: No. of frames with incorrect CRC value
26*4882a593Smuzhiyun * @decrypt_crc_err: No. of frames whose CRC check failed after
27*4882a593Smuzhiyun decryption process completed
28*4882a593Smuzhiyun * @phy_err: No. of frames whose reception failed because the PHY
29*4882a593Smuzhiyun encountered an error
30*4882a593Smuzhiyun * @mic_err: No. of frames with incorrect TKIP MIC verification failure
31*4882a593Smuzhiyun * @pre_delim_crc_err: Pre-Frame delimiter CRC error detections
32*4882a593Smuzhiyun * @post_delim_crc_err: Post-Frame delimiter CRC error detections
33*4882a593Smuzhiyun * @decrypt_busy_err: Decryption interruptions counter
34*4882a593Smuzhiyun * @phy_err_stats: Individual PHY error statistics
35*4882a593Smuzhiyun * @rx_len_err: No. of frames discarded due to bad length.
36*4882a593Smuzhiyun * @rx_oom_err: No. of frames dropped due to OOM issues.
37*4882a593Smuzhiyun * @rx_rate_err: No. of frames dropped due to rate errors.
38*4882a593Smuzhiyun * @rx_too_many_frags_err: Frames dropped due to too-many-frags received.
39*4882a593Smuzhiyun * @rx_beacons: No. of beacons received.
40*4882a593Smuzhiyun * @rx_frags: No. of rx-fragements received.
41*4882a593Smuzhiyun * @rx_spectral: No of spectral packets received.
42*4882a593Smuzhiyun * @rx_spectral_sample_good: No. of good spectral samples
43*4882a593Smuzhiyun * @rx_spectral_sample_err: No. of good spectral samples
44*4882a593Smuzhiyun */
45*4882a593Smuzhiyun struct ath_rx_stats {
46*4882a593Smuzhiyun u32 rx_pkts_all;
47*4882a593Smuzhiyun u32 rx_bytes_all;
48*4882a593Smuzhiyun u32 crc_err;
49*4882a593Smuzhiyun u32 decrypt_crc_err;
50*4882a593Smuzhiyun u32 phy_err;
51*4882a593Smuzhiyun u32 mic_err;
52*4882a593Smuzhiyun u32 pre_delim_crc_err;
53*4882a593Smuzhiyun u32 post_delim_crc_err;
54*4882a593Smuzhiyun u32 decrypt_busy_err;
55*4882a593Smuzhiyun u32 phy_err_stats[ATH9K_PHYERR_MAX];
56*4882a593Smuzhiyun u32 rx_len_err;
57*4882a593Smuzhiyun u32 rx_oom_err;
58*4882a593Smuzhiyun u32 rx_rate_err;
59*4882a593Smuzhiyun u32 rx_too_many_frags_err;
60*4882a593Smuzhiyun u32 rx_beacons;
61*4882a593Smuzhiyun u32 rx_frags;
62*4882a593Smuzhiyun u32 rx_spectral;
63*4882a593Smuzhiyun u32 rx_spectral_sample_good;
64*4882a593Smuzhiyun u32 rx_spectral_sample_err;
65*4882a593Smuzhiyun };
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun #ifdef CONFIG_ATH9K_COMMON_DEBUG
68*4882a593Smuzhiyun void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
69*4882a593Smuzhiyun struct ath_hw *ah);
70*4882a593Smuzhiyun void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
71*4882a593Smuzhiyun struct ath_hw *ah);
72*4882a593Smuzhiyun void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats,
73*4882a593Smuzhiyun struct ath_rx_status *rs);
74*4882a593Smuzhiyun void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
75*4882a593Smuzhiyun struct ath_rx_stats *rxstats);
76*4882a593Smuzhiyun void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
77*4882a593Smuzhiyun struct ath_rx_stats *rxstats);
78*4882a593Smuzhiyun #else
ath9k_cmn_debug_modal_eeprom(struct dentry * debugfs_phy,struct ath_hw * ah)79*4882a593Smuzhiyun static inline void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy,
80*4882a593Smuzhiyun struct ath_hw *ah)
81*4882a593Smuzhiyun {
82*4882a593Smuzhiyun }
83*4882a593Smuzhiyun
ath9k_cmn_debug_base_eeprom(struct dentry * debugfs_phy,struct ath_hw * ah)84*4882a593Smuzhiyun static inline void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy,
85*4882a593Smuzhiyun struct ath_hw *ah)
86*4882a593Smuzhiyun {
87*4882a593Smuzhiyun }
88*4882a593Smuzhiyun
ath9k_cmn_debug_stat_rx(struct ath_rx_stats * rxstats,struct ath_rx_status * rs)89*4882a593Smuzhiyun static inline void ath9k_cmn_debug_stat_rx(struct ath_rx_stats *rxstats,
90*4882a593Smuzhiyun struct ath_rx_status *rs)
91*4882a593Smuzhiyun {
92*4882a593Smuzhiyun }
93*4882a593Smuzhiyun
ath9k_cmn_debug_recv(struct dentry * debugfs_phy,struct ath_rx_stats * rxstats)94*4882a593Smuzhiyun static inline void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
95*4882a593Smuzhiyun struct ath_rx_stats *rxstats)
96*4882a593Smuzhiyun {
97*4882a593Smuzhiyun }
98*4882a593Smuzhiyun
ath9k_cmn_debug_phy_err(struct dentry * debugfs_phy,struct ath_rx_stats * rxstats)99*4882a593Smuzhiyun static inline void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
100*4882a593Smuzhiyun struct ath_rx_stats *rxstats)
101*4882a593Smuzhiyun {
102*4882a593Smuzhiyun }
103*4882a593Smuzhiyun #endif /* CONFIG_ATH9K_COMMON_DEBUG */
104