Merge branch 'for-linus' of git://git.kernel.dk/linux-block
[pandora-kernel.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 _BRCMF_DBG_H_
18 #define _BRCMF_DBG_H_
19
20 #if defined(BCMDBG)
21
22 #define BRCMF_ERROR(args) \
23         do {if ((brcmf_msg_level & BRCMF_ERROR_VAL) && (net_ratelimit())) \
24                 printk args; } while (0)
25 #define BRCMF_TRACE(args)       do {if (brcmf_msg_level & BRCMF_TRACE_VAL) \
26                                         printk args; } while (0)
27 #define BRCMF_INFO(args)        do {if (brcmf_msg_level & BRCMF_INFO_VAL) \
28                                         printk args; } while (0)
29 #define BRCMF_DATA(args)        do {if (brcmf_msg_level & BRCMF_DATA_VAL) \
30                                         printk args; } while (0)
31 #define BRCMF_CTL(args)         do {if (brcmf_msg_level & BRCMF_CTL_VAL) \
32                                         printk args; } while (0)
33 #define BRCMF_TIMER(args)       do {if (brcmf_msg_level & BRCMF_TIMER_VAL) \
34                                         printk args; } while (0)
35 #define BRCMF_INTR(args)        do {if (brcmf_msg_level & BRCMF_INTR_VAL) \
36                                         printk args; } while (0)
37 #define BRCMF_GLOM(args)        do {if (brcmf_msg_level & BRCMF_GLOM_VAL) \
38                                         printk args; } while (0)
39 #define BRCMF_EVENT(args)       do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
40                                         printk args; } while (0)
41
42 #define BRCMF_DATA_ON()         (brcmf_msg_level & BRCMF_DATA_VAL)
43 #define BRCMF_CTL_ON()          (brcmf_msg_level & BRCMF_CTL_VAL)
44 #define BRCMF_HDRS_ON()         (brcmf_msg_level & BRCMF_HDRS_VAL)
45 #define BRCMF_BYTES_ON()        (brcmf_msg_level & BRCMF_BYTES_VAL)
46 #define BRCMF_GLOM_ON()         (brcmf_msg_level & BRCMF_GLOM_VAL)
47
48 #else   /* (defined BCMDBG) || (defined BCMDBG) */
49
50 #define BRCMF_ERROR(args)  do {if (net_ratelimit()) printk args; } while (0)
51 #define BRCMF_TRACE(args)
52 #define BRCMF_INFO(args)
53 #define BRCMF_DATA(args)
54 #define BRCMF_CTL(args)
55 #define BRCMF_TIMER(args)
56 #define BRCMF_INTR(args)
57 #define BRCMF_GLOM(args)
58 #define BRCMF_EVENT(args)
59
60 #define BRCMF_DATA_ON()         0
61 #define BRCMF_CTL_ON()          0
62 #define BRCMF_HDRS_ON()         0
63 #define BRCMF_BYTES_ON()                0
64 #define BRCMF_GLOM_ON()         0
65
66 #endif                          /* defined(BCMDBG) */
67
68 extern int brcmf_msg_level;
69
70 #endif                          /* _BRCMF_DBG_H_ */