xref: /titanic_51/usr/src/uts/common/sys/scsi/scsi_ctl.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1996-2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_SCSI_SCSI_CTL_H
28 #define	_SYS_SCSI_SCSI_CTL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/scsi/scsi_types.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * SCSI Control Information
40  *
41  * Defines for stating level of reset.
42  * RESET_ALL, RESET_TARGET, and RESET_LUN defined for tran_reset (invoked
43  * by target/ioctl)
44  * RESET_BUS defined for tran_bus_reset (invoked by ioctl)
45  */
46 
47 #define	RESET_ALL	0	/* reset SCSI bus, host adapter, everything */
48 #define	RESET_TARGET	1	/* reset SCSI target */
49 #define	RESET_BUS	2	/* reset SCSI bus only */
50 #define	RESET_LUN	3	/* reset SCSI logical unit */
51 
52 /*
53  * Defines for scsi_reset_notify flag, to register or cancel
54  * the notification of external and internal SCSI bus resets.
55  */
56 #define	SCSI_RESET_NOTIFY	0x01	/* register the reset notification */
57 #define	SCSI_RESET_CANCEL	0x02	/* cancel the reset notification */
58 
59 /*
60  * Define for scsi_get_addr/scsi_get_name first argument.
61  */
62 #define	SCSI_GET_INITIATOR_ID	((struct scsi_device *)NULL)
63 					/* return initiator-id */
64 
65 /*
66  * Define for scsi_get_name string length.
67  * This is needed because MAXNAMELEN is not part of DDI.
68  */
69 #define	SCSI_MAXNAMELEN		MAXNAMELEN
70 
71 /*
72  * Property for customizing hotplug procedure
73  */
74 #define	SCSI_NO_QUIESCE	"scsi-no-quiesce"
75 
76 #ifdef	_KERNEL
77 
78 /*
79  * Kernel function declarations
80  */
81 
82 /*
83  * Capabilities functions
84  */
85 
86 #ifdef	__STDC__
87 extern int scsi_ifgetcap(struct scsi_address *ap, char *cap, int whom);
88 extern int scsi_ifsetcap(struct scsi_address *ap, char *cap, int value,
89 	int whom);
90 #else	/* __STDC__ */
91 extern int scsi_ifgetcap(), scsi_ifsetcap();
92 #endif	/* __STDC__ */
93 
94 /*
95  * Abort and Reset functions
96  */
97 
98 #ifdef	__STDC__
99 extern int scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt);
100 extern int scsi_reset(struct scsi_address *ap, int level);
101 extern int scsi_reset_notify(struct scsi_address *ap, int flag,
102 	void (*callback)(caddr_t), caddr_t arg);
103 extern int scsi_clear_task_set(struct scsi_address *ap);
104 extern int scsi_terminate_task(struct scsi_address *ap, struct scsi_pkt *pkt);
105 #else	/* __STDC__ */
106 extern int scsi_abort(), scsi_reset();
107 extern int scsi_reset_notify();
108 extern int scsi_clear_task_set();
109 extern int scsi_terminate_task();
110 #endif	/* __STDC__ */
111 
112 /*
113  * Other functions
114  */
115 
116 #ifdef	__STDC__
117 extern int scsi_clear_aca(struct scsi_address *ap);
118 extern int scsi_get_bus_addr(struct scsi_device *devp, char *name, int len);
119 extern int scsi_get_name(struct scsi_device *devp, char *name, int len);
120 #else	/* __STDC__ */
121 extern int scsi_clear_aca();
122 extern int scsi_get_bus_addr();
123 extern int scsi_get_name();
124 #endif	/* __STDC__ */
125 
126 #endif	/* _KERNEL */
127 
128 #ifdef	__cplusplus
129 }
130 #endif
131 
132 #endif	/* _SYS_SCSI_SCSI_CTL_H */
133