aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath5k/debug.h')
-rw-r--r--drivers/net/wireless/ath5k/debug.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath5k/debug.h b/drivers/net/wireless/ath5k/debug.h
index c4fd8c43df0c..2cf8d18b10e3 100644
--- a/drivers/net/wireless/ath5k/debug.h
+++ b/drivers/net/wireless/ath5k/debug.h
@@ -61,11 +61,6 @@
61#ifndef _ATH5K_DEBUG_H 61#ifndef _ATH5K_DEBUG_H
62#define _ATH5K_DEBUG_H 62#define _ATH5K_DEBUG_H
63 63
64/* set this to 1 for debugging output */
65#ifndef ATH5K_DEBUG
66#define ATH5K_DEBUG 0
67#endif
68
69struct ath5k_softc; 64struct ath5k_softc;
70struct ath5k_hw; 65struct ath5k_hw;
71struct ieee80211_hw_mode; 66struct ieee80211_hw_mode;
@@ -96,7 +91,7 @@ struct ath5k_dbg_info {
96 * @ATH5K_DEBUG_LED: led management 91 * @ATH5K_DEBUG_LED: led management
97 * @ATH5K_DEBUG_DUMP_RX: print received skb content 92 * @ATH5K_DEBUG_DUMP_RX: print received skb content
98 * @ATH5K_DEBUG_DUMP_TX: print transmit skb content 93 * @ATH5K_DEBUG_DUMP_TX: print transmit skb content
99 * @ATH5K_DEBUG_DUMPMODES: dump modes 94 * @ATH5K_DEBUG_DUMPBANDS: dump bands
100 * @ATH5K_DEBUG_TRACE: trace function calls 95 * @ATH5K_DEBUG_TRACE: trace function calls
101 * @ATH5K_DEBUG_ANY: show at any debug level 96 * @ATH5K_DEBUG_ANY: show at any debug level
102 * 97 *
@@ -118,12 +113,12 @@ enum ath5k_debug_level {
118 ATH5K_DEBUG_LED = 0x00000080, 113 ATH5K_DEBUG_LED = 0x00000080,
119 ATH5K_DEBUG_DUMP_RX = 0x00000100, 114 ATH5K_DEBUG_DUMP_RX = 0x00000100,
120 ATH5K_DEBUG_DUMP_TX = 0x00000200, 115 ATH5K_DEBUG_DUMP_TX = 0x00000200,
121 ATH5K_DEBUG_DUMPMODES = 0x00000400, 116 ATH5K_DEBUG_DUMPBANDS = 0x00000400,
122 ATH5K_DEBUG_TRACE = 0x00001000, 117 ATH5K_DEBUG_TRACE = 0x00001000,
123 ATH5K_DEBUG_ANY = 0xffffffff 118 ATH5K_DEBUG_ANY = 0xffffffff
124}; 119};
125 120
126#if ATH5K_DEBUG 121#ifdef CONFIG_ATH5K_DEBUG
127 122
128#define ATH5K_TRACE(_sc) do { \ 123#define ATH5K_TRACE(_sc) do { \
129 if (unlikely((_sc)->debug.level & ATH5K_DEBUG_TRACE)) \ 124 if (unlikely((_sc)->debug.level & ATH5K_DEBUG_TRACE)) \
@@ -158,20 +153,20 @@ void
158ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah); 153ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah);
159 154
160void 155void
161ath5k_debug_dump_modes(struct ath5k_softc *sc, 156ath5k_debug_dump_bands(struct ath5k_softc *sc);
162 struct ieee80211_hw_mode *modes);
163 157
164void 158void
165ath5k_debug_dump_skb(struct ath5k_softc *sc, 159ath5k_debug_dump_skb(struct ath5k_softc *sc,
166 struct sk_buff *skb, const char *prefix, int tx); 160 struct sk_buff *skb, const char *prefix, int tx);
167 161
168void 162void
169ath5k_debug_printtxbuf(struct ath5k_softc *sc, 163ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf);
170 struct ath5k_buf *bf, int done);
171 164
172#else /* no debugging */ 165#else /* no debugging */
173 166
174#define ATH5K_TRACE(_sc) /* empty */ 167#include <linux/compiler.h>
168
169#define ATH5K_TRACE(_sc) typecheck(struct ath5k_softc *, (_sc))
175 170
176static inline void __attribute__ ((format (printf, 3, 4))) 171static inline void __attribute__ ((format (printf, 3, 4)))
177ATH5K_DBG(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...) {} 172ATH5K_DBG(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...) {}
@@ -196,17 +191,15 @@ static inline void
196ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {} 191ath5k_debug_printrxbuffs(struct ath5k_softc *sc, struct ath5k_hw *ah) {}
197 192
198static inline void 193static inline void
199ath5k_debug_dump_modes(struct ath5k_softc *sc, 194ath5k_debug_dump_bands(struct ath5k_softc *sc) {}
200 struct ieee80211_hw_mode *modes) {}
201 195
202static inline void 196static inline void
203ath5k_debug_dump_skb(struct ath5k_softc *sc, 197ath5k_debug_dump_skb(struct ath5k_softc *sc,
204 struct sk_buff *skb, const char *prefix, int tx) {} 198 struct sk_buff *skb, const char *prefix, int tx) {}
205 199
206static inline void 200static inline void
207ath5k_debug_printtxbuf(struct ath5k_softc *sc, 201ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf) {}
208 struct ath5k_buf *bf, int done) {}
209 202
210#endif /* if ATH5K_DEBUG */ 203#endif /* ifdef CONFIG_ATH5K_DEBUG */
211 204
212#endif /* ifndef _ATH5K_DEBUG_H */ 205#endif /* ifndef _ATH5K_DEBUG_H */