Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
[pandora-kernel.git] / drivers / staging / brcm80211 / sys / wl_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 _wl_dbg_h_
18 #define _wl_dbg_h_
19
20 /* wl_msg_level is a bit vector with defs in wlioctl.h */
21 extern u32 wl_msg_level;
22
23 #define WL_PRINT(args)          printf args
24 #define WL_NONE(args)
25
26 #ifdef BCMDBG
27
28 #define WL_ERROR(args)          do {if ((wl_msg_level & WL_ERROR_VAL)) WL_PRINT(args); } while (0)
29 #define WL_TRACE(args)          do {if (wl_msg_level & WL_TRACE_VAL) WL_PRINT(args); } while (0)
30 #define WL_AMPDU(args)          do {if (wl_msg_level & WL_AMPDU_VAL) WL_PRINT(args); } while (0)
31 #define WL_FFPLD(args)          do {if (wl_msg_level & WL_FFPLD_VAL) WL_PRINT(args); } while (0)
32
33 #define WL_ERROR_ON()           (wl_msg_level & WL_ERROR_VAL)
34
35 /* Extra message control for AMPDU debugging */
36 #define   WL_AMPDU_UPDN_VAL     0x00000001      /* Config up/down related  */
37 #define   WL_AMPDU_ERR_VAL      0x00000002      /* Calls to beaocn update  */
38 #define   WL_AMPDU_TX_VAL       0x00000004      /* Transmit data path */
39 #define   WL_AMPDU_RX_VAL       0x00000008      /* Receive data path  */
40 #define   WL_AMPDU_CTL_VAL      0x00000010      /* TSF-related items  */
41 #define   WL_AMPDU_HW_VAL       0x00000020      /* AMPDU_HW */
42 #define   WL_AMPDU_HWTXS_VAL    0x00000040      /* AMPDU_HWTXS */
43 #define   WL_AMPDU_HWDBG_VAL    0x00000080      /* AMPDU_DBG */
44
45 extern u32 wl_ampdu_dbg;
46
47 #define WL_AMPDU_UPDN(args) do {if (wl_ampdu_dbg & WL_AMPDU_UPDN_VAL) {WL_AMPDU(args); } } while (0)
48 #define WL_AMPDU_RX(args) do {if (wl_ampdu_dbg & WL_AMPDU_RX_VAL) {WL_AMPDU(args); } } while (0)
49 #define WL_AMPDU_ERR(args) do {if (wl_ampdu_dbg & WL_AMPDU_ERR_VAL) {WL_AMPDU(args); } } while (0)
50 #define WL_AMPDU_TX(args) do {if (wl_ampdu_dbg & WL_AMPDU_TX_VAL) {WL_AMPDU(args); } } while (0)
51 #define WL_AMPDU_CTL(args) do {if (wl_ampdu_dbg & WL_AMPDU_CTL_VAL) {WL_AMPDU(args); } } while (0)
52 #define WL_AMPDU_HW(args) do {if (wl_ampdu_dbg & WL_AMPDU_HW_VAL) {WL_AMPDU(args); } } while (0)
53 #define WL_AMPDU_HWTXS(args) do {if (wl_ampdu_dbg & WL_AMPDU_HWTXS_VAL) {WL_AMPDU(args); } } while (0)
54 #define WL_AMPDU_HWDBG(args) do {if (wl_ampdu_dbg & WL_AMPDU_HWDBG_VAL) {WL_AMPDU(args); } } while (0)
55 #define WL_AMPDU_ERR_ON() (wl_ampdu_dbg & WL_AMPDU_ERR_VAL)
56 #define WL_AMPDU_HW_ON() (wl_ampdu_dbg & WL_AMPDU_HW_VAL)
57 #define WL_AMPDU_HWTXS_ON() (wl_ampdu_dbg & WL_AMPDU_HWTXS_VAL)
58
59 #else                           /* BCMDBG */
60
61 #define WL_ERROR(args)
62 #define WL_TRACE(args)
63 #define WL_AMPDU(args)
64 #define WL_FFPLD(args)
65
66 #define WL_ERROR_ON()           0
67
68 #define WL_AMPDU_UPDN(args)
69 #define WL_AMPDU_RX(args)
70 #define WL_AMPDU_ERR(args)
71 #define WL_AMPDU_TX(args)
72 #define WL_AMPDU_CTL(args)
73 #define WL_AMPDU_HW(args)
74 #define WL_AMPDU_HWTXS(args)
75 #define WL_AMPDU_HWDBG(args)
76 #define WL_AMPDU_ERR_ON()       0
77 #define WL_AMPDU_HW_ON()        0
78 #define WL_AMPDU_HWTXS_ON()     0
79
80 #endif                          /* BCMDBG */
81
82 #endif                          /* _wl_dbg_h_ */