Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / scsi_slave.9f
blob621c4fd2602f4f31b3d742f501d3a8733224a0c5
1 '\" te
2 .\" Copyright (c) 2002, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SCSI_SLAVE 9F "Sep 27, 2002"
7 .SH NAME
8 scsi_slave \- utility for SCSI target drivers to establish the presence of a
9 target
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/scsi/scsi.h>
17 \fBint\fR \fBscsi_slave\fR(\fBstruct scsi_device *\fR\fIdevp\fR, \fBint\fR \fB(*\fRcallback\fB)(void)\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .sp
22 .LP
23 The \fBscsi_slave()\fR function is obsolete. This function has been replaced by
24 \fBscsi_probe\fR(9F).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIdevp\fR \fR
30 .ad
31 .RS 13n
32 Pointer to a \fBscsi_device\fR(9S) structure.
33 .RE
35 .sp
36 .ne 2
37 .na
38 \fB\fIcallback\fR \fR
39 .ad
40 .RS 13n
41 Pointer to a callback function, \fBNULL_FUNC\fR or \fBSLEEP_FUNC\fR.
42 .RE
44 .SH DESCRIPTION
45 .sp
46 .LP
47 \fBscsi_slave()\fR checks for the presence of a \fBSCSI\fR device. Target
48 drivers may use this function in their \fBprobe\fR(9E) routines.
49 \fBscsi_slave()\fR determines if the device is present by using a Test Unit
50 Ready command followed by an Inquiry command. If \fBscsi_slave()\fR is
51 successful, it will fill in the \fBscsi_inquiry\fR structure, which is the
52 \fBsd_inq\fR member of the \fBscsi_device\fR(9S) structure, and return
53 \fBSCSI_PROBE_EXISTS\fR. This information can be used to determine if the
54 target driver has probed the correct SCSI device type. \fIcallback\fR indicates
55 what the allocator routines should do when \fBDMA \fRresources are not
56 available:
57 .sp
58 .ne 2
59 .na
60 \fB\fBNULL_FUNC\fR \fR
61 .ad
62 .RS 16n
63 Do not wait for resources. Return a \fINULL\fR pointer.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fBSLEEP_FUNC\fR \fR
70 .ad
71 .RS 16n
72 Wait indefinitely for resources.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fBOther Values\fR
79 .ad
80 .RS 16n
81 \fIcallback\fR points to a function which is called when resources may have
82 become available. \fIcallback\fR \fBmust\fR return either \fB0\fR (indicating
83 that it attempted to allocate resources but again failed to do so), in which
84 case it is put back on a list to be called again later, or \fB1\fR indicating
85 either success in allocating resources or indicating that it no longer cares
86 for a retry.
87 .RE
89 .SH RETURN VALUES
90 .sp
91 .LP
92 \fBscsi_slave()\fR returns:
93 .sp
94 .ne 2
95 .na
96 \fB\fBSCSIPROBE_NOMEM\fR \fR
97 .ad
98 .RS 22n
99 No space available for structures.
103 .ne 2
105 \fB\fBSCSIPROBE_EXISTS\fR \fR
107 .RS 22n
108 Device exists and inquiry data is valid.
112 .ne 2
114 \fB\fBSCSIPROBE_NONCCS\fR \fR
116 .RS 22n
117 Device exists but inquiry data is not valid.
121 .ne 2
123 \fB\fBSCSIPROBE_FAILURE\fR \fR
125 .RS 22n
126 Polled command failure.
130 .ne 2
132 \fB\fBSCSIPROBE_NORESP\fR \fR
134 .RS 22n
135 No response to \fBTEST UNIT READY\fR.
138 .SH CONTEXT
141 \fBscsi_slave()\fR is normally called from the target driver's \fBprobe\fR(9E)
142 or \fBattach\fR(9E) routine. In any case, this routine should not be called
143 from interrupt context, because it can sleep waiting for memory to be
144 allocated.
145 .SH ATTRIBUTES
148 See \fBattributes\fR(5) for a description of the following attributes:
153 box;
154 c | c
155 l | l .
156 ATTRIBUTE TYPE  ATTRIBUTE VALUE
158 Stability Level Obsolete
161 .SH SEE ALSO
164 \fBattributes\fR(5), \fBattach\fR(9E), \fBprobe\fR(9E),
165 \fBddi_iopb_alloc\fR(9F), \fBmakecom\fR(9F), \fBscsi_dmaget\fR(9F),
166 \fBscsi_ifgetcap\fR(9F), \fBscsi_pktalloc\fR(9F), \fBscsi_poll\fR(9F),
167 \fBscsi_probe\fR(9F), \fBscsi_device\fR(9S)
170  \fIANSI Small Computer System Interface-2 (SCSI-2)\fR
173 \fIWriting Device Drivers\fR
174 .SH NOTES
177 The \fBscsi_slave()\fR function is obsolete and will be discontinued in a
178 future release. This function has been replaced by \fBscsi_probe\fR(9F).