xref: /onnv-gate/usr/src/lib/storage/common/l_common.h (revision 7836:4e95154b5b7a)
1*7836SJohn.Forte@Sun.COM /*
2*7836SJohn.Forte@Sun.COM  * CDDL HEADER START
3*7836SJohn.Forte@Sun.COM  *
4*7836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
5*7836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
6*7836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
7*7836SJohn.Forte@Sun.COM  *
8*7836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*7836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
11*7836SJohn.Forte@Sun.COM  * and limitations under the License.
12*7836SJohn.Forte@Sun.COM  *
13*7836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*7836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*7836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*7836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*7836SJohn.Forte@Sun.COM  *
19*7836SJohn.Forte@Sun.COM  * CDDL HEADER END
20*7836SJohn.Forte@Sun.COM  */
21*7836SJohn.Forte@Sun.COM /*
22*7836SJohn.Forte@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*7836SJohn.Forte@Sun.COM  * Use is subject to license terms.
24*7836SJohn.Forte@Sun.COM  */
25*7836SJohn.Forte@Sun.COM 
26*7836SJohn.Forte@Sun.COM /*
27*7836SJohn.Forte@Sun.COM  * Common definitions
28*7836SJohn.Forte@Sun.COM  */
29*7836SJohn.Forte@Sun.COM 
30*7836SJohn.Forte@Sun.COM #ifndef	_L_COMMON_H
31*7836SJohn.Forte@Sun.COM #define	_L_COMMON_H
32*7836SJohn.Forte@Sun.COM 
33*7836SJohn.Forte@Sun.COM 
34*7836SJohn.Forte@Sun.COM 
35*7836SJohn.Forte@Sun.COM /*
36*7836SJohn.Forte@Sun.COM  * Include any headers you depend on.
37*7836SJohn.Forte@Sun.COM  */
38*7836SJohn.Forte@Sun.COM 
39*7836SJohn.Forte@Sun.COM /*
40*7836SJohn.Forte@Sun.COM  * I18N message number ranges
41*7836SJohn.Forte@Sun.COM  *  This file: 14500 - 14999
42*7836SJohn.Forte@Sun.COM  *  Shared common messages: 1 - 1999
43*7836SJohn.Forte@Sun.COM  */
44*7836SJohn.Forte@Sun.COM 
45*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
46*7836SJohn.Forte@Sun.COM extern "C" {
47*7836SJohn.Forte@Sun.COM #endif
48*7836SJohn.Forte@Sun.COM 
49*7836SJohn.Forte@Sun.COM #include	<sys/scsi/targets/sesio.h>
50*7836SJohn.Forte@Sun.COM 
51*7836SJohn.Forte@Sun.COM /*
52*7836SJohn.Forte@Sun.COM  * Debug environmental flags.
53*7836SJohn.Forte@Sun.COM  */
54*7836SJohn.Forte@Sun.COM /* SCSI Commands */
55*7836SJohn.Forte@Sun.COM #define	S_DPRINTF	if (getenv("_LUX_S_DEBUG") != NULL) (void) printf
56*7836SJohn.Forte@Sun.COM 
57*7836SJohn.Forte@Sun.COM /* General purpose */
58*7836SJohn.Forte@Sun.COM #define	P_DPRINTF	if (getenv("_LUX_P_DEBUG") != NULL) (void) printf
59*7836SJohn.Forte@Sun.COM 
60*7836SJohn.Forte@Sun.COM /* Opens */
61*7836SJohn.Forte@Sun.COM #define	O_DPRINTF	if (getenv("_LUX_O_DEBUG") != NULL) (void) printf
62*7836SJohn.Forte@Sun.COM 
63*7836SJohn.Forte@Sun.COM /* Ioctls */
64*7836SJohn.Forte@Sun.COM #define	I_DPRINTF	if (getenv("_LUX_I_DEBUG") != NULL) (void) printf
65*7836SJohn.Forte@Sun.COM 
66*7836SJohn.Forte@Sun.COM /* Hot-Plug */
67*7836SJohn.Forte@Sun.COM #define	H_DPRINTF	if (getenv("_LUX_H_DEBUG") != NULL) (void) printf
68*7836SJohn.Forte@Sun.COM 
69*7836SJohn.Forte@Sun.COM /* Convert Name debug variable. */
70*7836SJohn.Forte@Sun.COM #define	L_DPRINTF	if (getenv("_LUX_L_DEBUG") != NULL) (void) printf
71*7836SJohn.Forte@Sun.COM 
72*7836SJohn.Forte@Sun.COM /* Getting status */
73*7836SJohn.Forte@Sun.COM #define	G_DPRINTF	if (getenv("_LUX_G_DEBUG") != NULL) (void) printf
74*7836SJohn.Forte@Sun.COM 
75*7836SJohn.Forte@Sun.COM /* Box list */
76*7836SJohn.Forte@Sun.COM #define	B_DPRINTF	if (getenv("_LUX_B_DEBUG") != NULL) (void) printf
77*7836SJohn.Forte@Sun.COM 
78*7836SJohn.Forte@Sun.COM /* Non-Photon disks */
79*7836SJohn.Forte@Sun.COM #define	N_DPRINTF	if (getenv("_LUX_N_DEBUG") != NULL) (void) printf
80*7836SJohn.Forte@Sun.COM 
81*7836SJohn.Forte@Sun.COM /* Null WWN FCdisks */
82*7836SJohn.Forte@Sun.COM #define	W_DPRINTF	if (getenv("_LUX_W_DEBUG") != NULL) (void) printf
83*7836SJohn.Forte@Sun.COM 
84*7836SJohn.Forte@Sun.COM /* Devices */
85*7836SJohn.Forte@Sun.COM #define	D_DPRINTF	if (getenv("_LUX_D_DEBUG") != NULL) (void) printf
86*7836SJohn.Forte@Sun.COM 
87*7836SJohn.Forte@Sun.COM /* Enable/Bypass */
88*7836SJohn.Forte@Sun.COM #define	E_DPRINTF	if (getenv("_LUX_E_DEBUG") != NULL) (void) printf
89*7836SJohn.Forte@Sun.COM 
90*7836SJohn.Forte@Sun.COM /* Standard Error messages. */
91*7836SJohn.Forte@Sun.COM #define	ER_DPRINTF	if (getenv("_LUX_ER_DEBUG") != NULL) (void) printf
92*7836SJohn.Forte@Sun.COM 
93*7836SJohn.Forte@Sun.COM /* Retries */
94*7836SJohn.Forte@Sun.COM #define	R_DPRINTF	if (getenv("_LUX_R_DEBUG") != NULL) (void) printf
95*7836SJohn.Forte@Sun.COM 
96*7836SJohn.Forte@Sun.COM /* Threads & Timing */
97*7836SJohn.Forte@Sun.COM #define	T_DPRINTF	if (getenv("_LUX_T_DEBUG") != NULL) (void) printf
98*7836SJohn.Forte@Sun.COM 
99*7836SJohn.Forte@Sun.COM /* Allocation */
100*7836SJohn.Forte@Sun.COM #define	A_DPRINTF	if (getenv("_LUX_A_DEBUG") != NULL) (void) printf
101*7836SJohn.Forte@Sun.COM 
102*7836SJohn.Forte@Sun.COM 
103*7836SJohn.Forte@Sun.COM 
104*7836SJohn.Forte@Sun.COM 
105*7836SJohn.Forte@Sun.COM /* Warning messages */
106*7836SJohn.Forte@Sun.COM #define	L_WARNINGS	if (getenv("_LUX_WARNINGS") != NULL) (void) printf
107*7836SJohn.Forte@Sun.COM 
108*7836SJohn.Forte@Sun.COM 
109*7836SJohn.Forte@Sun.COM #define	MIN(a, b)		(a < b ? a : b)
110*7836SJohn.Forte@Sun.COM 
111*7836SJohn.Forte@Sun.COM /*
112*7836SJohn.Forte@Sun.COM  * format parameter to dump()
113*7836SJohn.Forte@Sun.COM  */
114*7836SJohn.Forte@Sun.COM #define	HEX_ONLY	0	/* print hex only */
115*7836SJohn.Forte@Sun.COM #define	HEX_ASCII	1	/* hex and ascii */
116*7836SJohn.Forte@Sun.COM 
117*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
118*7836SJohn.Forte@Sun.COM }
119*7836SJohn.Forte@Sun.COM #endif
120*7836SJohn.Forte@Sun.COM 
121*7836SJohn.Forte@Sun.COM #endif	/* _L_COMMON_H */
122