2 * Copyright (c) 2004-2006 Atheros Communications Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
10 * Software distributed under the License is distributed on an "AS
11 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
12 * implied. See the License for the specific language governing
13 * rights and limitations under the License.
19 #ifndef _DEBUG_LINUX_H_
20 #define _DEBUG_LINUX_H_
22 #define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING)
24 extern A_UINT32 g_dbg_flags;
26 #define DBGFMT "%s() : "
27 #define DBGARG __func__
28 #define DBGFN A_PRINTF
30 /* ------- Debug related stuff ------- */
32 ATH_DEBUG_SEND = 0x0001,
33 ATH_DEBUG_RECV = 0x0002,
34 ATH_DEBUG_SYNC = 0x0004,
35 ATH_DEBUG_DUMP = 0x0008,
36 ATH_DEBUG_IRQ = 0x0010,
37 ATH_DEBUG_TRC = 0x0020,
38 ATH_DEBUG_WARN = 0x0040,
39 ATH_DEBUG_ERR = 0x0080,
41 ATH_DEBUG_BMI = 0x0110,
42 ATH_DEBUG_WMI = 0x0120,
43 ATH_DEBUG_HIF = 0x0140,
44 ATH_DEBUG_HTC = 0x0180,
45 ATH_DEBUG_WLAN = 0x1000,
47 ATH_DEBUG_ANY = 0xFFFF,
52 #define A_DPRINTF(f, a) \
53 if(g_dbg_flags & (f)) \
59 // TODO FIX usage of A_PRINTF!
60 #define AR_DEBUG_LVL_CHECK(lvl) (debughtc & (lvl))
61 #define AR_DEBUG_PRINTBUF(buffer, length, desc) do { \
62 if (debughtc & ATH_DEBUG_DUMP) { \
63 DebugDumpBytes(buffer, length,desc); \
66 #define PRINTX_ARG(arg...) arg
67 #define AR_DEBUG_PRINTF(flags, args) do { \
68 if (debughtc & (flags)) { \
69 A_PRINTF(KERN_ALERT PRINTX_ARG args); \
72 #define AR_DEBUG_ASSERT(test) do { \
74 AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Debug Assert Caught, File %s, Line: %d, Test:%s \n",__FILE__, __LINE__,#test)); \
79 #define AR_DEBUG_PRINTF(flags, args)
80 #define AR_DEBUG_PRINTBUF(buffer, length, desc)
81 #define AR_DEBUG_ASSERT(test)
82 #define AR_DEBUG_LVL_CHECK(lvl) 0
83 #define A_DPRINTF(f, a)
86 #endif /* _DEBUG_LINUX_H_ */