xref: /freebsd/sys/dev/bwn/if_bwn_debug.h (revision 76f2606181eabc8ab20aa7297bbddc6e78bb549d)
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  * $FreeBSD$
30  */
31 
32 #ifndef	__IF_BWN_DEBUG_H__
33 #define	__IF_BWN_DEBUG_H__
34 
35 enum {
36 	BWN_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
37 	BWN_DEBUG_RECV		= 0x00000002,	/* basic recv operation */
38 	BWN_DEBUG_STATE		= 0x00000004,	/* 802.11 state transitions */
39 	BWN_DEBUG_TXPOW		= 0x00000008,	/* tx power processing */
40 	BWN_DEBUG_RESET		= 0x00000010,	/* reset processing */
41 	BWN_DEBUG_OPS		= 0x00000020,	/* bwn_ops processing */
42 	BWN_DEBUG_BEACON	= 0x00000040,	/* beacon handling */
43 	BWN_DEBUG_WATCHDOG	= 0x00000080,	/* watchdog timeout */
44 	BWN_DEBUG_INTR		= 0x00000100,	/* ISR */
45 	BWN_DEBUG_CALIBRATE	= 0x00000200,	/* periodic calibration */
46 	BWN_DEBUG_NODE		= 0x00000400,	/* node management */
47 	BWN_DEBUG_LED		= 0x00000800,	/* led management */
48 	BWN_DEBUG_CMD		= 0x00001000,	/* cmd submission */
49 	BWN_DEBUG_LO		= 0x00002000,	/* LO */
50 	BWN_DEBUG_FW		= 0x00004000,	/* firmware */
51 	BWN_DEBUG_WME		= 0x00008000,	/* WME */
52 	BWN_DEBUG_RF		= 0x00010000,	/* RF */
53 	BWN_DEBUG_XMIT_POWER	= 0x00020000,
54 	BWN_DEBUG_PHY		= 0x00040000,
55 	BWN_DEBUG_EEPROM	= 0x00080000,
56 	BWN_DEBUG_HWCRYPTO	= 0x00100000,	/* HW crypto */
57 	BWN_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
58 	BWN_DEBUG_ANY		= 0xffffffff
59 };
60 
61 #ifdef	BWN_DEBUG
62 #define DPRINTF(sc, m, fmt, ...) do {			\
63 	if (sc->sc_debug & (m))				\
64 		printf(fmt, __VA_ARGS__);		\
65 } while (0)
66 #else	/* BWN_DEBUG */
67 #define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
68 #endif	/* BWN_DEBUG */
69 
70 #define	BWN_ERRPRINTF(sc, ...) do {		\
71 		printf(__VA_ARGS__);		\
72 } while (0)
73 #define	BWN_DBGPRINTF(sc, ...) do {		\
74 		printf(__VA_ARGS__);		\
75 } while (0)
76 #define	BWN_WARNPRINTF(sc, ...) do {		\
77 		printf(__VA_ARGS__);		\
78 } while (0)
79 
80 #endif	/* __IF_BWN_DEBUG_H__ */
81