staging: brcm80211: replaced WL_TRACE by BCMMSG
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / staging / brcm80211 / brcmsmac / wl_dbg.h
blob6e7f664db0fd82f7d9bddffe9dc80499b5b6e92e
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 #include <linux/device.h> /* dev_err() */
22 /* wl_msg_level is a bit vector with defs in wlioctl.h */
23 extern u32 wl_msg_level;
25 #define WL_PRINT(level, fmt, args...) \
26 do { \
27 if (wl_msg_level & level) \
28 printk(fmt, ##args); \
29 } while (0)
31 #define BCMMSG(dev, fmt, args...) \
32 do { \
33 if (wl_msg_level & WL_TRACE_VAL) \
34 wiphy_err(dev, "%s: " fmt, __func__, ##args); \
35 } while (0)
37 #ifdef BCMDBG
39 #define WL_AMPDU(fmt, args...) WL_PRINT(WL_AMPDU_VAL, fmt, ##args)
40 #define WL_FFPLD(fmt, args...) WL_PRINT(WL_FFPLD_VAL, fmt, ##args)
42 /* Extra message control for AMPDU debugging */
43 #define WL_AMPDU_UPDN_VAL 0x00000001 /* Config up/down related */
44 #define WL_AMPDU_ERR_VAL 0x00000002 /* Calls to beaocn update */
45 #define WL_AMPDU_TX_VAL 0x00000004 /* Transmit data path */
46 #define WL_AMPDU_RX_VAL 0x00000008 /* Receive data path */
47 #define WL_AMPDU_CTL_VAL 0x00000010 /* TSF-related items */
48 #define WL_AMPDU_HW_VAL 0x00000020 /* AMPDU_HW */
49 #define WL_AMPDU_HWTXS_VAL 0x00000040 /* AMPDU_HWTXS */
50 #define WL_AMPDU_HWDBG_VAL 0x00000080 /* AMPDU_DBG */
52 extern u32 wl_ampdu_dbg;
54 #define WL_AMPDU_PRINT(level, fmt, args...) \
55 do { \
56 if (wl_ampdu_dbg & level) { \
57 WL_AMPDU(fmt, ##args); \
58 } \
59 } while (0)
61 #define WL_AMPDU_UPDN(fmt, args...) \
62 WL_AMPDU_PRINT(WL_AMPDU_UPDN_VAL, fmt, ##args)
63 #define WL_AMPDU_RX(fmt, args...) \
64 WL_AMPDU_PRINT(WL_AMPDU_RX_VAL, fmt, ##args)
65 #define WL_AMPDU_ERR(fmt, args...) \
66 WL_AMPDU_PRINT(WL_AMPDU_ERR_VAL, fmt, ##args)
67 #define WL_AMPDU_TX(fmt, args...) \
68 WL_AMPDU_PRINT(WL_AMPDU_TX_VAL, fmt, ##args)
69 #define WL_AMPDU_CTL(fmt, args...) \
70 WL_AMPDU_PRINT(WL_AMPDU_CTL_VAL, fmt, ##args)
71 #define WL_AMPDU_HW(fmt, args...) \
72 WL_AMPDU_PRINT(WL_AMPDU_HW_VAL, fmt, ##args)
73 #define WL_AMPDU_HWTXS(fmt, args...) \
74 WL_AMPDU_PRINT(WL_AMPDU_HWTXS_VAL, fmt, ##args)
75 #define WL_AMPDU_HWDBG(fmt, args...) \
76 WL_AMPDU_PRINT(WL_AMPDU_HWDBG_VAL, fmt, ##args)
77 #define WL_AMPDU_ERR_ON() (wl_ampdu_dbg & WL_AMPDU_ERR_VAL)
78 #define WL_AMPDU_HW_ON() (wl_ampdu_dbg & WL_AMPDU_HW_VAL)
79 #define WL_AMPDU_HWTXS_ON() (wl_ampdu_dbg & WL_AMPDU_HWTXS_VAL)
81 #else /* BCMDBG */
83 #define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
84 #define WL_AMPDU(fmt, args...) no_printk(fmt, ##args)
85 #define WL_FFPLD(fmt, args...) no_printk(fmt, ##args)
87 #define WL_AMPDU_UPDN(fmt, args...) no_printk(fmt, ##args)
88 #define WL_AMPDU_RX(fmt, args...) no_printk(fmt, ##args)
89 #define WL_AMPDU_ERR(fmt, args...) no_printk(fmt, ##args)
90 #define WL_AMPDU_TX(fmt, args...) no_printk(fmt, ##args)
91 #define WL_AMPDU_CTL(fmt, args...) no_printk(fmt, ##args)
92 #define WL_AMPDU_HW(fmt, args...) no_printk(fmt, ##args)
93 #define WL_AMPDU_HWTXS(fmt, args...) no_printk(fmt, ##args)
94 #define WL_AMPDU_HWDBG(fmt, args...) no_printk(fmt, ##args)
95 #define WL_AMPDU_ERR_ON() 0
96 #define WL_AMPDU_HW_ON() 0
97 #define WL_AMPDU_HWTXS_ON() 0
99 #endif /* BCMDBG */
101 #define WL_ERROR_ON() (wl_msg_level & WL_ERROR_VAL)
103 #endif /* _wl_dbg_h_ */