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 2010 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 #ifndef _IXGBE_DEBUG_H
30 #define _IXGBE_DEBUG_H
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36
37 #ifdef DEBUG
38 #define IXGBE_DEBUG
39 #endif
40
41 #ifdef IXGBE_DEBUG
42
43 #define IXGBE_DEBUGLOG_0(adapter, fmt) \
44 ixgbe_log((adapter), (fmt))
45 #define IXGBE_DEBUGLOG_1(adapter, fmt, d1) \
46 ixgbe_log((adapter), (fmt), (d1))
47 #define IXGBE_DEBUGLOG_2(adapter, fmt, d1, d2) \
48 ixgbe_log((adapter), (fmt), (d1), (d2))
50 ixgbe_log((adapter), (fmt), (d1), (d2), (d3))
51 #define IXGBE_DEBUGLOG_6(adapter, fmt, d1, d2, d3, d4, d5, d6) \
52 ixgbe_log((adapter), (fmt), (d1), (d2), (d3), (d4), (d5), (d6))
53
54 #define IXGBE_DEBUG_STAT_COND(val, cond) if (cond) (val)++;
55 #define IXGBE_DEBUG_STAT(val) (val)++;
56
57 #else
58
59 #define IXGBE_DEBUGLOG_0(adapter, fmt)
60 #define IXGBE_DEBUGLOG_1(adapter, fmt, d1)
61 #define IXGBE_DEBUGLOG_2(adapter, fmt, d1, d2)
62 #define IXGBE_DEBUGLOG_3(adapter, fmt, d1, d2, d3)
63 #define IXGBE_DEBUGLOG_6(adapter, fmt, d1, d2, d3, d4, d5, d6)
64
65 #define IXGBE_DEBUG_STAT_COND(val, cond)
66 #define IXGBE_DEBUG_STAT(val)
67
68 #endif /* IXGBE_DEBUG */
69
70 #define IXGBE_STAT(val) (val)++;
71
72 #ifdef IXGBE_DEBUG
73
74 void ixgbe_pci_dump(void *);
75 void ixgbe_dump_interrupt(void *, char *);
76 void ixgbe_dump_addr(void *, char *, const uint8_t *);
77
78 #endif /* IXGBE_DEBUG */
79
80 #ifdef IXGBE_DEBUG
81
82 #define DEBUGOUT(S) \
83 IXGBE_DEBUGLOG_0(NULL, S)
84 #define DEBUGOUT1(S, A) \
85 IXGBE_DEBUGLOG_1(NULL, S, A)
86 #define DEBUGOUT2(S, A, B) \
87 IXGBE_DEBUGLOG_2(NULL, S, A, B)
88 #define DEBUGOUT3(S, A, B, C) \
89 IXGBE_DEBUGLOG_3(NULL, S, A, B, C)
90 #define DEBUGOUT6(S, A, B, C, D, E, F) \
91 IXGBE_DEBUGLOG_6(NULL, S, A, B, C, D, E, F)
92
93 /*
94 * DEBUGFUNC() is used to print the function call information, however since
95 * Dtrace in Solaris can be used to trace function calls, this function is
96 * not useful in Solaris, and DEBUGFUNC() can spam a large number of
97 * function call system logs (see CR6918426). We sould eliminate
98 * DEBUGFUNC(), but since DEBUGFUNC() is used by the shared code
99 * (maintained by Intel) which is used and shared by ixgbe drivers in
100 * different OSes, we can not remove it, so in Solaris just simply define
101 * it as blank.
102 */
103 #define DEBUGFUNC(F)
104
105 #else
106
107 #define DEBUGOUT(S)
108 #define DEBUGOUT1(S, A)
109 #define DEBUGOUT2(S, A, B)
110 #define DEBUGOUT3(S, A, B, C)
111 #define DEBUGOUT6(S, A, B, C, D, E, F)
112
113 #define DEBUGFUNC(F)
114
115 #endif /* IXGBE_DEBUG */
116
117 extern void ixgbe_log(void *, const char *, ...);
118
119 #ifdef __cplusplus
120 }
121 #endif
122
123 #endif /* _IXGBE_DEBUG_H */
|
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 2010 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 /*
30 * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
31 */
32
33 #ifndef _IXGBE_DEBUG_H
34 #define _IXGBE_DEBUG_H
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40
41 #ifdef DEBUG
42 #define IXGBE_DEBUG
43 #endif
44
45 #ifdef IXGBE_DEBUG
46
47 #define IXGBE_DEBUGLOG_0(adapter, fmt) \
48 ixgbe_log((adapter), (fmt))
49 #define IXGBE_DEBUGLOG_1(adapter, fmt, d1) \
50 ixgbe_log((adapter), (fmt), (d1))
51 #define IXGBE_DEBUGLOG_2(adapter, fmt, d1, d2) \
52 ixgbe_log((adapter), (fmt), (d1), (d2))
54 ixgbe_log((adapter), (fmt), (d1), (d2), (d3))
55 #define IXGBE_DEBUGLOG_6(adapter, fmt, d1, d2, d3, d4, d5, d6) \
56 ixgbe_log((adapter), (fmt), (d1), (d2), (d3), (d4), (d5), (d6))
57
58 #define IXGBE_DEBUG_STAT_COND(val, cond) if (cond) (val)++;
59 #define IXGBE_DEBUG_STAT(val) (val)++;
60
61 #else
62
63 #define IXGBE_DEBUGLOG_0(adapter, fmt)
64 #define IXGBE_DEBUGLOG_1(adapter, fmt, d1)
65 #define IXGBE_DEBUGLOG_2(adapter, fmt, d1, d2)
66 #define IXGBE_DEBUGLOG_3(adapter, fmt, d1, d2, d3)
67 #define IXGBE_DEBUGLOG_6(adapter, fmt, d1, d2, d3, d4, d5, d6)
68
69 #define IXGBE_DEBUG_STAT_COND(val, cond)
70 #define IXGBE_DEBUG_STAT(val)
71
72 #endif /* IXGBE_DEBUG */
73
74 #ifdef IXGBE_DEBUG
75 void ixgbe_pci_dump(void *);
76 void ixgbe_dump_interrupt(void *, char *);
77 void ixgbe_dump_addr(void *, char *, const uint8_t *);
78
79 #define DEBUGOUT(S) \
80 IXGBE_DEBUGLOG_0(NULL, S)
81 #define DEBUGOUT1(S, A) \
82 IXGBE_DEBUGLOG_1(NULL, S, A)
83 #define DEBUGOUT2(S, A, B) \
84 IXGBE_DEBUGLOG_2(NULL, S, A, B)
85 #define DEBUGOUT3(S, A, B, C) \
86 IXGBE_DEBUGLOG_3(NULL, S, A, B, C)
87 #define DEBUGOUT6(S, A, B, C, D, E, F) \
88 IXGBE_DEBUGLOG_6(NULL, S, A, B, C, D, E, F)
89
90 #define IXGBE_ERROR_INVALID_STATE "INVALID STATE"
91 #define IXGBE_ERROR_POLLING "POLLING ERROR"
92 #define IXGBE_ERROR_CAUTION "CAUTION"
93 #define IXGBE_ERROR_SOFTWARE "SOFTWARE ERROR"
94 #define IXGBE_ERROR_ARGUMENT "BAD ARGUMENT"
95 #define IXGBE_ERROR_UNSUPPORTED "UNSUPPORTED"
96
97 #define ERROR_REPORT1(S, A) DEBUGOUT1(S, A)
98 #define ERROR_REPORT2(S, A, B) DEBUGOUT2(S, A, B)
99 #define ERROR_REPORT3(S, A, B, C) DEBUGOUT3(S, A, B, C)
100
101 #else
102
103 #define DEBUGOUT(S)
104 #define DEBUGOUT1(S, A)
105 #define DEBUGOUT2(S, A, B)
106 #define DEBUGOUT3(S, A, B, C)
107 #define DEBUGOUT6(S, A, B, C, D, E, F)
108
109 #define ERROR_REPORT1(S, A)
110 #define ERROR_REPORT2(S, A, B)
111 #define ERROR_REPORT3(S, A, B, C)
112
113 #endif /* IXGBE_DEBUG */
114
115 /*
116 * DEBUGFUNC() is used to print the function call information, however since
117 * DTrace in illumos can be used to trace function calls, this function is
118 * not useful in illumos, and DEBUGFUNC() can spam a large number of
119 * function call system logs (see CR6918426). We sould eliminate
120 * DEBUGFUNC(), but since DEBUGFUNC() is used by the shared code
121 * (maintained by Intel) which is used and shared by ixgbe drivers in
122 * different OSes, we can not remove it, so in illumos just simply define
123 * it as blank.
124 */
125 #define DEBUGFUNC(F)
126
127 #define IXGBE_STAT(val) (val)++;
128
129 extern void ixgbe_log(void *, const char *, ...);
130
131 #ifdef __cplusplus
132 }
133 #endif
134
135 #endif /* _IXGBE_DEBUG_H */
|