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