2
* Copyright (c) 2010 Broadcom Corporation
4
* Permission to use, copy, modify, and/or distribute this software for any
5
* purpose with or without fee is hereby granted, provided that the above
6
* copyright notice and this permission notice appear in all copies.
8
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
#define brcmf_dbg(level, fmt, ...) \
24
if (BRCMF_ERROR_VAL == BRCMF_##level##_VAL) { \
25
if (brcmf_msg_level & BRCMF_##level##_VAL) { \
26
if (net_ratelimit()) \
27
printk(KERN_DEBUG "%s: " fmt, \
28
__func__, ##__VA_ARGS__); \
31
if (brcmf_msg_level & BRCMF_##level##_VAL) { \
32
printk(KERN_DEBUG "%s: " fmt, \
33
__func__, ##__VA_ARGS__); \
38
#define BRCMF_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
39
#define BRCMF_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
40
#define BRCMF_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
41
#define BRCMF_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
42
#define BRCMF_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)
44
#else /* (defined BCMDBG) || (defined BCMDBG) */
46
#define brcmf_dbg(level, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
48
#define BRCMF_DATA_ON() 0
49
#define BRCMF_CTL_ON() 0
50
#define BRCMF_HDRS_ON() 0
51
#define BRCMF_BYTES_ON() 0
52
#define BRCMF_GLOM_ON() 0
54
#endif /* defined(BCMDBG) */
56
extern int brcmf_msg_level;
58
#endif /* _BRCMF_DBG_H_ */