xref: /titanic_51/usr/src/uts/common/io/igb/igb_debug.h (revision c869993e79c1eafbec61a56bf6cea848fe754c71)
1 /*
2  * CDDL HEADER START
3  *
4  * Copyright(c) 2007-2008 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 2008 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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
39 #ifdef DEBUG
40 #define	IGB_DEBUG
41 #endif
42 
43 #ifdef IGB_DEBUG
44 
45 #define	IGB_DEBUGLOG_0(adapter, fmt)	\
46 	igb_log((adapter), (fmt))
47 #define	IGB_DEBUGLOG_1(adapter, fmt, d1)	\
48 	igb_log((adapter), (fmt), (d1))
49 #define	IGB_DEBUGLOG_2(adapter, fmt, d1, d2)	\
50 	igb_log((adapter), (fmt), (d1), (d2))
51 #define	IGB_DEBUGLOG_3(adapter, fmt, d1, d2, d3)	\
52 	igb_log((adapter), (fmt), (d1), (d2), (d3))
53 
54 #define	IGB_DEBUG_STAT_COND(val, cond)	if (cond) (val)++;
55 #define	IGB_DEBUG_STAT(val)		(val)++;
56 
57 #else
58 
59 #define	IGB_DEBUGLOG_0(adapter, fmt)
60 #define	IGB_DEBUGLOG_1(adapter, fmt, d1)
61 #define	IGB_DEBUGLOG_2(adapter, fmt, d1, d2)
62 #define	IGB_DEBUGLOG_3(adapter, fmt, d1, d2, d3)
63 
64 #define	IGB_DEBUG_STAT_COND(val, cond)
65 #define	IGB_DEBUG_STAT(val)
66 
67 #endif	/* IGB_DEBUG */
68 
69 #define	IGB_STAT(val)		(val)++;
70 
71 #ifdef IGB_DEBUG
72 
73 void pci_dump(void *);
74 
75 #endif	/* IGB_DEBUG */
76 
77 extern void igb_log(void *, const char *, ...);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif	/* _IGB_DEBUG_H */
84