blob: b9791288ec3722c50dd86f451f916eff02e9099a [file] [log] [blame]
Seth Forshee269de122012-11-15 08:08:02 -06001#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
11void __brcms_info(struct device *dev, const char *fmt, ...);
12void __brcms_warn(struct device *dev, const char *fmt, ...);
13void __brcms_err(struct device *dev, const char *fmt, ...);
14void __brcms_crit(struct device *dev, const char *fmt, ...);
15
16#if defined(CONFIG_BRCMDBG) || defined(CONFIG_BRCM_TRACING)
17void __brcms_dbg(struct device *dev, u32 level, const char *func,
18 const char *fmt, ...);
19#else
20static 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
Seth Forshee913911f2012-11-15 08:08:04 -060038#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)
Seth Forshee5ce58bb2012-11-15 08:08:05 -060040#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)
Seth Forshee269de122012-11-15 08:08:02 -060042
43#endif /* _BRCMS_DEBUG_H_ */