4733de79336ad08bdbd06cafed79dbca6fa42ae8
[deliverable/linux.git] / drivers / staging / brcm80211 / brcmfmac / dhd_dbg.h
1 /*
2 * Copyright (c) 2010 Broadcom Corporation
3 *
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.
7 *
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.
15 */
16
17 #ifndef _dhd_dbg_
18 #define _dhd_dbg_
19
20 #if defined(BCMDBG)
21
22 #define DHD_ERROR(args) \
23 do {if ((brcmf_msg_level & BRCMF_ERROR_VAL) && (net_ratelimit())) \
24 printk args; } while (0)
25 #define DHD_TRACE(args) do {if (brcmf_msg_level & BRCMF_TRACE_VAL) \
26 printk args; } while (0)
27 #define DHD_INFO(args) do {if (brcmf_msg_level & BRCMF_INFO_VAL) \
28 printk args; } while (0)
29 #define DHD_DATA(args) do {if (brcmf_msg_level & BRCMF_DATA_VAL) \
30 printk args; } while (0)
31 #define DHD_CTL(args) do {if (brcmf_msg_level & BRCMF_CTL_VAL) \
32 printk args; } while (0)
33 #define DHD_TIMER(args) do {if (brcmf_msg_level & BRCMF_TIMER_VAL) \
34 printk args; } while (0)
35 #define DHD_HDRS(args) do {if (brcmf_msg_level & BRCMF_HDRS_VAL) \
36 printk args; } while (0)
37 #define DHD_BYTES(args) do {if (brcmf_msg_level & BRCMF_BYTES_VAL) \
38 printk args; } while (0)
39 #define DHD_INTR(args) do {if (brcmf_msg_level & BRCMF_INTR_VAL) \
40 printk args; } while (0)
41 #define DHD_GLOM(args) do {if (brcmf_msg_level & BRCMF_GLOM_VAL) \
42 printk args; } while (0)
43 #define DHD_EVENT(args) do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
44 printk args; } while (0)
45
46 #define DHD_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
47 #define DHD_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
48 #define DHD_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
49 #define DHD_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
50 #define DHD_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)
51
52 #else /* (defined BCMDBG) || (defined BCMDBG) */
53
54 #define DHD_ERROR(args) do {if (net_ratelimit()) printk args; } while (0)
55 #define DHD_TRACE(args)
56 #define DHD_INFO(args)
57 #define DHD_DATA(args)
58 #define DHD_CTL(args)
59 #define DHD_TIMER(args)
60 #define DHD_HDRS(args)
61 #define DHD_BYTES(args)
62 #define DHD_INTR(args)
63 #define DHD_GLOM(args)
64 #define DHD_EVENT(args)
65
66 #define DHD_DATA_ON() 0
67 #define DHD_CTL_ON() 0
68 #define DHD_HDRS_ON() 0
69 #define DHD_BYTES_ON() 0
70 #define DHD_GLOM_ON() 0
71
72 #endif /* defined(BCMDBG) */
73
74 extern int brcmf_msg_level;
75
76 #endif /* _dhd_dbg_ */
This page took 0.038945 seconds and 4 git commands to generate.