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