xref: /titanic_52/usr/src/uts/common/sys/scsi/scsi_ctl.h (revision 0eb822a1c0c2bea495647510b75f77f0e57633eb)
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 2005 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 #define	RESET_ALL	0	/* reset SCSI bus, host adapter, everything */
47 #define	RESET_TARGET	1	/* reset SCSI target */
48 #define	RESET_BUS	2	/* reset SCSI bus only */
49 #define	RESET_LUN	3	/* reset SCSI logical unit */
50 
51 /*
52  * Defines for scsi_reset_notify flag, to register or cancel
53  * the notification of external and internal SCSI bus resets.
54  */
55 #define	SCSI_RESET_NOTIFY	0x01	/* register the reset notification */
56 #define	SCSI_RESET_CANCEL	0x02	/* cancel the reset notification */
57 
58 /*
59  * Define for scsi_get_bus_addr/scsi_get_name first argument.
60  */
61 #define	SCSI_GET_INITIATOR_ID	((struct scsi_device *)NULL)
62 					/* return initiator-id */
63 
64 /*
65  * Define for scsi_get_name string length.
66  * This is needed because MAXNAMELEN is not part of DDI.
67  */
68 #define	SCSI_MAXNAMELEN		MAXNAMELEN
69 
70 /*
71  * Property for customizing hotplug procedure
72  */
73 #define	SCSI_NO_QUIESCE	"scsi-no-quiesce"
74 
75 #ifdef	_KERNEL
76 
77 /*
78  * Kernel function declarations
79  */
80 
81 /*
82  * Capabilities functions
83  */
84 int	scsi_ifgetcap(struct scsi_address *ap, char *cap, int whom);
85 int	scsi_ifsetcap(struct scsi_address *ap, char *cap, int value, int whom);
86 
87 /*
88  * Abort and Reset functions
89  */
90 int	scsi_abort(struct scsi_address *ap, struct scsi_pkt *pkt);
91 int	scsi_reset(struct scsi_address *ap, int level);
92 int	scsi_reset_notify(struct scsi_address *ap, int flag,
93 	    void (*callback)(caddr_t), caddr_t arg);
94 int	scsi_clear_task_set(struct scsi_address *ap);
95 int	scsi_terminate_task(struct scsi_address *ap, struct scsi_pkt *pkt);
96 
97 /*
98  * Other functions
99  */
100 int	scsi_clear_aca(struct scsi_address *ap);
101 int	scsi_get_bus_addr(struct scsi_device *devp, char *name, int len);
102 int	scsi_get_name(struct scsi_device *devp, char *name, int len);
103 
104 #endif	/* _KERNEL */
105 
106 #ifdef	__cplusplus
107 }
108 #endif
109 
110 #endif	/* _SYS_SCSI_SCSI_CTL_H */
111