xref: /freebsd/sys/dev/bwn/if_bwn_debug.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 /*-
2  * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer,
10  *    without modification.
11  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
13  *    redistribution must be conditioned upon including a substantially
14  *    similar Disclaimer requirement for further binary redistribution.
15  *
16  * NO WARRANTY
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
20  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
21  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
22  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27  * THE POSSIBILITY OF SUCH DAMAGES.
28  */
29 
30 #ifndef	__IF_BWN_DEBUG_H__
31 #define	__IF_BWN_DEBUG_H__
32 
33 enum {
34 	BWN_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
35 	BWN_DEBUG_RECV		= 0x00000002,	/* basic recv operation */
36 	BWN_DEBUG_STATE		= 0x00000004,	/* 802.11 state transitions */
37 	BWN_DEBUG_TXPOW		= 0x00000008,	/* tx power processing */
38 	BWN_DEBUG_RESET		= 0x00000010,	/* reset processing */
39 	BWN_DEBUG_OPS		= 0x00000020,	/* bwn_ops processing */
40 	BWN_DEBUG_BEACON	= 0x00000040,	/* beacon handling */
41 	BWN_DEBUG_WATCHDOG	= 0x00000080,	/* watchdog timeout */
42 	BWN_DEBUG_INTR		= 0x00000100,	/* ISR */
43 	BWN_DEBUG_CALIBRATE	= 0x00000200,	/* periodic calibration */
44 	BWN_DEBUG_NODE		= 0x00000400,	/* node management */
45 	BWN_DEBUG_LED		= 0x00000800,	/* led management */
46 	BWN_DEBUG_CMD		= 0x00001000,	/* cmd submission */
47 	BWN_DEBUG_LO		= 0x00002000,	/* LO */
48 	BWN_DEBUG_FW		= 0x00004000,	/* firmware */
49 	BWN_DEBUG_WME		= 0x00008000,	/* WME */
50 	BWN_DEBUG_RF		= 0x00010000,	/* RF */
51 	BWN_DEBUG_XMIT_POWER	= 0x00020000,
52 	BWN_DEBUG_PHY		= 0x00040000,
53 	BWN_DEBUG_EEPROM	= 0x00080000,
54 	BWN_DEBUG_HWCRYPTO	= 0x00100000,	/* HW crypto */
55 	BWN_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
56 	BWN_DEBUG_ANY		= 0xffffffff
57 };
58 
59 #ifdef	BWN_DEBUG
60 #define DPRINTF(sc, m, fmt, ...) do {			\
61 	if (sc->sc_debug & (m))				\
62 		printf(fmt, __VA_ARGS__);		\
63 } while (0)
64 #else	/* BWN_DEBUG */
65 #define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
66 #endif	/* BWN_DEBUG */
67 
68 #define	BWN_ERRPRINTF(sc, ...) do {		\
69 		printf(__VA_ARGS__);		\
70 } while (0)
71 #define	BWN_DBGPRINTF(sc, ...) do {		\
72 		printf(__VA_ARGS__);		\
73 } while (0)
74 #define	BWN_WARNPRINTF(sc, ...) do {		\
75 		printf(__VA_ARGS__);		\
76 } while (0)
77 
78 #endif	/* __IF_BWN_DEBUG_H__ */
79