1114833464cd20cc7f8d4d834b772423ac3c0d0f
[platform/kernel/linux-rpi.git] / drivers / net / wireless / brcm80211 / brcmsmac / debug.h
1 #ifndef _BRCMS_DEBUG_H_
2 #define _BRCMS_DEBUG_H_
3
4 #include <linux/device.h>
5 #include <linux/bcma/bcma.h>
6 #include <net/cfg80211.h>
7 #include <net/mac80211.h>
8 #include "main.h"
9 #include "mac80211_if.h"
10
11 void __brcms_info(struct device *dev, const char *fmt, ...);
12 void __brcms_warn(struct device *dev, const char *fmt, ...);
13 void __brcms_err(struct device *dev, const char *fmt, ...);
14 void __brcms_crit(struct device *dev, const char *fmt, ...);
15
16 #if defined(CONFIG_BRCMDBG) || defined(CONFIG_BRCM_TRACING)
17 void __brcms_dbg(struct device *dev, u32 level, const char *func,
18                  const char *fmt, ...);
19 #else
20 static inline void __brcms_dbg(struct device *dev, u32 level,
21                                const char *func, const char *fmt, ...)
22 {
23 }
24 #endif
25
26 /*
27  * Debug macros cannot be used when wlc is uninitialized. Generally
28  * this means any code that could run before brcms_c_attach() has
29  * returned successfully probably shouldn't use the following macros.
30  */
31
32 #define brcms_dbg(core, l, f, a...)     __brcms_dbg(&(core)->dev, l, __func__, f, ##a)
33 #define brcms_info(core, f, a...)       __brcms_info(&(core)->dev, f, ##a)
34 #define brcms_warn(core, f, a...)       __brcms_warn(&(core)->dev, f, ##a)
35 #define brcms_err(core, f, a...)        __brcms_err(&(core)->dev, f, ##a)
36 #define brcms_crit(core, f, a...)       __brcms_crit(&(core)->dev, f, ##a)
37
38 #define brcms_dbg_info(core, f, a...)           brcms_dbg(core, BRCM_DL_INFO, f, ##a)
39 #define brcms_dbg_mac80211(core, f, a...)       brcms_dbg(core, BRCM_DL_MAC80211, f, ##a)
40 #define brcms_dbg_rx(core, f, a...)             brcms_dbg(core, BRCM_DL_RX, f, ##a)
41 #define brcms_dbg_tx(core, f, a...)             brcms_dbg(core, BRCM_DL_TX, f, ##a)
42 #define brcms_dbg_int(core, f, a...)            brcms_dbg(core, BRCM_DL_INT, f, ##a)
43
44 #endif /* _BRCMS_DEBUG_H_ */