2 * Copyright (c) 2008-2009 Atheros Communications Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 ATH_DBG_RESET = 0x00000001,
22 ATH_DBG_QUEUE = 0x00000002,
23 ATH_DBG_EEPROM = 0x00000004,
24 ATH_DBG_CALIBRATE = 0x00000008,
25 ATH_DBG_INTERRUPT = 0x00000010,
26 ATH_DBG_REGULATORY = 0x00000020,
27 ATH_DBG_ANI = 0x00000040,
28 ATH_DBG_XMIT = 0x00000080,
29 ATH_DBG_BEACON = 0x00000100,
30 ATH_DBG_CONFIG = 0x00000200,
31 ATH_DBG_FATAL = 0x00000400,
32 ATH_DBG_PS = 0x00000800,
33 ATH_DBG_ANY = 0xffffffff
36 #define DBG_DEFAULT (ATH_DBG_FATAL)
41 #ifdef CONFIG_ATH9K_DEBUG
42 #define TX_STAT_INC(q, c) sc->debug.stats.txstats[q].c++
44 #define TX_STAT_INC(q, c) do { } while (0)
47 #ifdef CONFIG_ATH9K_DEBUG
50 * struct ath_interrupt_stats - Contains statistics about interrupts
51 * @total: Total no. of interrupts generated so far
52 * @rxok: RX with no errors
53 * @rxeol: RX with no more RXDESC available
54 * @rxorn: RX FIFO overrun
55 * @txok: TX completed at the requested rate
56 * @txurn: TX FIFO underrun
57 * @mib: MIB regs reaching its threshold
58 * @rxphyerr: RX with phy errors
59 * @rx_keycache_miss: RX with key cache misses
60 * @swba: Software Beacon Alert
62 * @bnr: Beacon Not Ready
63 * @cst: Carrier Sense TImeout
64 * @gtt: Global TX Timeout
65 * @tim: RX beacon TIM occurrence
66 * @cabend: RX End of CAB traffic
67 * @dtimsync: DTIM sync lossage
68 * @dtim: RX Beacon with DTIM
70 struct ath_interrupt_stats {
100 * struct ath_tx_stats - Statistics about TX
101 * @queued: Total MPDUs (non-aggr) queued
102 * @completed: Total MPDUs (non-aggr) completed
103 * @a_aggr: Total no. of aggregates queued
104 * @a_queued: Total AMPDUs queued
105 * @a_completed: Total AMPDUs completed
106 * @a_retries: No. of AMPDUs retried (SW)
107 * @a_xretries: No. of AMPDUs dropped due to xretries
108 * @fifo_underrun: FIFO underrun occurrences
110 - non-aggregate condition.
111 - first packet of aggregate.
112 * @xtxop: No. of frames filtered because of TXOP limit
113 * @timer_exp: Transmit timer expiry
114 * @desc_cfg_err: Descriptor configuration errors
115 * @data_urn: TX data underrun errors
116 * @delim_urn: TX delimiter underrun errors
118 struct ath_tx_stats {
135 struct ath_interrupt_stats istats;
136 struct ath_rc_stats rcstats[RATE_TABLE_SIZE];
137 struct ath_tx_stats txstats[ATH9K_NUM_TX_QUEUES];
142 struct dentry *debugfs_phy;
143 struct dentry *debugfs_debug;
144 struct dentry *debugfs_dma;
145 struct dentry *debugfs_interrupt;
146 struct dentry *debugfs_rcstat;
147 struct dentry *debugfs_wiphy;
148 struct dentry *debugfs_xmit;
149 struct ath_stats stats;
152 void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...);
153 int ath9k_init_debug(struct ath_softc *sc);
154 void ath9k_exit_debug(struct ath_softc *sc);
155 int ath9k_debug_create_root(void);
156 void ath9k_debug_remove_root(void);
157 void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
158 void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb);
159 void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
161 void ath_debug_stat_retries(struct ath_softc *sc, int rix,
162 int xretries, int retries, u8 per);
166 static inline void DPRINTF(struct ath_softc *sc, int dbg_mask,
167 const char *fmt, ...)
171 static inline int ath9k_init_debug(struct ath_softc *sc)
176 static inline void ath9k_exit_debug(struct ath_softc *sc)
180 static inline int ath9k_debug_create_root(void)
185 static inline void ath9k_debug_remove_root(void)
189 static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
190 enum ath9k_int status)
194 static inline void ath_debug_stat_rc(struct ath_softc *sc,
199 static inline void ath_debug_stat_tx(struct ath_softc *sc,
205 static inline void ath_debug_stat_retries(struct ath_softc *sc, int rix,
206 int xretries, int retries, u8 per)
210 #endif /* CONFIG_ATH9K_DEBUG */