1c869993eSxy150489 /* 2c869993eSxy150489 * CDDL HEADER START 3c869993eSxy150489 * 4b8d0a377Schenlu 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 /* 25b8d0a377Schenlu 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 41*e5513923SYuri Pankov typedef enum { 42*e5513923SYuri Pankov IGB_LOG_NONE = 0, 43*e5513923SYuri Pankov IGB_LOG_ERROR = 1, 44*e5513923SYuri Pankov IGB_LOG_INFO = 2, 45*e5513923SYuri Pankov IGB_LOG_TRACE = 4 46*e5513923SYuri Pankov } igb_debug_t; 47c869993eSxy150489 48c869993eSxy150489 #define IGB_DEBUGLOG_0(adapter, fmt) \ 49*e5513923SYuri Pankov igb_log((adapter), (IGB_LOG_INFO), (fmt)) 50c869993eSxy150489 #define IGB_DEBUGLOG_1(adapter, fmt, d1) \ 51*e5513923SYuri Pankov igb_log((adapter), (IGB_LOG_INFO), (fmt), (d1)) 52c869993eSxy150489 #define IGB_DEBUGLOG_2(adapter, fmt, d1, d2) \ 53*e5513923SYuri Pankov igb_log((adapter), (IGB_LOG_INFO), (fmt), (d1), (d2)) 54c869993eSxy150489 #define IGB_DEBUGLOG_3(adapter, fmt, d1, d2, d3) \ 55*e5513923SYuri Pankov igb_log((adapter), (IGB_LOG_INFO), (fmt), (d1), (d2), (d3)) 56c869993eSxy150489 57*e5513923SYuri Pankov #ifdef IGB_DEBUG 58*e5513923SYuri Pankov #define IGB_DEBUGFUNC(fmt) igb_log((NULL), (IGB_LOG_TRACE), (fmt)) 59b8d0a377Schenlu chen - Sun Microsystems - Beijing China #define IGB_DEBUG_STAT_COND(val, cond) if (cond) (val)++ 60b8d0a377Schenlu chen - Sun Microsystems - Beijing China #define IGB_DEBUG_STAT(val) (val)++ 61c869993eSxy150489 #else 62*e5513923SYuri Pankov #define IGB_DEBUGFUNC(fmt) 63c869993eSxy150489 #define IGB_DEBUG_STAT_COND(val, cond) 64c869993eSxy150489 #define IGB_DEBUG_STAT(val) 65c869993eSxy150489 #endif /* IGB_DEBUG */ 66c869993eSxy150489 67b8d0a377Schenlu chen - Sun Microsystems - Beijing China #define IGB_STAT(val) (val)++ 68c869993eSxy150489 69c869993eSxy150489 #ifdef IGB_DEBUG 70c869993eSxy150489 void pci_dump(void *); 71c869993eSxy150489 #endif /* IGB_DEBUG */ 72c869993eSxy150489 73*e5513923SYuri Pankov void igb_log(void *, igb_debug_t, const char *, ...); 74c869993eSxy150489 75c869993eSxy150489 #ifdef __cplusplus 76c869993eSxy150489 } 77c869993eSxy150489 #endif 78c869993eSxy150489 79c869993eSxy150489 #endif /* _IGB_DEBUG_H */ 80