1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef _BRCMS_DEBUG_H_
18#define _BRCMS_DEBUG_H_
19
20#include <linux/device.h>
21#include <linux/bcma/bcma.h>
22#include <net/cfg80211.h>
23#include <net/mac80211.h>
24#include "main.h"
25#include "mac80211_if.h"
26
27__printf(2, 3)
28void __brcms_info(struct device *dev, const char *fmt, ...);
29__printf(2, 3)
30void __brcms_warn(struct device *dev, const char *fmt, ...);
31__printf(2, 3)
32void __brcms_err(struct device *dev, const char *fmt, ...);
33__printf(2, 3)
34void __brcms_crit(struct device *dev, const char *fmt, ...);
35
36#if defined(CONFIG_BRCMDBG) || defined(CONFIG_BRCM_TRACING)
37__printf(4, 5)
38void __brcms_dbg(struct device *dev, u32 level, const char *func,
39 const char *fmt, ...);
40#else
41static inline __printf(4, 5)
42void __brcms_dbg(struct device *dev, u32 level, const char *func,
43 const char *fmt, ...)
44{
45}
46#endif
47
48
49
50
51
52
53
54#define brcms_dbg(core, l, f, a...) __brcms_dbg(&(core)->dev, l, __func__, f, ##a)
55#define brcms_info(core, f, a...) __brcms_info(&(core)->dev, f, ##a)
56#define brcms_warn(core, f, a...) __brcms_warn(&(core)->dev, f, ##a)
57#define brcms_err(core, f, a...) __brcms_err(&(core)->dev, f, ##a)
58#define brcms_crit(core, f, a...) __brcms_crit(&(core)->dev, f, ##a)
59
60#define brcms_dbg_info(core, f, a...) brcms_dbg(core, BRCM_DL_INFO, f, ##a)
61#define brcms_dbg_mac80211(core, f, a...) brcms_dbg(core, BRCM_DL_MAC80211, f, ##a)
62#define brcms_dbg_rx(core, f, a...) brcms_dbg(core, BRCM_DL_RX, f, ##a)
63#define brcms_dbg_tx(core, f, a...) brcms_dbg(core, BRCM_DL_TX, f, ##a)
64#define brcms_dbg_int(core, f, a...) brcms_dbg(core, BRCM_DL_INT, f, ##a)
65#define brcms_dbg_dma(core, f, a...) brcms_dbg(core, BRCM_DL_DMA, f, ##a)
66#define brcms_dbg_ht(core, f, a...) brcms_dbg(core, BRCM_DL_HT, f, ##a)
67
68struct brcms_pub;
69void brcms_debugfs_init(void);
70void brcms_debugfs_exit(void);
71int brcms_debugfs_attach(struct brcms_pub *drvr);
72void brcms_debugfs_detach(struct brcms_pub *drvr);
73struct dentry *brcms_debugfs_get_devdir(struct brcms_pub *drvr);
74void brcms_debugfs_create_files(struct brcms_pub *drvr);
75
76#endif
77