Staging: brcm80211: remove ARRAYSIZE macro
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / brcm80211 / sys / wl_dbg.h
blobe63b27ebad5e3c942813f763b9b740d46920f948
1 /*
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.
17 #ifndef _wl_dbg_h_
18 #define _wl_dbg_h_
20 /* wl_msg_level is a bit vector with defs in wlioctl.h */
21 extern u32 wl_msg_level;
23 #define WL_PRINT(args) printf args
24 #define WL_NONE(args)
26 #ifdef BCMDBG
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)
33 #define WL_ERROR_ON() (wl_msg_level & WL_ERROR_VAL)
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 */
45 extern u32 wl_ampdu_dbg;
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)
59 #else /* BCMDBG */
61 #define WL_ERROR(args)
62 #define WL_TRACE(args)
63 #define WL_AMPDU(args)
64 #define WL_FFPLD(args)
66 #define WL_ERROR_ON() 0
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
80 #endif /* BCMDBG */
82 #endif /* _wl_dbg_h_ */