]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/TianoTools/Include/Protocol/ScsiPassThruExt.h
1. Removed the unnecessary #include statements and include files
[mirror_edk2.git] / Tools / Source / TianoTools / Include / Protocol / ScsiPassThruExt.h
CommitLineData
21b50a27 1/** @file\r
2 EFI_EXT_SCSI_PASS_THRU_PROTOCOL as defined in UEFI 2.0.\r
3\r
4 Copyright (c) 2006, Intel Corporation \r
5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13 Module Name: ScsiPassThruExt.h\r
14\r
15**/\r
16\r
17#ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__\r
18#define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__\r
19\r
20#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \\r
21 { \\r
22 0x1d3de7f0, 0x0807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } \\r
23 }\r
24\r
25typedef struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL EFI_EXT_SCSI_PASS_THRU_PROTOCOL;\r
26\r
27#define TARGET_MAX_BYTES 0x10\r
28\r
29#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001\r
30#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002\r
31#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004\r
32\r
33//\r
34// DataDirection\r
35//\r
36#define EFI_EXT_SCSI_DATA_DIRECTION_READ 0\r
37#define EFI_EXT_SCSI_DATA_DIRECTION_WRITE 1\r
38#define EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL 2\r
39//\r
40// HostAdapterStatus\r
41//\r
42#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK 0x00\r
43#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09\r
44#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b\r
45#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d\r
46#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e\r
47#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f\r
48#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10\r
49#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11\r
50#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12\r
51#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13\r
52#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14\r
53#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f\r
54//\r
55// TargetStatus\r
56//\r
57#define EFI_EXT_SCSI_STATUS_TARGET_GOOD 0x00\r
58#define EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02\r
59#define EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET 0x04\r
60#define EFI_EXT_SCSI_STATUS_TARGET_BUSY 0x08\r
61#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE 0x10\r
62#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14\r
63#define EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18\r
64#define EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL 0x28\r
65#define EFI_EXT_SCSI_STATUS_TARGET_ACA_ACTIVE 0x30\r
66#define EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED 0x40\r
67\r
68typedef struct {\r
69 UINT32 AdapterId;\r
70 UINT32 Attributes;\r
71 UINT32 IoAlign;\r
72} EFI_EXT_SCSI_PASS_THRU_MODE;\r
73\r
74typedef struct {\r
75 UINT64 Timeout;\r
76 VOID *InDataBuffer;\r
77 VOID *OutDataBuffer;\r
78 VOID *SenseData;\r
79 VOID *Cdb;\r
80 UINT32 InTransferLength;\r
81 UINT32 OutTransferLength;\r
82 UINT8 CdbLength;\r
83 UINT8 DataDirection;\r
84 UINT8 HostAdapterStatus;\r
85 UINT8 TargetStatus;\r
86 UINT8 SenseDataLength;\r
87} EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;\r
88\r
89/**\r
90 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function \r
91 supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the\r
92 nonblocking I/O functionality is optional. \r
93\r
94 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
95 @param Target The Target is an array of size TARGET_MAX_BYTES and it represents\r
96 the id of the SCSI device to send the SCSI Request Packet. Each\r
97 transport driver may chose to utilize a subset of this size to suit the needs\r
98 of transport target representation. For example, a Fibre Channel driver\r
99 may use only 8 bytes (WWN) to represent an FC target.\r
100 @param Lun The LUN of the SCSI device to send the SCSI Request Packet.\r
101 @param Packet A pointer to the SCSI Request Packet to send to the SCSI device\r
102 specified by Target and Lun.\r
103 @param Event If nonblocking I/O is not supported then Event is ignored, and blocking\r
104 I/O is performed. If Event is NULL, then blocking I/O is performed. If\r
105 Event is not NULL and non blocking I/O is supported, then\r
106 nonblocking I/O is performed, and Event will be signaled when the\r
107 SCSI Request Packet completes.\r
108\r
109 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional\r
110 commands, InTransferLength bytes were transferred from\r
111 InDataBuffer. For write and bi-directional commands,\r
112 OutTransferLength bytes were transferred by\r
113 OutDataBuffer.\r
114 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that\r
115 could be transferred is returned in InTransferLength. For write\r
116 and bi-directional commands, OutTransferLength bytes were\r
117 transferred by OutDataBuffer.\r
118 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r
119 SCSI Request Packets already queued. The caller may retry again later.\r
120 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request\r
121 Packet.\r
122 @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.\r
123 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported\r
124 by the host adapter. This includes the case of Bi-directional SCSI\r
125 commands not supported by the implementation. The SCSI Request\r
126 Packet was not sent, so no additional status information is available.\r
127 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
128\r
129**/\r
130typedef\r
131EFI_STATUS\r
132(EFIAPI *EFI_EXT_SCSI_PASS_THRU_PASSTHRU) (\r
133 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
134 IN UINT8 *Target,\r
135 IN UINT64 Lun,\r
136 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,\r
137 IN EFI_EVENT Event OPTIONAL\r
138 )\r
139; \r
140\r
141/**\r
142 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These \r
143 can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal\r
144 Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the \r
145 Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI \r
146 channel. \r
147\r
148 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
149 @param Target On input, a pointer to the Target ID (an array of size\r
150 TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.\r
151 On output, a pointer to the Target ID (an array of\r
152 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI\r
153 channel. An input value of 0xF(all bytes in the array are 0xF) in the\r
154 Target array retrieves the Target ID of the first SCSI device present on a\r
155 SCSI channel.\r
156 @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI\r
157 channel. On output, a pointer to the LUN of the next SCSI device present\r
158 on a SCSI channel.\r
159\r
160 @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI\r
161 channel was returned in Target and Lun.\r
162 @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were\r
163 not returned on a previous call to GetNextTargetLun().\r
164 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r
165\r
166**/\r
167typedef\r
168EFI_STATUS\r
169(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN) (\r
170 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
171 IN OUT UINT8 **Target,\r
172 IN OUT UINT64 *Lun\r
173 )\r
174; \r
175\r
176/**\r
177 Used to allocate and build a device path node for a SCSI device on a SCSI channel.\r
178\r
179 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
180 @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the\r
181 Target ID of the SCSI device for which a device path node is to be\r
182 allocated and built. Transport drivers may chose to utilize a subset of\r
183 this size to suit the representation of targets. For example, a Fibre\r
184 Channel driver may use only 8 bytes (WWN) in the array to represent a\r
185 FC target.\r
186 @param Lun The LUN of the SCSI device for which a device path node is to be\r
187 allocated and built.\r
188 \r
189 @param DevicePath A pointer to a single device path node that describes the SCSI device\r
190 specified by Target and Lun. This function is responsible for\r
191 allocating the buffer DevicePath with the boot service\r
192 AllocatePool(). It is the caller's responsibility to free\r
193 DevicePath when the caller is finished with DevicePath.\r
194\r
195 @retval EFI_SUCCESS The device path node that describes the SCSI device specified by\r
196 Target and Lun was allocated and returned in\r
197 DevicePath.\r
198 @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
199 @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist\r
200 on the SCSI channel.\r
201 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.\r
202\r
203**/\r
204typedef\r
205EFI_STATUS\r
206(EFIAPI *EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH) (\r
207 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
208 IN UINT8 *Target,\r
209 IN UINT64 Lun,\r
210 IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath\r
211 )\r
212; \r
213\r
214/**\r
215 Used to translate a device path node to a Target ID and LUN.\r
216\r
217 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
218 @param DevicePath A pointer to a single device path node that describes the SCSI device\r
219 on the SCSI channel.\r
220 @param Target A pointer to the Target Array which represents the ID of a SCSI device\r
221 on the SCSI channel.\r
222 @param Lun A pointer to the LUN of a SCSI device on the SCSI channel.\r
223\r
224 @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and\r
225 LUN, and they were returned in Target and Lun.\r
226 @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.\r
227 @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN\r
228 does not exist.\r
229 @retval EFI_UNSUPPORTED This driver does not support the device path node type in\r
230 DevicePath.\r
231\r
232**/\r
233typedef\r
234EFI_STATUS\r
235(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN) (\r
236 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
237 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
238 OUT UINT8 **Target,\r
239 OUT UINT64 *Lun\r
240 )\r
241; \r
242\r
243/**\r
244 Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.\r
245\r
246 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
247\r
248 @retval EFI_SUCCESS The SCSI channel was reset.\r
249 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.\r
250 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.\r
251 @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.\r
252\r
253**/\r
254typedef\r
255EFI_STATUS\r
256(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL) (\r
257 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This\r
258 )\r
259; \r
260 \r
261/**\r
262 Resets a SCSI logical unit that is connected to a SCSI channel.\r
263\r
264 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
265 @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the\r
266 target port ID of the SCSI device containing the SCSI logical unit to\r
267 reset. Transport drivers may chose to utilize a subset of this array to suit\r
268 the representation of their targets.\r
269 @param Lun The LUN of the SCSI device to reset.\r
270\r
271 @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.\r
272 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r
273 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device\r
274 specified by Target and Lun.\r
275 @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.\r
276 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device\r
277 specified by Target and Lun.\r
278\r
279**/\r
280typedef\r
281EFI_STATUS\r
282(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN) (\r
283 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
284 IN UINT8 *Target,\r
285 IN UINT64 Lun\r
286 )\r
287; \r
288\r
289/**\r
290 Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either \r
291 be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs\r
292 for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to \r
293 see if a SCSI device is actually present at that location on the SCSI channel. \r
294\r
295 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
296 @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.\r
297 On output, a pointer to the Target ID (an array of\r
298 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI\r
299 channel. An input value of 0xF(all bytes in the array are 0xF) in the\r
300 Target array retrieves the Target ID of the first SCSI device present on a\r
301 SCSI channel.\r
302\r
303 @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI\r
304 channel was returned in Target.\r
305 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r
306 @retval EFI_TIMEOUT Target array is not all 0xF, and Target were not\r
307 returned on a previous call to GetNextTarget().\r
308 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.\r
309\r
310**/\r
311typedef\r
312EFI_STATUS\r
313(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET) (\r
314 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,\r
315 IN OUT UINT8 **Target\r
316 )\r
317; \r
318 \r
319struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL {\r
320 EFI_EXT_SCSI_PASS_THRU_MODE *Mode;\r
321 EFI_EXT_SCSI_PASS_THRU_PASSTHRU PassThru;\r
322 EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN GetNextTargetLun;\r
323 EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;\r
324 EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun;\r
325 EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel;\r
326 EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN ResetTargetLun;\r
327 EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET GetNextTarget;\r
328};\r
329\r
330extern EFI_GUID gEfiExtScsiPassThruProtocolGuid;\r
331\r
332#endif\r