2 .\" Copyright (c) 2006, 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_TRANSPORT 9F "Jan 16, 2006"
8 scsi_transport \- request by a SCSI target driver to start a command
12 #include <sys/scsi/scsi.h>
16 \fBint\fR \fBscsi_transport\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR);
22 Solaris DDI specific (Solaris DDI).
30 Pointer to a \fBscsi_pkt\fR(9S) structure.
36 Target drivers use \fBscsi_transport()\fR to request the host adapter driver to
37 transport a command to the \fBSCSI \fRtarget device specified by \fIpkt\fR. The
38 target driver must obtain resources for the packet using
39 \fBscsi_init_pkt\fR(9F) prior to calling this function. The packet may be
40 initialized using one of the \fBmakecom\fR(9F) functions.
41 \fBscsi_transport()\fR does not wait for the \fBSCSI\fR command to complete.
42 See \fBscsi_poll\fR(9F) for a description of polled \fBSCSI\fR commands. Upon
43 completion of the \fBSCSI\fR command the host adapter calls the completion
44 routine provided by the target driver in the \fBpkt_comp\fR member of the
45 \fBscsi_pkt\fR pointed to by \fIpkt\fR.
49 The \fBscsi_transport()\fR function returns:
53 \fB\fBTRAN_ACCEPT\fR\fR
56 The packet was accepted by the transport layer.
65 The packet could not be accepted because there was already a packet in progress
66 for this target/lun, the host adapter queue was full, or the target device
73 \fB\fBTRAN_BADPKT\fR\fR
76 The \fBDMA\fR count in the packet exceeded the \fBDMA\fR engine's maximum
83 \fB\fBTRAN_FATAL_ERROR\fR\fR
86 A fatal error has occurred in the transport layer.
92 The \fBscsi_transport()\fR function can be called from user, interrupt, or
96 \fBExample 1 \fRUsing \fBscsi_transport()\fR
100 if ((status = scsi_transport(rqpkt)) != TRAN_ACCEPT) {
101 scsi_log(devp, sd_label, CE_WARN,
102 "transport of request sense pkt fails (0x%x)\en", status);
110 \fBtran_start\fR(9E), \fBmakecom\fR(9F), \fBscsi_init_pkt\fR(9F),
111 \fBscsi_pktalloc\fR(9F), \fBscsi_poll\fR(9F), \fBscsi_pkt\fR(9S)
114 \fIWriting Device Drivers\fR