xref: /titanic_51/usr/src/uts/common/io/igb/igb_debug.h (revision b3697b90e692e3e5d859fb77d285d4c056d99eda)
1 /*
2  * CDDL HEADER START
3  *
4  * Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
5  * The contents of this file are subject to the terms of the
6  * Common Development and Distribution License (the "License").
7  * You may not use this file except in compliance with the License.
8  *
9  * You can obtain a copy of the license at:
10  *	http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When using or redistributing this file, you may do so under the
15  * License only. No other modification of this header is permitted.
16  *
17  * If applicable, add the following below this CDDL HEADER, with the
18  * fields enclosed by brackets "[]" replaced with your own identifying
19  * information: Portions Copyright [yyyy] [name of copyright owner]
20  *
21  * CDDL HEADER END
22  */
23 
24 /*
25  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms of the CDDL.
27  */
28 
29 #ifndef	_IGB_DEBUG_H
30 #define	_IGB_DEBUG_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 
37 #ifdef DEBUG
38 #define	IGB_DEBUG
39 #endif
40 
41 #ifdef IGB_DEBUG
42 
43 #define	IGB_DEBUGLOG_0(adapter, fmt)	\
44 	igb_log((adapter), (fmt))
45 #define	IGB_DEBUGLOG_1(adapter, fmt, d1)	\
46 	igb_log((adapter), (fmt), (d1))
47 #define	IGB_DEBUGLOG_2(adapter, fmt, d1, d2)	\
48 	igb_log((adapter), (fmt), (d1), (d2))
49 #define	IGB_DEBUGLOG_3(adapter, fmt, d1, d2, d3)	\
50 	igb_log((adapter), (fmt), (d1), (d2), (d3))
51 
52 #define	IGB_DEBUG_STAT_COND(val, cond)	if (cond) (val)++
53 #define	IGB_DEBUG_STAT(val)		(val)++
54 
55 #else
56 
57 #define	IGB_DEBUGLOG_0(adapter, fmt)
58 #define	IGB_DEBUGLOG_1(adapter, fmt, d1)
59 #define	IGB_DEBUGLOG_2(adapter, fmt, d1, d2)
60 #define	IGB_DEBUGLOG_3(adapter, fmt, d1, d2, d3)
61 
62 #define	IGB_DEBUG_STAT_COND(val, cond)
63 #define	IGB_DEBUG_STAT(val)
64 
65 #endif	/* IGB_DEBUG */
66 
67 #define	IGB_STAT(val)		(val)++
68 
69 #ifdef IGB_DEBUG
70 
71 void pci_dump(void *);
72 
73 #endif	/* IGB_DEBUG */
74 
75 extern void igb_log(void *, const char *, ...);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif	/* _IGB_DEBUG_H */
82