xref: /freebsd/sys/dev/rtwn/if_rtwn_debug.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 /*	$OpenBSD: if_urtwn.c,v 1.16 2011/02/10 17:26:40 jakemsr Exp $	*/
2 
3 /*-
4  * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
5  * Copyright (c) 2014 Kevin Lo <kevlo@FreeBSD.org>
6  * Copyright (c) 2015-2016 Andriy Voskoboinyk <avos@FreeBSD.org>
7  *
8  * Permission to use, copy, modify, and distribute this software for any
9  * purpose with or without fee is hereby granted, provided that the above
10  * copyright notice and this permission notice appear in all copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 #ifndef IF_RTWN_DEBUG_H
22 #define IF_RTWN_DEBUG_H
23 
24 #include "opt_rtwn.h"
25 
26 #ifdef RTWN_DEBUG
27 enum {
28 	RTWN_DEBUG_XMIT		= 0x00000001,	/* basic xmit operation */
29 	RTWN_DEBUG_XMIT_DESC	= 0x00000002,	/* xmit descriptors */
30 	RTWN_DEBUG_RECV		= 0x00000004,	/* basic recv operation */
31 	RTWN_DEBUG_RECV_DESC	= 0x00000008,	/* recv descriptors */
32 	RTWN_DEBUG_STATE	= 0x00000010,	/* 802.11 state transitions */
33 	RTWN_DEBUG_RA		= 0x00000020,	/* f/w rate adaptation setup */
34 	RTWN_DEBUG_USB		= 0x00000040,	/* usb requests */
35 	RTWN_DEBUG_FIRMWARE	= 0x00000080,	/* firmware(9) loading debug */
36 	RTWN_DEBUG_BEACON	= 0x00000100,	/* beacon handling */
37 	RTWN_DEBUG_INTR		= 0x00000200,	/* ISR */
38 	RTWN_DEBUG_TEMP		= 0x00000400,	/* temperature calibration */
39 	RTWN_DEBUG_ROM		= 0x00000800,	/* various ROM info */
40 	RTWN_DEBUG_KEY		= 0x00001000,	/* crypto keys management */
41 	RTWN_DEBUG_TXPWR	= 0x00002000,	/* dump Tx power values */
42 	RTWN_DEBUG_RSSI		= 0x00004000,	/* dump RSSI lookups */
43 	RTWN_DEBUG_RESET	= 0x00008000,	/* initialization progress */
44 	RTWN_DEBUG_CALIB	= 0x00010000,	/* calibration progress */
45 	RTWN_DEBUG_RADAR	= 0x00020000,	/* radar detection status */
46 	RTWN_DEBUG_ANY		= 0xffffffff
47 };
48 
49 #define RTWN_DPRINTF(_sc, _m, ...) do {			\
50 	if ((_sc)->sc_debug & (_m))				\
51 		device_printf((_sc)->sc_dev, __VA_ARGS__);	\
52 } while(0)
53 
54 #else
55 #define RTWN_DPRINTF(_sc, _m, ...)	do { (void) _sc; } while (0)
56 #endif
57 
58 #endif	/* IF_RTWN_DEBUG_H */
59