diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/debug.h')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/debug.h | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h index 9853c9c125c1..c4be6e50996b 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.h +++ b/drivers/net/wireless/ath/ath6kl/debug.h | |||
@@ -41,6 +41,7 @@ enum ATH6K_DEBUG_MASK { | |||
41 | ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */ | 41 | ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */ |
42 | ATH6KL_DBG_WMI_DUMP = BIT(19), | 42 | ATH6KL_DBG_WMI_DUMP = BIT(19), |
43 | ATH6KL_DBG_SUSPEND = BIT(20), | 43 | ATH6KL_DBG_SUSPEND = BIT(20), |
44 | ATH6KL_DBG_USB = BIT(21), | ||
44 | ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */ | 45 | ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */ |
45 | }; | 46 | }; |
46 | 47 | ||
@@ -55,35 +56,16 @@ int ath6kl_printk(const char *level, const char *fmt, ...); | |||
55 | #define ath6kl_warn(fmt, ...) \ | 56 | #define ath6kl_warn(fmt, ...) \ |
56 | ath6kl_printk(KERN_WARNING, fmt, ##__VA_ARGS__) | 57 | ath6kl_printk(KERN_WARNING, fmt, ##__VA_ARGS__) |
57 | 58 | ||
58 | #define AR_DBG_LVL_CHECK(mask) (debug_mask & mask) | ||
59 | |||
60 | enum ath6kl_war { | 59 | enum ath6kl_war { |
61 | ATH6KL_WAR_INVALID_RATE, | 60 | ATH6KL_WAR_INVALID_RATE, |
62 | }; | 61 | }; |
63 | 62 | ||
64 | #ifdef CONFIG_ATH6KL_DEBUG | 63 | #ifdef CONFIG_ATH6KL_DEBUG |
65 | #define ath6kl_dbg(mask, fmt, ...) \ | ||
66 | ({ \ | ||
67 | int rtn; \ | ||
68 | if (debug_mask & mask) \ | ||
69 | rtn = ath6kl_printk(KERN_DEBUG, fmt, ##__VA_ARGS__); \ | ||
70 | else \ | ||
71 | rtn = 0; \ | ||
72 | \ | ||
73 | rtn; \ | ||
74 | }) | ||
75 | 64 | ||
76 | static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask, | 65 | void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...); |
77 | const char *msg, const char *prefix, | 66 | void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask, |
78 | const void *buf, size_t len) | 67 | const char *msg, const char *prefix, |
79 | { | 68 | const void *buf, size_t len); |
80 | if (debug_mask & mask) { | ||
81 | if (msg) | ||
82 | ath6kl_dbg(mask, "%s\n", msg); | ||
83 | |||
84 | print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len); | ||
85 | } | ||
86 | } | ||
87 | 69 | ||
88 | void ath6kl_dump_registers(struct ath6kl_device *dev, | 70 | void ath6kl_dump_registers(struct ath6kl_device *dev, |
89 | struct ath6kl_irq_proc_registers *irq_proc_reg, | 71 | struct ath6kl_irq_proc_registers *irq_proc_reg, |