diff options
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/debug.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/debug.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/debug.c b/drivers/net/wireless/brcm80211/brcmsmac/debug.c new file mode 100644 index 000000000000..6ba4136c7cf6 --- /dev/null +++ b/drivers/net/wireless/brcm80211/brcmsmac/debug.c | |||
@@ -0,0 +1,44 @@ | |||
1 | #include <linux/net.h> | ||
2 | #include "types.h" | ||
3 | #include "debug.h" | ||
4 | #include "brcms_trace_events.h" | ||
5 | |||
6 | #define __brcms_fn(fn) \ | ||
7 | void __brcms_ ##fn(struct device *dev, const char *fmt, ...) \ | ||
8 | { \ | ||
9 | struct va_format vaf = { \ | ||
10 | .fmt = fmt, \ | ||
11 | }; \ | ||
12 | va_list args; \ | ||
13 | \ | ||
14 | va_start(args, fmt); \ | ||
15 | vaf.va = &args; \ | ||
16 | dev_ ##fn(dev, "%pV", &vaf); \ | ||
17 | trace_brcms_ ##fn(&vaf); \ | ||
18 | va_end(args); \ | ||
19 | } | ||
20 | |||
21 | __brcms_fn(info) | ||
22 | __brcms_fn(warn) | ||
23 | __brcms_fn(err) | ||
24 | __brcms_fn(crit) | ||
25 | |||
26 | #if defined(CONFIG_BRCMDBG) || defined(CONFIG_BRCM_TRACING) | ||
27 | void __brcms_dbg(struct device *dev, u32 level, const char *func, | ||
28 | const char *fmt, ...) | ||
29 | { | ||
30 | struct va_format vaf = { | ||
31 | .fmt = fmt, | ||
32 | }; | ||
33 | va_list args; | ||
34 | |||
35 | va_start(args, fmt); | ||
36 | vaf.va = &args; | ||
37 | #ifdef CONFIG_BRCMDBG | ||
38 | if ((brcm_msg_level & level) && net_ratelimit()) | ||
39 | dev_err(dev, "%s %pV", func, &vaf); | ||
40 | #endif | ||
41 | trace_brcms_dbg(level, func, &vaf); | ||
42 | va_end(args); | ||
43 | } | ||
44 | #endif | ||