xref: /titanic_44/usr/src/uts/common/sys/scsi/conf/device.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 (c) 1996, by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 /*
28  * SCSI device structure.
29  *
30  *	All SCSI target drivers will have one of these per target/lun.
31  *	It will be created by a parent device and stored as driver private
32  *	data in that device's dev_info_t (and thus can be retrieved by
33  *	the function ddi_get_driver_private).
34  */
35 
36 #ifndef	_SYS_SCSI_CONF_DEVICE_H
37 #define	_SYS_SCSI_CONF_DEVICE_H
38 
39 #pragma ident	"%Z%%M%	%I%	%E% SMI"
40 
41 #include <sys/scsi/scsi_types.h>
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 struct scsi_device {
48 	/*
49 	 * Routing info for this device.
50 	 */
51 
52 	struct scsi_address	sd_address;
53 
54 	/*
55 	 * Cross-reference to our dev_info_t.
56 	 */
57 
58 	dev_info_t		*sd_dev;
59 
60 	/*
61 	 * Mutex for this device, initialized by
62 	 * parent prior to calling probe or attach
63 	 * routine.
64 	 */
65 
66 	kmutex_t		sd_mutex;
67 
68 	/*
69 	 * Reserved, do not use.
70 	 */
71 
72 	void			*sd_reserved;
73 
74 
75 	/*
76 	 * If scsi_slave is used to probe out this device,
77 	 * a scsi_inquiry data structure will be allocated
78 	 * and an INQUIRY command will be run to fill it in.
79 	 *
80 	 * The allocation will be done via ddi_iopb_alloc,
81 	 * so any manual freeing may be done by ddi_iopb_free.
82 	 */
83 
84 	struct scsi_inquiry	*sd_inq;
85 
86 
87 	/*
88 	 * Place to point to an extended request sense buffer.
89 	 * The target driver is responsible for managing this.
90 	 */
91 
92 	struct scsi_extended_sense	*sd_sense;
93 
94 	/*
95 	 * More detailed information is 'private' information, i.e., is
96 	 * only pertinent to Target drivers.
97 	 */
98 
99 	caddr_t			sd_private;
100 
101 };
102 
103 
104 #ifdef	_KERNEL
105 #ifdef	__STDC__
106 extern int scsi_slave(struct scsi_device *devp, int (*callback)());
107 extern int scsi_probe(struct scsi_device *devp, int (*callback)());
108 extern void scsi_unslave(struct scsi_device *devp);
109 extern void scsi_unprobe(struct scsi_device *devp);
110 #else	/* __STDC__ */
111 extern int scsi_slave();
112 extern void scsi_unslave();
113 extern int scsi_probe();
114 extern void scsi_unprobe();
115 #endif	/* __STDC__ */
116 #endif	/* _KERNEL */
117 
118 #ifdef	__cplusplus
119 }
120 #endif
121 
122 #endif	/* _SYS_SCSI_CONF_DEVICE_H */
123