9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / scsi_reset.9f
blob21c3c360aad61b8f9a87e08913242558a7a7e20b
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_RESET 9F "Jan 16, 2006"
7 .SH NAME
8 scsi_reset \- reset a SCSI bus or target
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/scsi/scsi.h>
16 \fBint\fR \fBscsi_reset\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBint\fR \fIlevel\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\fIap\fR\fR
28 .ad
29 .RS 9n
30 Pointer to the \fBscsi_address\fR structure.
31 .RE
33 .sp
34 .ne 2
35 .na
36 \fB\fIlevel\fR\fR
37 .ad
38 .RS 9n
39 The level of reset required.
40 .RE
42 .SH DESCRIPTION
43 .sp
44 .LP
45 The \fBscsi_reset()\fR function asks the host adapter driver to reset the
46 \fBSCSI \fRbus or a \fBSCSI \fRtarget as specified by \fIlevel\fR. If
47 \fIlevel\fR equals \fBRESET_ALL\fR, the \fBSCSI\fR bus is reset. If it equals
48 \fBRESET_TARGET\fR, \fIap\fR is used to determine the target to be reset. If it
49 equals \fBRESET_LUN\fR, \fIap\fR is used to determine the logical unit to be
50 reset.
51 .sp
52 .LP
53 When given the \fBRESET_LUN\fR level, \fBscsi_reset()\fR can return failure if
54 the \fBLOGICAL UNIT RESET\fR message is not supported by the target device, or
55 if the underlying HBA driver does not implement the ability to issue a
56 \fBLOGICAL UNIT RESET\fR message.
57 .sp
58 .LP
59 Note that, at the point when \fBscsi_reset()\fR resets the logical unit (case
60 \fBRESET_LUN\fR), or the target (case \fBRESET_TARGET\fR), or the bus (case
61 \fBRESET_ALL\fR), there might be one or more command packets outstanding. That
62 is, packets have been passed to \fBscsi_transport()\fR, and queued or possibly
63 transported, but the commands have not been completed and the target completion
64 routine has not been called for those packets.
65 .sp
66 .LP
67 The successful call to \fBscsi_reset()\fR has the side effect that any such
68 commands currently outstanding are aborted, at which point the packets are
69 marked with \fBpkt_reason\fR set to \fBCMD_RESET\fR, and the appropriate bit --
70 either \fBSTAT_BUS_RESET\fR or \fBSTAT_DEV_RESET\fR -- is set in
71 \fBpkt_statistics\fR. Once thus appropriately marked, the aborted command
72 packets are passed to the target driver command completion routine.
73 .sp
74 .LP
75 Also note that, at the moment that a thread executing \fBscsi_reset()\fR
76 actually resets the target or the bus, it is possible that a second thread may
77 have already called \fBscsi_transport()\fR, but not yet queued or transported
78 its command. In this case the HBA will not yet have received the second
79 thread's packet and this packet will not be aborted.
80 .SH RETURN VALUES
81 .sp
82 .LP
83 The \fBscsi_reset()\fR function returns:
84 .sp
85 .ne 2
86 .na
87 \fB\fB1\fR\fR
88 .ad
89 .RS 5n
90 Upon success.
91 .RE
93 .sp
94 .ne 2
95 .na
96 \fB\fB0\fR\fR
97 .ad
98 .RS 5n
99 Upon failure.
102 .SH CONTEXT
105 The \fBscsi_reset()\fR function can be called from user, interrupt, or kernel
106 context.
107 .SH SEE ALSO
110 \fBtran_reset\fR(9E), \fBtran_reset_notify\fR(9E), \fBscsi_abort\fR(9F)
113 \fIWriting Device Drivers\fR