xref: /titanic_41/usr/src/uts/common/io/ixgbe/ixgbe_debug.h (revision 24a1f0af9f770e0e795ef1fa1c6dece8dd8dc959)
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	_IXGBE_DEBUG_H
30 #define	_IXGBE_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	IXGBE_DEBUG
41 #endif
42 
43 #ifdef IXGBE_DEBUG
44 
45 #define	IXGBE_DEBUGLOG_0(adapter, fmt)	\
46 	ixgbe_log((adapter), (fmt))
47 #define	IXGBE_DEBUGLOG_1(adapter, fmt, d1)	\
48 	ixgbe_log((adapter), (fmt), (d1))
49 #define	IXGBE_DEBUGLOG_2(adapter, fmt, d1, d2)	\
50 	ixgbe_log((adapter), (fmt), (d1), (d2))
51 #define	IXGBE_DEBUGLOG_3(adapter, fmt, d1, d2, d3)	\
52 	ixgbe_log((adapter), (fmt), (d1), (d2), (d3))
53 #define	IXGBE_DEBUGLOG_6(adapter, fmt, d1, d2, d3, d4, d5, d6)	\
54 	ixgbe_log((adapter), (fmt), (d1), (d2), (d3), (d4), (d5), (d6))
55 
56 #define	IXGBE_DEBUG_STAT_COND(val, cond)	if (cond) (val)++;
57 #define	IXGBE_DEBUG_STAT(val)		(val)++;
58 
59 #else
60 
61 #define	IXGBE_DEBUGLOG_0(adapter, fmt)
62 #define	IXGBE_DEBUGLOG_1(adapter, fmt, d1)
63 #define	IXGBE_DEBUGLOG_2(adapter, fmt, d1, d2)
64 #define	IXGBE_DEBUGLOG_3(adapter, fmt, d1, d2, d3)
65 #define	IXGBE_DEBUGLOG_6(adapter, fmt, d1, d2, d3, d4, d5, d6)
66 
67 #define	IXGBE_DEBUG_STAT_COND(val, cond)
68 #define	IXGBE_DEBUG_STAT(val)
69 
70 #endif	/* IXGBE_DEBUG */
71 
72 #define	IXGBE_STAT(val)		(val)++;
73 
74 #ifdef IXGBE_DEBUG
75 
76 void ixgbe_pci_dump(void *);
77 void ixgbe_dump_interrupt(void *, char *);
78 void ixgbe_dump_addr(void *, char *, const uint8_t *);
79 
80 #endif	/* IXGBE_DEBUG */
81 
82 extern void ixgbe_log(void *, const char *, ...);
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif	/* _IXGBE_DEBUG_H */
89