Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / scsi_poll.9f
blob4a511a7458a4f9421c44acca2734ddbecca5dab4
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_POLL 9F "Jan 16, 2006"
7 .SH NAME
8 scsi_poll \- run a polled SCSI command on behalf of a target driver
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/scsi/scsi.h>
16 \fBint\fR \fBscsi_poll\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 the \fBscsi_pkt\fR(9S) structure.
31 .RE
33 .SH DESCRIPTION
34 .sp
35 .LP
36 The \fBscsi_poll()\fR function requests the host adapter driver to run a polled
37 command. Unlike \fBscsi_transport\fR(9F) which runs commands asynchronously,
38 \fBscsi_poll()\fR runs commands to completion before returning. If the
39 \fBpkt_time\fR member of \fIpkt\fR is \fB0\fR, the value of  \fBpkt_time\fR is
40 defaulted to \fBSCSI_POLL_TIMEOUT\fR to prevent an indefinite hang of the
41 system.
42 .SH RETURN VALUES
43 .sp
44 .LP
45 The \fBscsi_poll()\fR function returns:
46 .sp
47 .ne 2
48 .na
49 \fB\fB0\fR\fR
50 .ad
51 .RS 6n
52 command completed successfully.
53 .RE
55 .sp
56 .ne 2
57 .na
58 \fB\fB-1\fR\fR
59 .ad
60 .RS 6n
61 command failed.
62 .RE
64 .SH CONTEXT
65 .sp
66 .LP
67 The \fBscsi_poll()\fR function can be called from user, interrupt, or kernel
68 context. This function should not be called when the caller is executing
69 \fBtimeout\fR(9F) in the context of a thread.
70 .SH SEE ALSO
71 .sp
72 .LP
73 \fBmakecom\fR(9F), \fBscsi_transport\fR(9F), \fBscsi_pkt\fR(9S)
74 .sp
75 .LP
76 \fIWriting Device Drivers\fR
77 .SH WARNINGS
78 .sp
79 .LP
80 Since \fBscsi_poll()\fR runs commands to completion before returning, it may
81 require more time than is desirable when called from interrupt context.
82 Therefore, calling \fBscsi_poll\fR from interrupt context is not recommended.