xref: /dflybsd-src/sys/dev/netif/iwm/if_iwm_debug.h (revision 4cbc7cf96a5a52309aab9d8db3e0335042767af2)
124a8d46aSMatthew Dillon /*-
224a8d46aSMatthew Dillon  * Copyright (c) 2015 Adrian Chadd <adrian@FreeBSD.org>
324a8d46aSMatthew Dillon  *
424a8d46aSMatthew Dillon  * Permission to use, copy, modify, and distribute this software for any
524a8d46aSMatthew Dillon  * purpose with or without fee is hereby granted, provided that the above
624a8d46aSMatthew Dillon  * copyright notice and this permission notice appear in all copies.
724a8d46aSMatthew Dillon  *
824a8d46aSMatthew Dillon  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
924a8d46aSMatthew Dillon  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1024a8d46aSMatthew Dillon  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1124a8d46aSMatthew Dillon  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1224a8d46aSMatthew Dillon  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1324a8d46aSMatthew Dillon  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1424a8d46aSMatthew Dillon  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1524a8d46aSMatthew Dillon  */
1624a8d46aSMatthew Dillon 
1724a8d46aSMatthew Dillon #ifndef	__IF_IWM_DEBUG_H__
1824a8d46aSMatthew Dillon #define	__IF_IWM_DEBUG_H__
1924a8d46aSMatthew Dillon 
20*694732a3SSascha Wildner #include "opt_iwm.h"
21*694732a3SSascha Wildner 
2224a8d46aSMatthew Dillon #ifdef	IWM_DEBUG
2324a8d46aSMatthew Dillon enum {
2424a8d46aSMatthew Dillon 	IWM_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
2524a8d46aSMatthew Dillon 	IWM_DEBUG_RECV		= 0x00000002,	/* basic recv operation */
2624a8d46aSMatthew Dillon 	IWM_DEBUG_STATE		= 0x00000004,	/* 802.11 state transitions */
2724a8d46aSMatthew Dillon 	IWM_DEBUG_TXPOW		= 0x00000008,	/* tx power processing */
2824a8d46aSMatthew Dillon 	IWM_DEBUG_RESET		= 0x00000010,	/* reset processing */
2924a8d46aSMatthew Dillon 	IWM_DEBUG_OPS		= 0x00000020,	/* iwm_ops processing */
3024a8d46aSMatthew Dillon 	IWM_DEBUG_BEACON 	= 0x00000040,	/* beacon handling */
3124a8d46aSMatthew Dillon 	IWM_DEBUG_WATCHDOG 	= 0x00000080,	/* watchdog timeout */
3224a8d46aSMatthew Dillon 	IWM_DEBUG_INTR		= 0x00000100,	/* ISR */
3324a8d46aSMatthew Dillon 	IWM_DEBUG_CALIBRATE	= 0x00000200,	/* periodic calibration */
3424a8d46aSMatthew Dillon 	IWM_DEBUG_NODE		= 0x00000400,	/* node management */
3524a8d46aSMatthew Dillon 	IWM_DEBUG_LED		= 0x00000800,	/* led management */
3624a8d46aSMatthew Dillon 	IWM_DEBUG_CMD		= 0x00001000,	/* cmd submission */
3724a8d46aSMatthew Dillon 	IWM_DEBUG_TXRATE	= 0x00002000,	/* TX rate debugging */
3824a8d46aSMatthew Dillon 	IWM_DEBUG_PWRSAVE	= 0x00004000,	/* Power save operations */
3924a8d46aSMatthew Dillon 	IWM_DEBUG_SCAN		= 0x00008000,	/* Scan related operations */
4024a8d46aSMatthew Dillon 	IWM_DEBUG_STATS		= 0x00010000,	/* Statistics updates */
4124a8d46aSMatthew Dillon 	IWM_DEBUG_FIRMWARE_TLV	= 0x00020000,	/* Firmware TLV parsing */
4224a8d46aSMatthew Dillon 	IWM_DEBUG_TRANS		= 0x00040000,	/* Transport layer (eg PCIe) */
4324a8d46aSMatthew Dillon 	IWM_DEBUG_EEPROM	= 0x00080000,	/* EEPROM/channel information */
44efb7d4ebSImre Vadász 	IWM_DEBUG_TEMP		= 0x00100000,	/* Thermal Sensor handling */
458a5b1999SImre Vadász 	IWM_DEBUG_FW		= 0x00200000,	/* Firmware management */
460593e39cSImre Vadász 	IWM_DEBUG_LAR		= 0x00400000,	/* Location Aware Regulatory */
47706a3044SImre Vadász 	IWM_DEBUG_TE		= 0x00800000,	/* Time Event handling */
4824a8d46aSMatthew Dillon 	IWM_DEBUG_REGISTER	= 0x20000000,	/* print chipset register */
4924a8d46aSMatthew Dillon 	IWM_DEBUG_TRACE		= 0x40000000,	/* Print begin and start driver function */
5024a8d46aSMatthew Dillon 	IWM_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
5124a8d46aSMatthew Dillon 	IWM_DEBUG_ANY		= 0xffffffff
5224a8d46aSMatthew Dillon };
5324a8d46aSMatthew Dillon 
5424a8d46aSMatthew Dillon #define IWM_DPRINTF(sc, m, fmt, ...) do {			\
5524a8d46aSMatthew Dillon 	if (sc->sc_debug & (m))				\
5624a8d46aSMatthew Dillon 		device_printf(sc->sc_dev, fmt, ##__VA_ARGS__);	\
5724a8d46aSMatthew Dillon } while (0)
5824a8d46aSMatthew Dillon #else
5924a8d46aSMatthew Dillon #define IWM_DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
6024a8d46aSMatthew Dillon #endif
6124a8d46aSMatthew Dillon 
6224a8d46aSMatthew Dillon #endif	/* __IF_IWM_DEBUG_H__ */
63