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"
8 scsi_reset \- reset a SCSI bus or target
12 #include <sys/scsi/scsi.h>
16 \fBint\fR \fBscsi_reset\fR(\fBstruct scsi_address *\fR\fIap\fR, \fBint\fR \fIlevel\fR);
22 Solaris DDI specific (Solaris DDI).
30 Pointer to the \fBscsi_address\fR structure.
39 The level of reset required.
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
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.
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.
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.
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.
83 The \fBscsi_reset()\fR function returns:
105 The \fBscsi_reset()\fR function can be called from user, interrupt, or kernel
110 \fBtran_reset\fR(9E), \fBtran_reset_notify\fR(9E), \fBscsi_abort\fR(9F)
113 \fIWriting Device Drivers\fR