3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 EFI_EXT_SCSI_PASS_THRU_PROTOCOL as defined in UEFI 2.0.
23 #ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
24 #define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
26 #define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \
28 0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe } \
31 typedef struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL EFI_EXT_SCSI_PASS_THRU_PROTOCOL
;
33 #define TARGET_MAX_BYTES 0x10
35 #define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
36 #define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
37 #define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
42 #define EFI_EXT_SCSI_DATA_DIRECTION_READ 0
43 #define EFI_EXT_SCSI_DATA_DIRECTION_WRITE 1
44 #define EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL 2
48 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK 0x00
49 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09
50 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b
51 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d
52 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e
53 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
54 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10
55 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11
56 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12
57 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13
58 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14
59 #define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f
63 #define EFI_EXT_SCSI_STATUS_TARGET_GOOD 0x00
64 #define EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02
65 #define EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET 0x04
66 #define EFI_EXT_SCSI_STATUS_TARGET_BUSY 0x08
67 #define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE 0x10
68 #define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14
69 #define EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18
70 #define EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL 0x28
71 #define EFI_EXT_SCSI_STATUS_TARGET_ACA_ACTIVE 0x30
72 #define EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED 0x40
78 } EFI_EXT_SCSI_PASS_THRU_MODE
;
86 UINT32 InTransferLength
;
87 UINT32 OutTransferLength
;
90 UINT8 HostAdapterStatus
;
92 UINT8 SenseDataLength
;
93 } EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
;
97 (EFIAPI
*EFI_EXT_SCSI_PASS_THRU_PASSTHRU
) (
98 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
101 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
102 IN EFI_EVENT Event OPTIONAL
107 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function
108 supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the
109 nonblocking I/O functionality is optional.
112 This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
113 Target - The Target is an array of size TARGET_MAX_BYTES and it represents
114 the id of the SCSI device to send the SCSI Request Packet. Each
115 transport driver may chose to utilize a subset of this size to suit the needs
116 of transport target representation. For example, a Fibre Channel driver
117 may use only 8 bytes (WWN) to represent an FC target.
118 Lun - The LUN of the SCSI device to send the SCSI Request Packet.
119 Packet - A pointer to the SCSI Request Packet to send to the SCSI device
120 specified by Target and Lun.
121 Event - If nonblocking I/O is not supported then Event is ignored, and blocking
122 I/O is performed. If Event is NULL, then blocking I/O is performed. If
123 Event is not NULL and non blocking I/O is supported, then
124 nonblocking I/O is performed, and Event will be signaled when the
125 SCSI Request Packet completes.
128 EFI_SUCCESS - The SCSI Request Packet was sent by the host. For bi-directional
129 commands, InTransferLength bytes were transferred from
130 InDataBuffer. For write and bi-directional commands,
131 OutTransferLength bytes were transferred by
133 EFI_BAD_BUFFER_SIZE - The SCSI Request Packet was not executed. The number of bytes that
134 could be transferred is returned in InTransferLength. For write
135 and bi-directional commands, OutTransferLength bytes were
136 transferred by OutDataBuffer.
137 EFI_NOT_READY - The SCSI Request Packet could not be sent because there are too many
138 SCSI Request Packets already queued. The caller may retry again later.
139 EFI_DEVICE_ERROR - A device error occurred while attempting to send the SCSI Request
141 EFI_INVALID_PARAMETER- Target, Lun, or the contents of ScsiRequestPacket are invalid.
142 EFI_UNSUPPORTED - The command described by the SCSI Request Packet is not supported
143 by the host adapter. This includes the case of Bi-directional SCSI
144 commands not supported by the implementation. The SCSI Request
145 Packet was not sent, so no additional status information is available.
146 EFI_TIMEOUT - A timeout occurred while waiting for the SCSI Request Packet to execute.
153 (EFIAPI
*EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN
) (
154 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
155 IN OUT UINT8
**Target
,
160 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These
161 can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal
162 Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the
163 Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI
167 This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance
168 Target - On input, a pointer to the Target ID (an array of size
169 TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
170 On output, a pointer to the Target ID (an array of
171 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
172 channel. An input value of 0xF(all bytes in the array are 0xF) in the
173 Target array retrieves the Target ID of the first SCSI device present on
175 Lun - On input, a pointer to the LUN of a SCSI device present on the SCSI
176 channel. On output, a pointer to the LUN of the next SCSI device present
180 EFI_SUCCESS - The Target ID and LUN of the next SCSI device on the SCSI
181 channel was returned in Target and Lun.
182 EFI_INVALID_PARAMETER - Target array is not all 0xF, and Target and Lun were
183 not returned on a previous call to GetNextTargetLun().
184 EFI_NOT_FOUND - There are no more SCSI devices on this SCSI channel.
191 (EFIAPI
*EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH
) (
192 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
195 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
200 Used to allocate and build a device path node for a SCSI device on a SCSI channel.
203 This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
204 Target - The Target is an array of size TARGET_MAX_BYTES and it specifies the
205 Target ID of the SCSI device for which a device path node is to be
206 allocated and built. Transport drivers may chose to utilize a subset of
207 this size to suit the representation of targets. For example, a Fibre
208 Channel driver may use only 8 bytes (WWN) in the array to represent a
210 Lun - The LUN of the SCSI device for which a device path node is to be
213 DevicePath - A pointer to a single device path node that describes the SCSI device
214 specified by Target and Lun. This function is responsible for
215 allocating the buffer DevicePath with the boot service
216 AllocatePool(). It is the caller's responsibility to free
217 DevicePath when the caller is finished with DevicePath.
220 EFI_SUCCESS - The device path node that describes the SCSI device specified by
221 Target and Lun was allocated and returned in
223 EFI_INVALID_PARAMETER - DevicePath is NULL.
224 EFI_NOT_FOUND - The SCSI devices specified by Target and Lun does not exist
226 EFI_OUT_OF_RESOURCES - There are not enough resources to allocate DevicePath.
233 (EFIAPI
*EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN
) (
234 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
235 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
242 Used to translate a device path node to a Target ID and LUN.
245 This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
246 DevicePath - A pointer to a single device path node that describes the SCSI device
248 Target - A pointer to the Target Array which represents the ID of a SCSI device
250 Lun - A pointer to the LUN of a SCSI device on the SCSI channel.
253 EFI_SUCCESS - DevicePath was successfully translated to a Target ID and
254 LUN, and they were returned in Target and Lun.
255 EFI_INVALID_PARAMETER - DevicePath or Target or Lun is NULL.
256 EFI_NOT_FOUND - A valid translation from DevicePath to a Target ID and LUN
258 EFI_UNSUPPORTED - This driver does not support the device path node type in
266 (EFIAPI
*EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL
) (
267 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
272 Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
275 This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
278 EFI_SUCCESS - The SCSI channel was reset.
279 EFI_DEVICE_ERROR - A device error occurred while attempting to reset the SCSI channel.
280 EFI_TIMEOUT - A timeout occurred while attempting to reset the SCSI channel.
281 EFI_UNSUPPORTED - The SCSI channel does not support a channel reset operation.
288 (EFIAPI
*EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN
) (
289 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
296 Resets a SCSI logical unit that is connected to a SCSI channel.
299 This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
300 Target The Target is an array of size TARGET_MAX_BYTE and it represents the
301 target port ID of the SCSI device containing the SCSI logical unit to
302 reset. Transport drivers may chose to utilize a subset of this array to suit
303 the representation of their targets.
304 Lun The LUN of the SCSI device to reset.
307 EFI_SUCCESS - The SCSI device specified by Target and Lun was reset.
308 EFI_INVALID_PARAMETER - Target or Lun is NULL.
309 EFI_TIMEOUT - A timeout occurred while attempting to reset the SCSI device
310 specified by Target and Lun.
311 EFI_UNSUPPORTED - The SCSI channel does not support a target reset operation.
312 EFI_DEVICE_ERROR - A device error occurred while attempting to reset the SCSI device
313 specified by Target and Lun.
320 (EFIAPI
*EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET
) (
321 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
322 IN OUT UINT8
**Target
327 Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either
328 be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs
329 for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to
330 see if a SCSI device is actually present at that location on the SCSI channel.
333 This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
334 Target - (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
335 On output, a pointer to the Target ID (an array of
336 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
337 channel. An input value of 0xF(all bytes in the array are 0xF) in the
338 Target array retrieves the Target ID of the first SCSI device present on a
342 EFI_SUCCESS - The Target ID of the next SCSI device on the SCSI
343 channel was returned in Target.
344 EFI_INVALID_PARAMETER - Target or Lun is NULL.
345 EFI_TIMEOUT - Target array is not all 0xF, and Target were not
346 returned on a previous call to GetNextTarget().
347 EFI_NOT_FOUND - There are no more SCSI devices on this SCSI channel.
352 struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL
{
353 EFI_EXT_SCSI_PASS_THRU_MODE
*Mode
;
354 EFI_EXT_SCSI_PASS_THRU_PASSTHRU PassThru
;
355 EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN GetNextTargetLun
;
356 EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath
;
357 EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun
;
358 EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel
;
359 EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN ResetTargetLun
;
360 EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET GetNextTarget
;
363 extern EFI_GUID gEfiExtScsiPassThruProtocolGuid
;