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