Merge commit '06307114472bd8aad5ff18ccdb8e25f128ae6652'
[unleashed.git] / kernel / drivers / net / igb / igb_debug.h
blob30b184d597fc3e3700a4606a5aee717088202132
1 /*
2 * CDDL HEADER START
4 * Copyright(c) 2007-2009 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 2009 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms of the CDDL.
29 #ifndef _IGB_DEBUG_H
30 #define _IGB_DEBUG_H
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
37 #ifdef DEBUG
38 #define IGB_DEBUG
39 #endif
41 typedef enum {
42 IGB_LOG_NONE = 0,
43 IGB_LOG_ERROR = 1,
44 IGB_LOG_INFO = 2,
45 IGB_LOG_TRACE = 4
46 } igb_debug_t;
48 #define IGB_DEBUGLOG_0(adapter, fmt) \
49 igb_log((adapter), (IGB_LOG_INFO), (fmt))
50 #define IGB_DEBUGLOG_1(adapter, fmt, d1) \
51 igb_log((adapter), (IGB_LOG_INFO), (fmt), (d1))
52 #define IGB_DEBUGLOG_2(adapter, fmt, d1, d2) \
53 igb_log((adapter), (IGB_LOG_INFO), (fmt), (d1), (d2))
54 #define IGB_DEBUGLOG_3(adapter, fmt, d1, d2, d3) \
55 igb_log((adapter), (IGB_LOG_INFO), (fmt), (d1), (d2), (d3))
57 #ifdef IGB_DEBUG
58 #define IGB_DEBUGFUNC(fmt) igb_log((NULL), (IGB_LOG_TRACE), (fmt))
59 #define IGB_DEBUG_STAT_COND(val, cond) if (cond) (val)++
60 #define IGB_DEBUG_STAT(val) (val)++
61 #else
62 #define IGB_DEBUGFUNC(fmt)
63 #define IGB_DEBUG_STAT_COND(val, cond)
64 #define IGB_DEBUG_STAT(val)
65 #endif /* IGB_DEBUG */
67 #define IGB_STAT(val) (val)++
69 #ifdef IGB_DEBUG
70 void pci_dump(void *);
71 #endif /* IGB_DEBUG */
73 void igb_log(void *, igb_debug_t, const char *, ...);
75 #ifdef __cplusplus
77 #endif
79 #endif /* _IGB_DEBUG_H */