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