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