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"
8 scsi_slave \- utility for SCSI target drivers to establish the presence of a
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);
23 The \fBscsi_slave()\fR function is obsolete. This function has been replaced by
32 Pointer to a \fBscsi_device\fR(9S) structure.
41 Pointer to a callback function, \fBNULL_FUNC\fR or \fBSLEEP_FUNC\fR.
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
60 \fB\fBNULL_FUNC\fR \fR
63 Do not wait for resources. Return a \fINULL\fR pointer.
69 \fB\fBSLEEP_FUNC\fR \fR
72 Wait indefinitely for resources.
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
92 \fBscsi_slave()\fR returns:
96 \fB\fBSCSIPROBE_NOMEM\fR \fR
99 No space available for structures.
105 \fB\fBSCSIPROBE_EXISTS\fR \fR
108 Device exists and inquiry data is valid.
114 \fB\fBSCSIPROBE_NONCCS\fR \fR
117 Device exists but inquiry data is not valid.
123 \fB\fBSCSIPROBE_FAILURE\fR \fR
126 Polled command failure.
132 \fB\fBSCSIPROBE_NORESP\fR \fR
135 No response to \fBTEST UNIT READY\fR.
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
148 See \fBattributes\fR(5) for a description of the following attributes:
156 ATTRIBUTE TYPE ATTRIBUTE VALUE
158 Stability Level Obsolete
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
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).