Merge commit '06307114472bd8aad5ff18ccdb8e25f128ae6652'
[unleashed.git] / kernel / drivers / net / ixgbe / ixgbe_debug.h
blobbe5f1a00d1f85cb373b6614428b7fa9a4fdf53b8
1 /*
2 * CDDL HEADER START
4 * Copyright(c) 2007-2010 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.
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.
14 * When using or redistributing this file, you may do so under the
15 * License only. No other modification of this header is permitted.
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]
21 * CDDL HEADER END
25 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
30 * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
31 * Copyright 2017 Joyent, Inc.
34 #ifndef _IXGBE_DEBUG_H
35 #define _IXGBE_DEBUG_H
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
42 #ifdef DEBUG
43 #define IXGBE_DEBUG
44 #endif
46 #ifdef IXGBE_DEBUG
48 #define IXGBE_DEBUGLOG_0(adapter, fmt) \
49 ixgbe_log((adapter), (fmt))
50 #define IXGBE_DEBUGLOG_1(adapter, fmt, d1) \
51 ixgbe_log((adapter), (fmt), (d1))
52 #define IXGBE_DEBUGLOG_2(adapter, fmt, d1, d2) \
53 ixgbe_log((adapter), (fmt), (d1), (d2))
54 #define IXGBE_DEBUGLOG_3(adapter, fmt, d1, d2, d3) \
55 ixgbe_log((adapter), (fmt), (d1), (d2), (d3))
56 #define IXGBE_DEBUGLOG_6(adapter, fmt, d1, d2, d3, d4, d5, d6) \
57 ixgbe_log((adapter), (fmt), (d1), (d2), (d3), (d4), (d5), (d6))
59 #else
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)
67 #endif /* IXGBE_DEBUG */
69 #ifdef IXGBE_DEBUG
70 void ixgbe_pci_dump(void *);
71 void ixgbe_dump_interrupt(void *, char *);
72 void ixgbe_dump_addr(void *, char *, const uint8_t *);
74 #define DEBUGOUT(S) \
75 IXGBE_DEBUGLOG_0(NULL, S)
76 #define DEBUGOUT1(S, A) \
77 IXGBE_DEBUGLOG_1(NULL, S, A)
78 #define DEBUGOUT2(S, A, B) \
79 IXGBE_DEBUGLOG_2(NULL, S, A, B)
80 #define DEBUGOUT3(S, A, B, C) \
81 IXGBE_DEBUGLOG_3(NULL, S, A, B, C)
82 #define DEBUGOUT6(S, A, B, C, D, E, F) \
83 IXGBE_DEBUGLOG_6(NULL, S, A, B, C, D, E, F)
85 #define IXGBE_ERROR_INVALID_STATE "INVALID STATE"
86 #define IXGBE_ERROR_POLLING "POLLING ERROR"
87 #define IXGBE_ERROR_CAUTION "CAUTION"
88 #define IXGBE_ERROR_SOFTWARE "SOFTWARE ERROR"
89 #define IXGBE_ERROR_ARGUMENT "BAD ARGUMENT"
90 #define IXGBE_ERROR_UNSUPPORTED "UNSUPPORTED"
92 #define ERROR_REPORT1(S, A) DEBUGOUT(S ":" A)
93 #define ERROR_REPORT2(S, A, B) DEBUGOUT1(S ":" A, B)
94 #define ERROR_REPORT3(S, A, B, C) DEBUGOUT2(S ":" A, B, C)
96 #else
98 #define DEBUGOUT(S)
99 #define DEBUGOUT1(S, A)
100 #define DEBUGOUT2(S, A, B)
101 #define DEBUGOUT3(S, A, B, C)
102 #define DEBUGOUT6(S, A, B, C, D, E, F)
104 #define ERROR_REPORT1(S, A)
105 #define ERROR_REPORT2(S, A, B)
106 #define ERROR_REPORT3(S, A, B, C)
108 #endif /* IXGBE_DEBUG */
111 * DEBUGFUNC() is used to print the function call information, however since
112 * DTrace in illumos can be used to trace function calls, this function is
113 * not useful in illumos, and DEBUGFUNC() can spam a large number of
114 * function call system logs (see CR6918426). We sould eliminate
115 * DEBUGFUNC(), but since DEBUGFUNC() is used by the shared code
116 * (maintained by Intel) which is used and shared by ixgbe drivers in
117 * different OSes, we can not remove it, so in illumos just simply define
118 * it as blank.
120 #define DEBUGFUNC(F)
122 extern void ixgbe_log(void *, const char *, ...);
124 #ifdef __cplusplus
126 #endif
128 #endif /* _IXGBE_DEBUG_H */