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.
20 #if defined(DHD_DEBUG)
22 #define DHD_ERROR(args) \
23 do {if ((brcmf_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
24 printk args; } while (0)
25 #define DHD_TRACE(args) do {if (brcmf_msg_level & DHD_TRACE_VAL) \
26 printk args; } while (0)
27 #define DHD_INFO(args) do {if (brcmf_msg_level & DHD_INFO_VAL) \
28 printk args; } while (0)
29 #define DHD_DATA(args) do {if (brcmf_msg_level & DHD_DATA_VAL) \
30 printk args; } while (0)
31 #define DHD_CTL(args) do {if (brcmf_msg_level & DHD_CTL_VAL) \
32 printk args; } while (0)
33 #define DHD_TIMER(args) do {if (brcmf_msg_level & DHD_TIMER_VAL) \
34 printk args; } while (0)
35 #define DHD_HDRS(args) do {if (brcmf_msg_level & DHD_HDRS_VAL) \
36 printk args; } while (0)
37 #define DHD_BYTES(args) do {if (brcmf_msg_level & DHD_BYTES_VAL) \
38 printk args; } while (0)
39 #define DHD_INTR(args) do {if (brcmf_msg_level & DHD_INTR_VAL) \
40 printk args; } while (0)
41 #define DHD_GLOM(args) do {if (brcmf_msg_level & DHD_GLOM_VAL) \
42 printk args; } while (0)
43 #define DHD_EVENT(args) do {if (brcmf_msg_level & DHD_EVENT_VAL) \
44 printk args; } while (0)
45 #define DHD_BTA(args) do {if (brcmf_msg_level & DHD_BTA_VAL) \
46 printk args; } while (0)
47 #define DHD_ISCAN(args) do {if (brcmf_msg_level & DHD_ISCAN_VAL) \
48 printk args; } while (0)
50 #define DHD_ERROR_ON() (brcmf_msg_level & DHD_ERROR_VAL)
51 #define DHD_TRACE_ON() (brcmf_msg_level & DHD_TRACE_VAL)
52 #define DHD_INFO_ON() (brcmf_msg_level & DHD_INFO_VAL)
53 #define DHD_DATA_ON() (brcmf_msg_level & DHD_DATA_VAL)
54 #define DHD_CTL_ON() (brcmf_msg_level & DHD_CTL_VAL)
55 #define DHD_TIMER_ON() (brcmf_msg_level & DHD_TIMER_VAL)
56 #define DHD_HDRS_ON() (brcmf_msg_level & DHD_HDRS_VAL)
57 #define DHD_BYTES_ON() (brcmf_msg_level & DHD_BYTES_VAL)
58 #define DHD_INTR_ON() (brcmf_msg_level & DHD_INTR_VAL)
59 #define DHD_GLOM_ON() (brcmf_msg_level & DHD_GLOM_VAL)
60 #define DHD_EVENT_ON() (brcmf_msg_level & DHD_EVENT_VAL)
61 #define DHD_BTA_ON() (brcmf_msg_level & DHD_BTA_VAL)
62 #define DHD_ISCAN_ON() (brcmf_msg_level & DHD_ISCAN_VAL)
64 #else /* (defined BCMDBG) || (defined DHD_DEBUG) */
66 #define DHD_ERROR(args) do {if (net_ratelimit()) printk args; } while (0)
67 #define DHD_TRACE(args)
68 #define DHD_INFO(args)
69 #define DHD_DATA(args)
71 #define DHD_TIMER(args)
72 #define DHD_HDRS(args)
73 #define DHD_BYTES(args)
74 #define DHD_INTR(args)
75 #define DHD_GLOM(args)
76 #define DHD_EVENT(args)
78 #define DHD_ISCAN(args)
80 #define DHD_ERROR_ON() 0
81 #define DHD_TRACE_ON() 0
82 #define DHD_INFO_ON() 0
83 #define DHD_DATA_ON() 0
84 #define DHD_CTL_ON() 0
85 #define DHD_TIMER_ON() 0
86 #define DHD_HDRS_ON() 0
87 #define DHD_BYTES_ON() 0
88 #define DHD_INTR_ON() 0
89 #define DHD_GLOM_ON() 0
90 #define DHD_EVENT_ON() 0
91 #define DHD_BTA_ON() 0
92 #define DHD_ISCAN_ON() 0
93 #endif /* defined(DHD_DEBUG) */
97 #define DHD_NONE(args)
98 extern int brcmf_msg_level;
100 #endif /* _dhd_dbg_ */