xref: /dflybsd-src/sys/dev/netif/iwn/if_iwn_debug.h (revision 0bc3fe02124c17c464afce63ac908b306c531dcf)
1da10ea93SMatthew Dillon /*-
2da10ea93SMatthew Dillon  * Copyright (c) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
3da10ea93SMatthew Dillon  * Copyright (c) 2011 Intel Corporation
4da10ea93SMatthew Dillon  * Copyright (c) 2007-2009
5da10ea93SMatthew Dillon  *      Damien Bergamini <damien.bergamini@free.fr>
6da10ea93SMatthew Dillon  * Copyright (c) 2008
7da10ea93SMatthew Dillon  *      Benjamin Close <benjsc@FreeBSD.org>
8da10ea93SMatthew Dillon  * Copyright (c) 2008 Sam Leffler, Errno Consulting
9da10ea93SMatthew Dillon  *
10da10ea93SMatthew Dillon  * Permission to use, copy, modify, and distribute this software for any
11da10ea93SMatthew Dillon  * purpose with or without fee is hereby granted, provided that the above
12da10ea93SMatthew Dillon  * copyright notice and this permission notice appear in all copies.
13da10ea93SMatthew Dillon  *
14da10ea93SMatthew Dillon  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15da10ea93SMatthew Dillon  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16da10ea93SMatthew Dillon  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17da10ea93SMatthew Dillon  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18da10ea93SMatthew Dillon  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19da10ea93SMatthew Dillon  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20da10ea93SMatthew Dillon  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21da10ea93SMatthew Dillon  *
2205538f72SMatthew Dillon  * $FreeBSD$
23da10ea93SMatthew Dillon  */
24da10ea93SMatthew Dillon 
25da10ea93SMatthew Dillon #ifndef	__IF_IWN_DEBUG_H__
26da10ea93SMatthew Dillon #define	__IF_IWN_DEBUG_H__
27da10ea93SMatthew Dillon 
28da10ea93SMatthew Dillon #ifdef	IWN_DEBUG
29da10ea93SMatthew Dillon enum {
30da10ea93SMatthew Dillon 	IWN_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
31da10ea93SMatthew Dillon 	IWN_DEBUG_RECV		= 0x00000002,	/* basic recv operation */
32da10ea93SMatthew Dillon 	IWN_DEBUG_STATE		= 0x00000004,	/* 802.11 state transitions */
33da10ea93SMatthew Dillon 	IWN_DEBUG_TXPOW		= 0x00000008,	/* tx power processing */
34da10ea93SMatthew Dillon 	IWN_DEBUG_RESET		= 0x00000010,	/* reset processing */
35da10ea93SMatthew Dillon 	IWN_DEBUG_OPS		= 0x00000020,	/* iwn_ops processing */
36da10ea93SMatthew Dillon 	IWN_DEBUG_BEACON 	= 0x00000040,	/* beacon handling */
37da10ea93SMatthew Dillon 	IWN_DEBUG_WATCHDOG 	= 0x00000080,	/* watchdog timeout */
38da10ea93SMatthew Dillon 	IWN_DEBUG_INTR		= 0x00000100,	/* ISR */
39da10ea93SMatthew Dillon 	IWN_DEBUG_CALIBRATE	= 0x00000200,	/* periodic calibration */
40da10ea93SMatthew Dillon 	IWN_DEBUG_NODE		= 0x00000400,	/* node management */
41da10ea93SMatthew Dillon 	IWN_DEBUG_LED		= 0x00000800,	/* led management */
42da10ea93SMatthew Dillon 	IWN_DEBUG_CMD		= 0x00001000,	/* cmd submission */
43da10ea93SMatthew Dillon 	IWN_DEBUG_TXRATE	= 0x00002000,	/* TX rate debugging */
44da10ea93SMatthew Dillon 	IWN_DEBUG_PWRSAVE	= 0x00004000,	/* Power save operations */
454b420e05SMatthew Dillon 	IWN_DEBUG_SCAN		= 0x00008000,	/* Scan related operations */
46fd49669cSMichael Neumann 	IWN_DEBUG_STATS		= 0x00010000,	/* Statistics updates */
47da10ea93SMatthew Dillon 	IWN_DEBUG_REGISTER	= 0x20000000,	/* print chipset register */
48da10ea93SMatthew Dillon 	IWN_DEBUG_TRACE		= 0x40000000,	/* Print begin and start driver function */
49da10ea93SMatthew Dillon 	IWN_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
50da10ea93SMatthew Dillon 	IWN_DEBUG_ANY		= 0xffffffff
51da10ea93SMatthew Dillon };
52da10ea93SMatthew Dillon 
53da10ea93SMatthew Dillon #define DPRINTF(sc, m, fmt, ...) do {			\
54da10ea93SMatthew Dillon 	if (sc->sc_debug & (m))				\
55*0bc3fe02SSascha Wildner 		kprintf(fmt, __VA_ARGS__);		\
56da10ea93SMatthew Dillon } while (0)
57da10ea93SMatthew Dillon 
58da10ea93SMatthew Dillon static const char *
iwn_intr_str(uint8_t cmd)59da10ea93SMatthew Dillon iwn_intr_str(uint8_t cmd)
60da10ea93SMatthew Dillon {
61da10ea93SMatthew Dillon 	switch (cmd) {
62da10ea93SMatthew Dillon 	/* Notifications */
63da10ea93SMatthew Dillon 	case IWN_UC_READY:		return "UC_READY";
64da10ea93SMatthew Dillon 	case IWN_ADD_NODE_DONE:		return "ADD_NODE_DONE";
65da10ea93SMatthew Dillon 	case IWN_TX_DONE:		return "TX_DONE";
66da10ea93SMatthew Dillon 	case IWN_START_SCAN:		return "START_SCAN";
67da10ea93SMatthew Dillon 	case IWN_STOP_SCAN:		return "STOP_SCAN";
68da10ea93SMatthew Dillon 	case IWN_RX_STATISTICS:		return "RX_STATS";
69da10ea93SMatthew Dillon 	case IWN_BEACON_STATISTICS:	return "BEACON_STATS";
70da10ea93SMatthew Dillon 	case IWN_STATE_CHANGED:		return "STATE_CHANGED";
71da10ea93SMatthew Dillon 	case IWN_BEACON_MISSED:		return "BEACON_MISSED";
72da10ea93SMatthew Dillon 	case IWN_RX_PHY:		return "RX_PHY";
73da10ea93SMatthew Dillon 	case IWN_MPDU_RX_DONE:		return "MPDU_RX_DONE";
74da10ea93SMatthew Dillon 	case IWN_RX_DONE:		return "RX_DONE";
75da10ea93SMatthew Dillon 
76da10ea93SMatthew Dillon 	/* Command Notifications */
77da10ea93SMatthew Dillon 	case IWN_CMD_RXON:		return "IWN_CMD_RXON";
78da10ea93SMatthew Dillon 	case IWN_CMD_RXON_ASSOC:	return "IWN_CMD_RXON_ASSOC";
79da10ea93SMatthew Dillon 	case IWN_CMD_EDCA_PARAMS:	return "IWN_CMD_EDCA_PARAMS";
80da10ea93SMatthew Dillon 	case IWN_CMD_TIMING:		return "IWN_CMD_TIMING";
81da10ea93SMatthew Dillon 	case IWN_CMD_LINK_QUALITY:	return "IWN_CMD_LINK_QUALITY";
82da10ea93SMatthew Dillon 	case IWN_CMD_SET_LED:		return "IWN_CMD_SET_LED";
83da10ea93SMatthew Dillon 	case IWN5000_CMD_WIMAX_COEX:	return "IWN5000_CMD_WIMAX_COEX";
84da10ea93SMatthew Dillon 	case IWN5000_CMD_CALIB_CONFIG:	return "IWN5000_CMD_CALIB_CONFIG";
85da10ea93SMatthew Dillon 	case IWN5000_CMD_CALIB_RESULT:	return "IWN5000_CMD_CALIB_RESULT";
86da10ea93SMatthew Dillon 	case IWN5000_CMD_CALIB_COMPLETE: return "IWN5000_CMD_CALIB_COMPLETE";
87da10ea93SMatthew Dillon 	case IWN_CMD_SET_POWER_MODE:	return "IWN_CMD_SET_POWER_MODE";
88da10ea93SMatthew Dillon 	case IWN_CMD_SCAN:		return "IWN_CMD_SCAN";
89da10ea93SMatthew Dillon 	case IWN_CMD_SCAN_RESULTS:	return "IWN_CMD_SCAN_RESULTS";
90da10ea93SMatthew Dillon 	case IWN_CMD_TXPOWER:		return "IWN_CMD_TXPOWER";
91da10ea93SMatthew Dillon 	case IWN_CMD_TXPOWER_DBM:	return "IWN_CMD_TXPOWER_DBM";
92da10ea93SMatthew Dillon 	case IWN5000_CMD_TX_ANT_CONFIG:	return "IWN5000_CMD_TX_ANT_CONFIG";
93da10ea93SMatthew Dillon 	case IWN_CMD_BT_COEX:		return "IWN_CMD_BT_COEX";
94da10ea93SMatthew Dillon 	case IWN_CMD_SET_CRITICAL_TEMP:	return "IWN_CMD_SET_CRITICAL_TEMP";
95da10ea93SMatthew Dillon 	case IWN_CMD_SET_SENSITIVITY:	return "IWN_CMD_SET_SENSITIVITY";
96da10ea93SMatthew Dillon 	case IWN_CMD_PHY_CALIB:		return "IWN_CMD_PHY_CALIB";
97da10ea93SMatthew Dillon 
98da10ea93SMatthew Dillon 	/* Bluetooth commands */
99da10ea93SMatthew Dillon 	case IWN_CMD_BT_COEX_PRIOTABLE:	return "IWN_CMD_BT_COEX_PRIOTABLE";
100da10ea93SMatthew Dillon 	case IWN_CMD_BT_COEX_PROT:	return "IWN_CMD_BT_COEX_PROT";
101da10ea93SMatthew Dillon 	case IWN_CMD_BT_COEX_NOTIF:	return "IWN_CMD_BT_COEX_NOTIF";
102da10ea93SMatthew Dillon 
103da10ea93SMatthew Dillon 	/* PAN commands */
104da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_PARAMS:	return "IWN_CMD_WIPAN_PARAMS";
105da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_RXON:	return "IWN_CMD_WIPAN_RXON";
106da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_RXON_TIMING:	return "IWN_CMD_WIPAN_RXON_TIMING";
107da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_RXON_ASSOC:	return "IWN_CMD_WIPAN_RXON_ASSOC";
108da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_QOS_PARAM:	return "IWN_CMD_WIPAN_QOS_PARAM";
109da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_WEPKEY:	return "IWN_CMD_WIPAN_WEPKEY";
110da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH:
111da10ea93SMatthew Dillon 		return "IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH";
112da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_NOA_NOTIFICATION:
113da10ea93SMatthew Dillon 		return "IWN_CMD_WIPAN_NOA_NOTIFICATION";
114da10ea93SMatthew Dillon 	case IWN_CMD_WIPAN_DEACTIVATION_COMPLETE:
115da10ea93SMatthew Dillon 		return "IWN_CMD_WIPAN_DEACTIVATION_COMPLETE";
116da10ea93SMatthew Dillon 	}
117da10ea93SMatthew Dillon 	return "UNKNOWN INTR NOTIF/CMD";
118da10ea93SMatthew Dillon }
119da10ea93SMatthew Dillon #else
120da10ea93SMatthew Dillon #define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0)
121da10ea93SMatthew Dillon #endif
122da10ea93SMatthew Dillon 
123da10ea93SMatthew Dillon #endif	/* __IF_IWN_DEBUG_H__ */
124