xref: /onnv-gate/usr/src/uts/intel/io/dktp/controller/ata/ata_debug.h (revision 1709:39a1331cb1e3)
1*1709Smlf /*
2*1709Smlf  * CDDL HEADER START
3*1709Smlf  *
4*1709Smlf  * The contents of this file are subject to the terms of the
5*1709Smlf  * Common Development and Distribution License (the "License").
6*1709Smlf  * You may not use this file except in compliance with the License.
7*1709Smlf  *
8*1709Smlf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1709Smlf  * or http://www.opensolaris.org/os/licensing.
10*1709Smlf  * See the License for the specific language governing permissions
11*1709Smlf  * and limitations under the License.
12*1709Smlf  *
13*1709Smlf  * When distributing Covered Code, include this CDDL HEADER in each
14*1709Smlf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1709Smlf  * If applicable, add the following below this CDDL HEADER, with the
16*1709Smlf  * fields enclosed by brackets "[]" replaced with your own identifying
17*1709Smlf  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1709Smlf  *
19*1709Smlf  * CDDL HEADER END
20*1709Smlf  */
21*1709Smlf 
22*1709Smlf /*
23*1709Smlf  * Copyright 1997 Sun Microsystems, Inc.  All rights reserved.
24*1709Smlf  * Use is subject to license terms.
25*1709Smlf  */
26*1709Smlf 
27*1709Smlf #ifndef _ATA_DEBUG_H
28*1709Smlf #define	_ATA_DEBUG_H
29*1709Smlf 
30*1709Smlf #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*1709Smlf 
32*1709Smlf #ifdef	__cplusplus
33*1709Smlf extern "C" {
34*1709Smlf #endif
35*1709Smlf 
36*1709Smlf /*
37*1709Smlf  * debugging options
38*1709Smlf  */
39*1709Smlf 
40*1709Smlf /*
41*1709Smlf  * Always print "real" error messages on non-debugging kernels
42*1709Smlf  */
43*1709Smlf 
44*1709Smlf #ifdef	ATA_DEBUG
45*1709Smlf #define	ADBG_ERROR(fmt)		ADBG_FLAG_CHK(ADBG_FLAG_ERROR, fmt)
46*1709Smlf #else
47*1709Smlf #define	ADBG_ERROR(fmt)	ghd_err fmt
48*1709Smlf #endif
49*1709Smlf 
50*1709Smlf /*
51*1709Smlf  * ... everything else is conditional on the ATA_DEBUG preprocessor symbol
52*1709Smlf  */
53*1709Smlf 
54*1709Smlf #define	ADBG_WARN(fmt)		ADBG_FLAG_CHK(ADBG_FLAG_WARN, fmt)
55*1709Smlf #define	ADBG_TRACE(fmt)		ADBG_FLAG_CHK(ADBG_FLAG_TRACE, fmt)
56*1709Smlf #define	ADBG_INIT(fmt)		ADBG_FLAG_CHK(ADBG_FLAG_INIT, fmt)
57*1709Smlf #define	ADBG_TRANSPORT(fmt)	ADBG_FLAG_CHK(ADBG_FLAG_TRANSPORT, fmt)
58*1709Smlf #define	ADBG_DMA(fmt)		ADBG_FLAG_CHK(ADBG_FLAG_DMA, fmt)
59*1709Smlf #define	ADBG_ARQ(fmt)		ADBG_FLAG_CHK(ADBG_FLAG_ARQ, fmt)
60*1709Smlf 
61*1709Smlf 
62*1709Smlf 
63*1709Smlf 
64*1709Smlf extern int ata_debug;
65*1709Smlf 
66*1709Smlf #define	ADBG_FLAG_ERROR		0x0001
67*1709Smlf #define	ADBG_FLAG_WARN		0x0002
68*1709Smlf #define	ADBG_FLAG_TRACE		0x0004
69*1709Smlf #define	ADBG_FLAG_INIT		0x0008
70*1709Smlf #define	ADBG_FLAG_TRANSPORT	0x0010
71*1709Smlf #define	ADBG_FLAG_DMA		0x0020
72*1709Smlf #define	ADBG_FLAG_ARQ		0x0040
73*1709Smlf 
74*1709Smlf 
75*1709Smlf 
76*1709Smlf #ifdef	ATA_DEBUG
77*1709Smlf #define	ADBG_FLAG_CHK(flag, fmt) if (ata_debug & (flag)) GDBG_PRF(fmt)
78*1709Smlf #else
79*1709Smlf #define	ADBG_FLAG_CHK(flag, fmt)
80*1709Smlf #endif
81*1709Smlf 
82*1709Smlf 
83*1709Smlf 
84*1709Smlf #ifdef	__cplusplus
85*1709Smlf }
86*1709Smlf #endif
87*1709Smlf 
88*1709Smlf #endif /* _ATA_DEBUG_H */
89