xref: /freebsd/sys/contrib/edk2/Include/Protocol/ScsiPassThru.h (revision f439973d6726c3be929c8fb3b1545b8b1744abc3)
1*f439973dSWarner Losh /** @file
2*f439973dSWarner Losh   SCSI Pass Through protocol as defined in EFI 1.1.
3*f439973dSWarner Losh   This protocol allows information about a SCSI channel to be collected,
4*f439973dSWarner Losh   and allows SCSI Request Packets to be sent to any SCSI devices on a SCSI
5*f439973dSWarner Losh   channel even if those devices are not boot devices. This protocol is attached
6*f439973dSWarner Losh   to the device handle of each SCSI channel in a system that the protocol
7*f439973dSWarner Losh   supports, and can be used for diagnostics. It may also be used to build
8*f439973dSWarner Losh   a Block I/O driver for SCSI hard drives and SCSI CD-ROM or DVD drives to
9*f439973dSWarner Losh   allow those devices to become boot devices.
10*f439973dSWarner Losh 
11*f439973dSWarner Losh   Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
12*f439973dSWarner Losh   SPDX-License-Identifier: BSD-2-Clause-Patent
13*f439973dSWarner Losh 
14*f439973dSWarner Losh **/
15*f439973dSWarner Losh 
16*f439973dSWarner Losh #ifndef __SCSI_PASS_THROUGH_H__
17*f439973dSWarner Losh #define __SCSI_PASS_THROUGH_H__
18*f439973dSWarner Losh 
19*f439973dSWarner Losh #define EFI_SCSI_PASS_THRU_PROTOCOL_GUID \
20*f439973dSWarner Losh   { \
21*f439973dSWarner Losh     0xa59e8fcf, 0xbda0, 0x43bb, {0x90, 0xb1, 0xd3, 0x73, 0x2e, 0xca, 0xa8, 0x77 } \
22*f439973dSWarner Losh   }
23*f439973dSWarner Losh 
24*f439973dSWarner Losh ///
25*f439973dSWarner Losh /// Forward reference for pure ANSI compatability
26*f439973dSWarner Losh ///
27*f439973dSWarner Losh typedef struct _EFI_SCSI_PASS_THRU_PROTOCOL EFI_SCSI_PASS_THRU_PROTOCOL;
28*f439973dSWarner Losh 
29*f439973dSWarner Losh #define EFI_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL    0x0001
30*f439973dSWarner Losh #define EFI_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL     0x0002
31*f439973dSWarner Losh #define EFI_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO  0x0004
32*f439973dSWarner Losh 
33*f439973dSWarner Losh //
34*f439973dSWarner Losh // SCSI Host Adapter Status definition
35*f439973dSWarner Losh //
36*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_OK                     0x00
37*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND        0x09  // timeout when processing the command
38*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT                0x0b  // timeout when waiting for the command processing
39*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT         0x0d  // a message reject was received when processing command
40*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_RESET              0x0e  // a bus reset was detected
41*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR           0x0f
42*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED   0x10  // the adapter failed in issuing request sense command
43*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT      0x11  // selection timeout
44*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN  0x12  // data overrun or data underrun
45*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_FREE               0x13  // Unexepected bus free
46*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR            0x14  // Target bus phase sequence failure
47*f439973dSWarner Losh #define EFI_SCSI_STATUS_HOST_ADAPTER_OTHER                  0x7f
48*f439973dSWarner Losh 
49*f439973dSWarner Losh //
50*f439973dSWarner Losh // SCSI Target Status definition
51*f439973dSWarner Losh //
52*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_GOOD                        0x00
53*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_CHECK_CONDITION             0x02 // check condition
54*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_CONDITION_MET               0x04 // condition met
55*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_BUSY                        0x08 // busy
56*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_INTERMEDIATE                0x10 // intermediate
57*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET  0x14 // intermediate-condition met
58*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_RESERVATION_CONFLICT        0x18 // reservation conflict
59*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_COMMOND_TERMINATED          0x22 // command terminated
60*f439973dSWarner Losh #define EFI_SCSI_STATUS_TARGET_QUEUE_FULL                  0x28 // queue full
61*f439973dSWarner Losh 
62*f439973dSWarner Losh typedef struct {
63*f439973dSWarner Losh   ///
64*f439973dSWarner Losh   /// The timeout, in 100 ns units, to use for the execution of this SCSI
65*f439973dSWarner Losh   /// Request Packet. A Timeout value of 0 means that this function
66*f439973dSWarner Losh   /// will wait indefinitely for the SCSI Request Packet to execute. If
67*f439973dSWarner Losh   /// Timeout is greater than zero, then this function will return
68*f439973dSWarner Losh   /// EFI_TIMEOUT if the time required to execute the SCSI Request
69*f439973dSWarner Losh   /// Packet is greater than Timeout.
70*f439973dSWarner Losh   ///
71*f439973dSWarner Losh   UINT64    Timeout;
72*f439973dSWarner Losh   ///
73*f439973dSWarner Losh   /// A pointer to the data buffer to transfer between the SCSI
74*f439973dSWarner Losh   /// controller and the SCSI device. Must be aligned to the boundary
75*f439973dSWarner Losh   /// specified in the IoAlign field of the
76*f439973dSWarner Losh   /// EFI_SCSI_PASS_THRU_MODE structure.
77*f439973dSWarner Losh   ///
78*f439973dSWarner Losh   VOID      *DataBuffer;
79*f439973dSWarner Losh   ///
80*f439973dSWarner Losh   /// A pointer to the sense data that was generated by the execution of
81*f439973dSWarner Losh   /// the SCSI Request Packet.
82*f439973dSWarner Losh   ///
83*f439973dSWarner Losh   VOID      *SenseData;
84*f439973dSWarner Losh   ///
85*f439973dSWarner Losh   /// A pointer to buffer that contains the Command Data Block to
86*f439973dSWarner Losh   /// send to the SCSI device.
87*f439973dSWarner Losh   ///
88*f439973dSWarner Losh   VOID      *Cdb;
89*f439973dSWarner Losh   ///
90*f439973dSWarner Losh   /// On Input, the size, in bytes, of InDataBuffer. On output, the
91*f439973dSWarner Losh   /// number of bytes transferred between the SCSI controller and the SCSI device.
92*f439973dSWarner Losh   ///
93*f439973dSWarner Losh   UINT32    TransferLength;
94*f439973dSWarner Losh   ///
95*f439973dSWarner Losh   /// The length, in bytes, of the buffer Cdb. The standard values are
96*f439973dSWarner Losh   /// 6, 10, 12, and 16, but other values are possible if a variable length CDB is used.
97*f439973dSWarner Losh   ///
98*f439973dSWarner Losh   UINT8     CdbLength;
99*f439973dSWarner Losh   ///
100*f439973dSWarner Losh   /// The direction of the data transfer. 0 for reads, 1 for writes. A
101*f439973dSWarner Losh   /// value of 2 is Reserved for Bi-Directional SCSI commands.
102*f439973dSWarner Losh   ///
103*f439973dSWarner Losh   UINT8     DataDirection;
104*f439973dSWarner Losh   ///
105*f439973dSWarner Losh   /// The status of the SCSI Host Controller that produces the SCSI
106*f439973dSWarner Losh   /// bus where the SCSI device attached when the SCSI Request
107*f439973dSWarner Losh   /// Packet was executed on the SCSI Controller.
108*f439973dSWarner Losh   ///
109*f439973dSWarner Losh   UINT8     HostAdapterStatus;
110*f439973dSWarner Losh   ///
111*f439973dSWarner Losh   /// The status returned by the SCSI device when the SCSI Request
112*f439973dSWarner Losh   /// Packet was executed.
113*f439973dSWarner Losh   ///
114*f439973dSWarner Losh   UINT8     TargetStatus;
115*f439973dSWarner Losh   ///
116*f439973dSWarner Losh   /// On input, the length in bytes of the SenseData buffer. On
117*f439973dSWarner Losh   /// output, the number of bytes written to the SenseData buffer.
118*f439973dSWarner Losh   ///
119*f439973dSWarner Losh   UINT8     SenseDataLength;
120*f439973dSWarner Losh } EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;
121*f439973dSWarner Losh 
122*f439973dSWarner Losh typedef struct {
123*f439973dSWarner Losh   ///
124*f439973dSWarner Losh   /// A Null-terminated Unicode string that represents the printable name of the SCSI controller.
125*f439973dSWarner Losh   ///
126*f439973dSWarner Losh   CHAR16    *ControllerName;
127*f439973dSWarner Losh   ///
128*f439973dSWarner Losh   /// A Null-terminated Unicode string that represents the printable name of the SCSI channel.
129*f439973dSWarner Losh   ///
130*f439973dSWarner Losh   CHAR16    *ChannelName;
131*f439973dSWarner Losh   ///
132*f439973dSWarner Losh   /// The Target ID of the host adapter on the SCSI channel.
133*f439973dSWarner Losh   ///
134*f439973dSWarner Losh   UINT32    AdapterId;
135*f439973dSWarner Losh   ///
136*f439973dSWarner Losh   /// Additional information on the attributes of the SCSI channel.
137*f439973dSWarner Losh   ///
138*f439973dSWarner Losh   UINT32    Attributes;
139*f439973dSWarner Losh   ///
140*f439973dSWarner Losh   /// Supplies the alignment requirement for any buffer used in a data transfer.
141*f439973dSWarner Losh   ///
142*f439973dSWarner Losh   UINT32    IoAlign;
143*f439973dSWarner Losh } EFI_SCSI_PASS_THRU_MODE;
144*f439973dSWarner Losh 
145*f439973dSWarner Losh /**
146*f439973dSWarner Losh   Sends a SCSI Request Packet to a SCSI device that is attached to
147*f439973dSWarner Losh   the SCSI channel. This function supports both blocking I/O and
148*f439973dSWarner Losh   non-blocking I/O.  The blocking I/O functionality is required,
149*f439973dSWarner Losh   and the non-blocking I/O functionality is optional.
150*f439973dSWarner Losh 
151*f439973dSWarner Losh   @param  This   Protocol instance pointer.
152*f439973dSWarner Losh   @param  Target The Target ID of the SCSI device to
153*f439973dSWarner Losh                  send the SCSI Request Packet.
154*f439973dSWarner Losh   @param  Lun    The LUN of the SCSI device to send the
155*f439973dSWarner Losh                  SCSI Request Packet.
156*f439973dSWarner Losh   @param  Packet A pointer to the SCSI Request Packet to send
157*f439973dSWarner Losh                  to the SCSI device specified by Target and Lun.
158*f439973dSWarner Losh   @param  Event  If non-blocking I/O is not supported then Event
159*f439973dSWarner Losh                  is ignored, and blocking I/O is performed.
160*f439973dSWarner Losh                  If Event is NULL, then blocking I/O is performed.
161*f439973dSWarner Losh                  If Event is not NULL and non blocking I/O is
162*f439973dSWarner Losh                  supported, then non-blocking I/O is performed,
163*f439973dSWarner Losh                  and Event will be signaled when the SCSI Request
164*f439973dSWarner Losh                  Packet completes
165*f439973dSWarner Losh 
166*f439973dSWarner Losh   @retval EFI_SUCCESS               The SCSI Request Packet was sent by the host, and
167*f439973dSWarner Losh                                     TransferLength bytes were transferred to/from
168*f439973dSWarner Losh                                     DataBuffer. See HostAdapterStatus, TargetStatus,
169*f439973dSWarner Losh                                     SenseDataLength, and SenseData in that order
170*f439973dSWarner Losh                                     for additional status information.
171*f439973dSWarner Losh   @retval EFI_BAD_BUFFER_SIZE       The SCSI Request Packet was executed, but the
172*f439973dSWarner Losh                                     entire DataBuffer could not be transferred.
173*f439973dSWarner Losh                                     The actual number of bytes transferred is returned
174*f439973dSWarner Losh                                     in TransferLength. See HostAdapterStatus,
175*f439973dSWarner Losh                                     TargetStatus, SenseDataLength, and SenseData in
176*f439973dSWarner Losh                                     that order for additional status information.
177*f439973dSWarner Losh   @retval EFI_NOT_READY             The SCSI Request Packet could not be sent because
178*f439973dSWarner Losh                                     there are too many SCSI Request Packets already
179*f439973dSWarner Losh                                     queued.  The caller may retry again later.
180*f439973dSWarner Losh   @retval EFI_DEVICE_ERROR          A device error occurred while attempting to send
181*f439973dSWarner Losh                                     the SCSI Request Packet. See HostAdapterStatus,
182*f439973dSWarner Losh                                     TargetStatus, SenseDataLength, and SenseData in
183*f439973dSWarner Losh                                     that order for additional status information.
184*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER     Target, Lun, or the contents of ScsiRequestPacket
185*f439973dSWarner Losh                                     are invalid. The SCSI Request Packet was not sent,
186*f439973dSWarner Losh                                     so no additional status information is available.
187*f439973dSWarner Losh   @retval EFI_UNSUPPORTED           The command described by the SCSI Request Packet
188*f439973dSWarner Losh                                     is not supported by the host adapter. The SCSI
189*f439973dSWarner Losh                                     Request Packet was not sent, so no additional
190*f439973dSWarner Losh                                     status information is available.
191*f439973dSWarner Losh   @retval EFI_TIMEOUT               A timeout occurred while waiting for the SCSI
192*f439973dSWarner Losh                                     Request Packet to execute. See HostAdapterStatus,
193*f439973dSWarner Losh                                     TargetStatus, SenseDataLength, and SenseData in
194*f439973dSWarner Losh                                     that order for additional status information.
195*f439973dSWarner Losh 
196*f439973dSWarner Losh **/
197*f439973dSWarner Losh typedef
198*f439973dSWarner Losh EFI_STATUS
199*f439973dSWarner Losh (EFIAPI *EFI_SCSI_PASS_THRU_PASSTHRU)(
200*f439973dSWarner Losh   IN EFI_SCSI_PASS_THRU_PROTOCOL                          *This,
201*f439973dSWarner Losh   IN UINT32                                               Target,
202*f439973dSWarner Losh   IN UINT64                                               Lun,
203*f439973dSWarner Losh   IN OUT EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET           *Packet,
204*f439973dSWarner Losh   IN EFI_EVENT                                            Event   OPTIONAL
205*f439973dSWarner Losh   );
206*f439973dSWarner Losh 
207*f439973dSWarner Losh /**
208*f439973dSWarner Losh   Used to retrieve the list of legal Target IDs for SCSI devices
209*f439973dSWarner Losh   on a SCSI channel.
210*f439973dSWarner Losh 
211*f439973dSWarner Losh   @param  This   Protocol instance pointer.
212*f439973dSWarner Losh   @param  Target On input, a pointer to the Target ID of a
213*f439973dSWarner Losh                  SCSI device present on the SCSI channel.
214*f439973dSWarner Losh                  On output, a pointer to the Target ID of
215*f439973dSWarner Losh                  the next SCSI device present on a SCSI channel.
216*f439973dSWarner Losh                  An input value of 0xFFFFFFFF retrieves the
217*f439973dSWarner Losh                  Target ID of the first SCSI device present on
218*f439973dSWarner Losh                  a SCSI channel.
219*f439973dSWarner Losh   @param  Lun    On input, a pointer to the LUN of a SCSI device
220*f439973dSWarner Losh                  present on the SCSI channel. On output, a pointer
221*f439973dSWarner Losh                  to the LUN of the next SCSI device present on a
222*f439973dSWarner Losh                  SCSI channel.
223*f439973dSWarner Losh 
224*f439973dSWarner Losh   @retval EFI_SUCCESS           The Target ID of the next SCSI device on the SCSI
225*f439973dSWarner Losh                                 channel was returned in Target and Lun.
226*f439973dSWarner Losh   @retval EFI_NOT_FOUND         There are no more SCSI devices on this SCSI channel.
227*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF, and Target and Lun were
228*f439973dSWarner Losh                                  not returned on a previous call to GetNextDevice().
229*f439973dSWarner Losh 
230*f439973dSWarner Losh **/
231*f439973dSWarner Losh typedef
232*f439973dSWarner Losh EFI_STATUS
233*f439973dSWarner Losh (EFIAPI *EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE)(
234*f439973dSWarner Losh   IN EFI_SCSI_PASS_THRU_PROTOCOL            *This,
235*f439973dSWarner Losh   IN OUT UINT32                             *Target,
236*f439973dSWarner Losh   IN OUT UINT64                             *Lun
237*f439973dSWarner Losh   );
238*f439973dSWarner Losh 
239*f439973dSWarner Losh /**
240*f439973dSWarner Losh   Used to allocate and build a device path node for a SCSI device
241*f439973dSWarner Losh   on a SCSI channel.
242*f439973dSWarner Losh 
243*f439973dSWarner Losh   @param  This       Protocol instance pointer.
244*f439973dSWarner Losh   @param  Target     The Target ID of the SCSI device for which
245*f439973dSWarner Losh                      a device path node is to be allocated and built.
246*f439973dSWarner Losh   @param  Lun        The LUN of the SCSI device for which a device
247*f439973dSWarner Losh                      path node is to be allocated and built.
248*f439973dSWarner Losh   @param  DevicePath A pointer to a single device path node that
249*f439973dSWarner Losh                      describes the SCSI device specified by
250*f439973dSWarner Losh                      Target and Lun. This function is responsible
251*f439973dSWarner Losh                      for allocating the buffer DevicePath with the boot
252*f439973dSWarner Losh                      service AllocatePool().  It is the caller's
253*f439973dSWarner Losh                      responsibility to free DevicePath when the caller
254*f439973dSWarner Losh                      is finished with DevicePath.
255*f439973dSWarner Losh 
256*f439973dSWarner Losh   @retval EFI_SUCCESS           The device path node that describes the SCSI device
257*f439973dSWarner Losh                                 specified by Target and Lun was allocated and
258*f439973dSWarner Losh                                 returned in DevicePath.
259*f439973dSWarner Losh   @retval EFI_NOT_FOUND         The SCSI devices specified by Target and Lun does
260*f439973dSWarner Losh                                 not exist on the SCSI channel.
261*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER DevicePath is NULL.
262*f439973dSWarner Losh   @retval EFI_OUT_OF_RESOURCES  There are not enough resources to allocate
263*f439973dSWarner Losh                                 DevicePath.
264*f439973dSWarner Losh 
265*f439973dSWarner Losh **/
266*f439973dSWarner Losh typedef
267*f439973dSWarner Losh EFI_STATUS
268*f439973dSWarner Losh (EFIAPI *EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH)(
269*f439973dSWarner Losh   IN EFI_SCSI_PASS_THRU_PROTOCOL            *This,
270*f439973dSWarner Losh   IN     UINT32                             Target,
271*f439973dSWarner Losh   IN     UINT64                             Lun,
272*f439973dSWarner Losh   IN OUT EFI_DEVICE_PATH_PROTOCOL           **DevicePath
273*f439973dSWarner Losh   );
274*f439973dSWarner Losh 
275*f439973dSWarner Losh /**
276*f439973dSWarner Losh   Used to translate a device path node to a Target ID and LUN.
277*f439973dSWarner Losh 
278*f439973dSWarner Losh   @param  This       Protocol instance pointer.
279*f439973dSWarner Losh   @param  DevicePath A pointer to the device path node that
280*f439973dSWarner Losh                      describes a SCSI device on the SCSI channel.
281*f439973dSWarner Losh   @param  Target     A pointer to the Target ID of a SCSI device
282*f439973dSWarner Losh                      on the SCSI channel.
283*f439973dSWarner Losh   @param  Lun        A pointer to the LUN of a SCSI device on
284*f439973dSWarner Losh                      the SCSI channel.
285*f439973dSWarner Losh 
286*f439973dSWarner Losh   @retval EFI_SUCCESS           DevicePath was successfully translated to a
287*f439973dSWarner Losh                                 Target ID and LUN, and they were returned
288*f439973dSWarner Losh                                 in Target and Lun.
289*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER DevicePath is NULL.
290*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER Target is NULL.
291*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER Lun is NULL.
292*f439973dSWarner Losh   @retval EFI_UNSUPPORTED       This driver does not support the device path
293*f439973dSWarner Losh                                 node type in DevicePath.
294*f439973dSWarner Losh   @retval EFI_NOT_FOUND         A valid translation from DevicePath to a
295*f439973dSWarner Losh                                 Target ID and LUN does not exist.
296*f439973dSWarner Losh 
297*f439973dSWarner Losh **/
298*f439973dSWarner Losh typedef
299*f439973dSWarner Losh EFI_STATUS
300*f439973dSWarner Losh (EFIAPI *EFI_SCSI_PASS_THRU_GET_TARGET_LUN)(
301*f439973dSWarner Losh   IN EFI_SCSI_PASS_THRU_PROTOCOL            *This,
302*f439973dSWarner Losh   IN  EFI_DEVICE_PATH_PROTOCOL              *DevicePath,
303*f439973dSWarner Losh   OUT UINT32                                *Target,
304*f439973dSWarner Losh   OUT UINT64                                *Lun
305*f439973dSWarner Losh   );
306*f439973dSWarner Losh 
307*f439973dSWarner Losh /**
308*f439973dSWarner Losh   Resets a SCSI channel.This operation resets all the
309*f439973dSWarner Losh   SCSI devices connected to the SCSI channel.
310*f439973dSWarner Losh 
311*f439973dSWarner Losh   @param  This Protocol instance pointer.
312*f439973dSWarner Losh 
313*f439973dSWarner Losh   @retval EFI_SUCCESS      The SCSI channel was reset.
314*f439973dSWarner Losh   @retval EFI_UNSUPPORTED  The SCSI channel does not support
315*f439973dSWarner Losh                            a channel reset operation.
316*f439973dSWarner Losh   @retval EFI_DEVICE_ERROR A device error occurred while
317*f439973dSWarner Losh                            attempting to reset the SCSI channel.
318*f439973dSWarner Losh   @retval EFI_TIMEOUT      A timeout occurred while attempting
319*f439973dSWarner Losh                            to reset the SCSI channel.
320*f439973dSWarner Losh 
321*f439973dSWarner Losh **/
322*f439973dSWarner Losh typedef
323*f439973dSWarner Losh EFI_STATUS
324*f439973dSWarner Losh (EFIAPI *EFI_SCSI_PASS_THRU_RESET_CHANNEL)(
325*f439973dSWarner Losh   IN EFI_SCSI_PASS_THRU_PROTOCOL             *This
326*f439973dSWarner Losh   );
327*f439973dSWarner Losh 
328*f439973dSWarner Losh /**
329*f439973dSWarner Losh   Resets a SCSI device that is connected to a SCSI channel.
330*f439973dSWarner Losh 
331*f439973dSWarner Losh   @param  This   Protocol instance pointer.
332*f439973dSWarner Losh   @param  Target The Target ID of the SCSI device to reset.
333*f439973dSWarner Losh   @param  Lun    The LUN of the SCSI device to reset.
334*f439973dSWarner Losh 
335*f439973dSWarner Losh   @retval EFI_SUCCESS           The SCSI device specified by Target and
336*f439973dSWarner Losh                                 Lun was reset.
337*f439973dSWarner Losh   @retval EFI_UNSUPPORTED       The SCSI channel does not support a target
338*f439973dSWarner Losh                                 reset operation.
339*f439973dSWarner Losh   @retval EFI_INVALID_PARAMETER Target or Lun are invalid.
340*f439973dSWarner Losh   @retval EFI_DEVICE_ERROR      A device error occurred while attempting
341*f439973dSWarner Losh                                 to reset the SCSI device specified by Target
342*f439973dSWarner Losh                                 and Lun.
343*f439973dSWarner Losh   @retval EFI_TIMEOUT           A timeout occurred while attempting to reset
344*f439973dSWarner Losh                                 the SCSI device specified by Target and Lun.
345*f439973dSWarner Losh 
346*f439973dSWarner Losh **/
347*f439973dSWarner Losh typedef
348*f439973dSWarner Losh EFI_STATUS
349*f439973dSWarner Losh (EFIAPI *EFI_SCSI_PASS_THRU_RESET_TARGET)(
350*f439973dSWarner Losh   IN EFI_SCSI_PASS_THRU_PROTOCOL             *This,
351*f439973dSWarner Losh   IN UINT32                                  Target,
352*f439973dSWarner Losh   IN UINT64                                  Lun
353*f439973dSWarner Losh   );
354*f439973dSWarner Losh 
355*f439973dSWarner Losh ///
356*f439973dSWarner Losh /// The EFI_SCSI_PASS_THRU_PROTOCOL provides information about a SCSI channel and
357*f439973dSWarner Losh /// the ability to send SCSI Request Packets to any SCSI device attached to that SCSI channel. The
358*f439973dSWarner Losh /// information includes the Target ID of the host controller on the SCSI channel, the attributes of
359*f439973dSWarner Losh /// the SCSI channel, the printable name for the SCSI controller, and the printable name of the
360*f439973dSWarner Losh /// SCSI channel.
361*f439973dSWarner Losh ///
362*f439973dSWarner Losh struct _EFI_SCSI_PASS_THRU_PROTOCOL {
363*f439973dSWarner Losh   ///
364*f439973dSWarner Losh   /// A pointer to the EFI_SCSI_PASS_THRU_MODE data for this SCSI channel.
365*f439973dSWarner Losh   ///
366*f439973dSWarner Losh   EFI_SCSI_PASS_THRU_MODE                 *Mode;
367*f439973dSWarner Losh   EFI_SCSI_PASS_THRU_PASSTHRU             PassThru;
368*f439973dSWarner Losh   EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE      GetNextDevice;
369*f439973dSWarner Losh   EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH    BuildDevicePath;
370*f439973dSWarner Losh   EFI_SCSI_PASS_THRU_GET_TARGET_LUN       GetTargetLun;
371*f439973dSWarner Losh   EFI_SCSI_PASS_THRU_RESET_CHANNEL        ResetChannel;
372*f439973dSWarner Losh   EFI_SCSI_PASS_THRU_RESET_TARGET         ResetTarget;
373*f439973dSWarner Losh };
374*f439973dSWarner Losh 
375*f439973dSWarner Losh extern EFI_GUID  gEfiScsiPassThruProtocolGuid;
376*f439973dSWarner Losh 
377*f439973dSWarner Losh #endif
378