xref: /dragonfly/sys/dev/netif/iwm/if_iwm_debug.h (revision 593159d8)
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 #include "opt_iwm.h"
23 
24 #ifdef	IWM_DEBUG
25 enum {
26 	IWM_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
27 	IWM_DEBUG_RECV		= 0x00000002,	/* basic recv operation */
28 	IWM_DEBUG_STATE		= 0x00000004,	/* 802.11 state transitions */
29 	IWM_DEBUG_TXPOW		= 0x00000008,	/* tx power processing */
30 	IWM_DEBUG_RESET		= 0x00000010,	/* reset processing */
31 	IWM_DEBUG_OPS		= 0x00000020,	/* iwm_ops processing */
32 	IWM_DEBUG_BEACON 	= 0x00000040,	/* beacon handling */
33 	IWM_DEBUG_WATCHDOG 	= 0x00000080,	/* watchdog timeout */
34 	IWM_DEBUG_INTR		= 0x00000100,	/* ISR */
35 	IWM_DEBUG_CALIBRATE	= 0x00000200,	/* periodic calibration */
36 	IWM_DEBUG_NODE		= 0x00000400,	/* node management */
37 	IWM_DEBUG_LED		= 0x00000800,	/* led management */
38 	IWM_DEBUG_CMD		= 0x00001000,	/* cmd submission */
39 	IWM_DEBUG_TXRATE	= 0x00002000,	/* TX rate debugging */
40 	IWM_DEBUG_PWRSAVE	= 0x00004000,	/* Power save operations */
41 	IWM_DEBUG_SCAN		= 0x00008000,	/* Scan related operations */
42 	IWM_DEBUG_STATS		= 0x00010000,	/* Statistics updates */
43 	IWM_DEBUG_FIRMWARE_TLV	= 0x00020000,	/* Firmware TLV parsing */
44 	IWM_DEBUG_TRANS		= 0x00040000,	/* Transport layer (eg PCIe) */
45 	IWM_DEBUG_EEPROM	= 0x00080000,	/* EEPROM/channel information */
46 	IWM_DEBUG_TEMP		= 0x00100000,	/* Thermal Sensor handling */
47 	IWM_DEBUG_FW		= 0x00200000,	/* Firmware management */
48 	IWM_DEBUG_LAR		= 0x00400000,	/* Location Aware Regulatory */
49 	IWM_DEBUG_TE		= 0x00800000,	/* Time Event handling */
50 	IWM_DEBUG_REGISTER	= 0x20000000,	/* print chipset register */
51 	IWM_DEBUG_TRACE		= 0x40000000,	/* Print begin and start driver function */
52 	IWM_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
53 	IWM_DEBUG_ANY		= 0xffffffff
54 };
55 
56 #define IWM_DPRINTF(sc, m, fmt, ...) do {			\
57 	if (sc->sc_debug & (m))				\
58 		device_printf(sc->sc_dev, fmt, ##__VA_ARGS__);	\
59 } while (0)
60 #else
61 #define IWM_DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
62 #endif
63 
64 #endif	/* __IF_IWM_DEBUG_H__ */
65