xref: /dragonfly/sys/dev/netif/bwn/bwn/if_bwn_debug.h (revision 7d3e9a5b)
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, MERCHANTABILITY
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: head/sys/dev/bwn/if_bwn_debug.h 299752 2016-05-14 20:02:02Z adrian $
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_FATAL		= 0x80000000,	/* fatal errors */
57 	BWN_DEBUG_ANY		= 0xffffffff
58 };
59 
60 #ifdef	BWN_DEBUG
61 #define DPRINTF(sc, m, fmt, ...) do {			\
62 	if (sc->sc_debug & (m))				\
63 		kprintf(fmt, __VA_ARGS__);		\
64 } while (0)
65 #else	/* BWN_DEBUG */
66 #define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
67 #endif	/* BWN_DEBUG */
68 
69 #define	BWN_ERRPRINTF(sc, ...) do {		\
70 		kprintf(__VA_ARGS__);		\
71 } while (0)
72 #define	BWN_DBGPRINTF(sc, ...) do {		\
73 		kprintf(__VA_ARGS__);		\
74 } while (0)
75 #define	BWN_WARNPRINTF(sc, ...) do {		\
76 		kprintf(__VA_ARGS__);		\
77 } while (0)
78 
79 #endif	/* __IF_BWN_DEBUG_H__ */
80