aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.c30
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.h25
2 files changed, 34 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index bd2f1fae72a9..4ba6560f0bf3 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -57,6 +57,36 @@ int ath6kl_printk(const char *level, const char *fmt, ...)
57 57
58#ifdef CONFIG_ATH6KL_DEBUG 58#ifdef CONFIG_ATH6KL_DEBUG
59 59
60void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...)
61{
62 struct va_format vaf;
63 va_list args;
64
65 if (!(debug_mask & mask))
66 return;
67
68 va_start(args, fmt);
69
70 vaf.fmt = fmt;
71 vaf.va = &args;
72
73 ath6kl_printk(KERN_DEBUG, "%pV", &vaf);
74
75 va_end(args);
76}
77
78void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
79 const char *msg, const char *prefix,
80 const void *buf, size_t len)
81{
82 if (debug_mask & mask) {
83 if (msg)
84 ath6kl_dbg(mask, "%s\n", msg);
85
86 print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
87 }
88}
89
60#define REG_OUTPUT_LEN_PER_LINE 25 90#define REG_OUTPUT_LEN_PER_LINE 25
61#define REGTYPE_STR_LEN 100 91#define REGTYPE_STR_LEN 100
62 92
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 9dc39754a35f..872a8ce5d8f3 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -60,28 +60,11 @@ enum ath6kl_war {
60}; 60};
61 61
62#ifdef CONFIG_ATH6KL_DEBUG 62#ifdef CONFIG_ATH6KL_DEBUG
63#define ath6kl_dbg(mask, fmt, ...) \
64 ({ \
65 int rtn; \
66 if (debug_mask & mask) \
67 rtn = ath6kl_printk(KERN_DEBUG, fmt, ##__VA_ARGS__); \
68 else \
69 rtn = 0; \
70 \
71 rtn; \
72 })
73 63
74static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask, 64void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...);
75 const char *msg, const char *prefix, 65void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
76 const void *buf, size_t len) 66 const char *msg, const char *prefix,
77{ 67 const void *buf, size_t len);
78 if (debug_mask & mask) {
79 if (msg)
80 ath6kl_dbg(mask, "%s\n", msg);
81
82 print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
83 }
84}
85 68
86void ath6kl_dump_registers(struct ath6kl_device *dev, 69void ath6kl_dump_registers(struct ath6kl_device *dev,
87 struct ath6kl_irq_proc_registers *irq_proc_reg, 70 struct ath6kl_irq_proc_registers *irq_proc_reg,