xref: /freebsd/sys/dev/iwm/if_iwm_debug.h (revision 71e8eac4fd89dedbcb4130379add151d3ed942fa)
1 /*-
2  * Copyright (c) 2015 Adrian Chadd <adrian@FreeBSD.org>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  *
16  * $FreeBSD$
17  */
18 
19 #ifndef	__IF_IWM_DEBUG_H__
20 #define	__IF_IWM_DEBUG_H__
21 
22 #ifdef	IWM_DEBUG
23 enum {
24 	IWM_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
25 	IWM_DEBUG_RECV		= 0x00000002,	/* basic recv operation */
26 	IWM_DEBUG_STATE		= 0x00000004,	/* 802.11 state transitions */
27 	IWM_DEBUG_TXPOW		= 0x00000008,	/* tx power processing */
28 	IWM_DEBUG_RESET		= 0x00000010,	/* reset processing */
29 	IWM_DEBUG_OPS		= 0x00000020,	/* iwm_ops processing */
30 	IWM_DEBUG_BEACON 	= 0x00000040,	/* beacon handling */
31 	IWM_DEBUG_WATCHDOG 	= 0x00000080,	/* watchdog timeout */
32 	IWM_DEBUG_INTR		= 0x00000100,	/* ISR */
33 	IWM_DEBUG_CALIBRATE	= 0x00000200,	/* periodic calibration */
34 	IWM_DEBUG_NODE		= 0x00000400,	/* node management */
35 	IWM_DEBUG_LED		= 0x00000800,	/* led management */
36 	IWM_DEBUG_CMD		= 0x00001000,	/* cmd submission */
37 	IWM_DEBUG_TXRATE	= 0x00002000,	/* TX rate debugging */
38 	IWM_DEBUG_PWRSAVE	= 0x00004000,	/* Power save operations */
39 	IWM_DEBUG_SCAN		= 0x00008000,	/* Scan related operations */
40 	IWM_DEBUG_STATS		= 0x00010000,	/* Statistics updates */
41 	IWM_DEBUG_FIRMWARE_TLV	= 0x00020000,	/* Firmware TLV parsing */
42 	IWM_DEBUG_TRANS		= 0x00040000,	/* Transport layer (eg PCIe) */
43 	IWM_DEBUG_EEPROM	= 0x00080000,	/* EEPROM/channel information */
44 	IWM_DEBUG_REGISTER	= 0x20000000,	/* print chipset register */
45 	IWM_DEBUG_TRACE		= 0x40000000,	/* Print begin and start driver function */
46 	IWM_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
47 	IWM_DEBUG_ANY		= 0xffffffff
48 };
49 
50 #define IWM_DPRINTF(sc, m, fmt, ...) do {			\
51 	if (sc->sc_debug & (m))				\
52 		device_printf(sc->sc_dev, fmt, ##__VA_ARGS__);	\
53 } while (0)
54 #else
55 #define IWM_DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
56 #endif
57 
58 #endif	/* __IF_IWM_DEBUG_H__ */
59