Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / scsi_transport.9f
blob4b4f7c65c791f8847b3d26b1f2e0fbba120bc633
1 '\" te
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"
7 .SH NAME
8 scsi_transport \- request by a SCSI target driver to start a command
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/scsi/scsi.h>
16 \fBint\fR \fBscsi_transport\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR);
17 .fi
19 .SH INTERFACE LEVEL
20 .sp
21 .LP
22 Solaris DDI specific (Solaris DDI).
23 .SH PARAMETERS
24 .sp
25 .ne 2
26 .na
27 \fB\fIpkt\fR\fR
28 .ad
29 .RS 7n
30 Pointer to a \fBscsi_pkt\fR(9S) structure.
31 .RE
33 .SH DESCRIPTION
34 .sp
35 .LP
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.
46 .SH RETURN VALUES
47 .sp
48 .LP
49 The \fBscsi_transport()\fR function returns:
50 .sp
51 .ne 2
52 .na
53 \fB\fBTRAN_ACCEPT\fR\fR
54 .ad
55 .RS 20n
56 The packet was accepted by the transport layer.
57 .RE
59 .sp
60 .ne 2
61 .na
62 \fB\fBTRAN_BUSY\fR\fR
63 .ad
64 .RS 20n
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
67 queue was full.
68 .RE
70 .sp
71 .ne 2
72 .na
73 \fB\fBTRAN_BADPKT\fR\fR
74 .ad
75 .RS 20n
76 The \fBDMA\fR count in the packet exceeded the \fBDMA\fR engine's maximum
77 \fBDMA\fR size.
78 .RE
80 .sp
81 .ne 2
82 .na
83 \fB\fBTRAN_FATAL_ERROR\fR\fR
84 .ad
85 .RS 20n
86 A fatal error has occurred in the transport layer.
87 .RE
89 .SH CONTEXT
90 .sp
91 .LP
92 The \fBscsi_transport()\fR function can be called from user, interrupt, or
93 kernel context.
94 .SH EXAMPLES
95 .LP
96 \fBExample 1 \fRUsing \fBscsi_transport()\fR
97 .sp
98 .in +2
99 .nf
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);
105 .in -2
107 .SH SEE ALSO
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