1 /*******************************************************************************
3 * Wireless device driver for Linux (wlags49).
5 * Copyright (c) 1998-2003 Agere Systems Inc.
9 * Initially developed by TriplePoint, Inc.
10 * http://www.triplepoint.com
12 *------------------------------------------------------------------------------
14 * This file contains definitions and macros for debugging.
16 *------------------------------------------------------------------------------
20 * This software is provided subject to the following terms and conditions,
21 * which you should read carefully before using the software. Using this
22 * software indicates your acceptance of these terms and conditions. If you do
23 * not agree with these terms and conditions, do not use the software.
25 * Copyright (c) 2003 Agere Systems Inc.
26 * All rights reserved.
28 * Redistribution and use in source or binary forms, with or without
29 * modifications, are permitted provided that the following conditions are met:
31 * . Redistributions of source code must retain the above copyright notice, this
32 * list of conditions and the following Disclaimer as comments in the code as
33 * well as in the documentation and/or other materials provided with the
36 * . Redistributions in binary form must reproduce the above copyright notice,
37 * this list of conditions and the following Disclaimer in the documentation
38 * and/or other materials provided with the distribution.
40 * . Neither the name of Agere Systems Inc. nor the names of the contributors
41 * may be used to endorse or promote products derived from this software
42 * without specific prior written permission.
46 * THIS SOFTWARE IS PROVIDED
\93AS IS
\94 AND ANY EXPRESS OR IMPLIED WARRANTIES,
47 * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
48 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
49 * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
50 * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
51 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
52 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
53 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
54 * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
55 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
56 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
59 ******************************************************************************/
67 /* Turn on debugging here if not done with a preprocessor define */
79 /****************************************************************************/
81 /* Set the level of debugging if not done with a preprocessor define. See
82 wl_main.c, init_module() for how the debug level translates into the
83 the types of messages displayed */
85 #define DBG_LVL 5 /* yields nothing via init_module,
86 original value of 5 yields
87 DBG_TRACE_ON and DBG_VERBOSE_ON */
91 #define DBG_ERROR_ON 0x00000001L
92 #define DBG_WARNING_ON 0x00000002L
93 #define DBG_NOTICE_ON 0x00000004L
94 #define DBG_TRACE_ON 0x00000008L
95 #define DBG_VERBOSE_ON 0x00000010L
96 #define DBG_PARAM_ON 0x00000020L
97 #define DBG_BREAK_ON 0x00000040L
98 #define DBG_RX_ON 0x00000100L
99 #define DBG_TX_ON 0x00000200L
100 #define DBG_DS_ON 0x00000400L
102 #define DBG_DEFAULTS (DBG_ERROR_ON | DBG_WARNING_ON | DBG_BREAK_ON)
104 #define DBG_FLAGS(A) ((A)->DebugFlag)
105 #define DBG_NAME(A) ((A)->dbgName)
106 #define DBG_LEVEL(A) ((A)->dbgLevel)
110 # define DBG_PRINT(S...) printk(KERN_DEBUG S)
111 #endif /* DBG_PRINT */
115 # define DBG_PRINTC(S...) printk(S)
116 #endif /* DBG_PRINTC */
119 #define DBG_PARAM(A, N, F, S...) {if (DBG_FLAGS(A) & DBG_PARAM_ON) \
120 DBG_PRINT(" %s -- "F"\n", N, S); }
123 #define DBG_ERROR(A, S...) do { \
124 if (DBG_FLAGS(A) & DBG_ERROR_ON) { \
125 DBG_PRINT("%s:ERROR:%s ", DBG_NAME(A), __func__); \
130 #define DBG_WARNING(A, S...) do { \
131 if (DBG_FLAGS(A) & DBG_WARNING_ON) { \
132 DBG_PRINT("%s:WARNING:%s ", DBG_NAME(A), __func__); \
137 #define DBG_NOTICE(A, S...) do { \
138 if (DBG_FLAGS(A) & DBG_NOTICE_ON) { \
139 DBG_PRINT("%s:NOTICE:%s ", DBG_NAME(A), __func__); \
144 #define DBG_TRACE(A, S...) do { \
145 if (DBG_FLAGS(A) & DBG_TRACE_ON) { \
146 DBG_PRINT("%s:%s ", DBG_NAME(A), __func__); \
151 #define DBG_RX(A, S...) {if (DBG_FLAGS(A) & DBG_RX_ON) {\
155 #define DBG_TX(A, S...) {if (DBG_FLAGS(A) & DBG_TX_ON) {\
158 #define DBG_DS(A, S...) {if (DBG_FLAGS(A) & DBG_DS_ON) {\
162 #define DBG_ASSERT(C) do { \
164 DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \
165 #C, __FILE__, __LINE__, __func__); \
171 unsigned long DebugFlag;
174 extern struct dbg_info *DbgInfo;
177 /****************************************************************************/
179 /****************************************************************************/
181 #define DBG_PRINT(S...)
182 #define DBG_PARAM(A, N, F, S...)
183 #define DBG_ERROR(A, S...)
184 #define DBG_WARNING(A, S...)
185 #define DBG_NOTICE(A, S...)
186 #define DBG_TRACE(A, S...)
187 #define DBG_RX(A, S...)
188 #define DBG_TX(A, S...)
189 #define DBG_DS(A, S...)
190 #define DBG_ASSERT(C)
193 /****************************************************************************/
198 #endif /* _DEBUG_H */