]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/UefiScsiLib.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Library / UefiScsiLib.h
CommitLineData
842f5579 1/** @file\r
1a2f870c 2 Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.\r
fb3df220 3\r
cf8ae2f6 4 This library class provides the functions to submit SCSI commands defined in SCSI-2 specification\r
5 for hard drive, CD and DVD devices that are the most common SCSI boot targets used by UEFI platforms.\r
6 This library class depends on SCSI I/O Protocol defined in UEFI Specification and SCSI-2 industry standard.\r
7\r
9095d37b 8Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 9SPDX-License-Identifier: BSD-2-Clause-Patent\r
fb3df220 10\r
842f5579 11**/\r
fb3df220 12\r
c1f1e9ac 13#ifndef __SCSI_LIB_H__\r
14#define __SCSI_LIB_H__\r
fb3df220 15\r
c7d265a9 16#include <Protocol/ScsiIo.h>\r
17\r
fc30687f 18/**\r
d5954c61 19 Execute Test Unit Ready SCSI command on a specific SCSI target.\r
b91d5eca 20\r
d5954c61 21 Executes the Test Unit Ready command on the SCSI target specified by ScsiIo.\r
22 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
23 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r
24 If ScsiIo is NULL, then ASSERT().\r
b91d5eca 25 If SenseDataLength is NULL, then ASSERT().\r
b91d5eca 26 If HostAdapterStatus is NULL, then ASSERT().\r
b91d5eca 27 If TargetStatus is NULL, then ASSERT().\r
28\r
d658727b
FT
29 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
30 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
31 gets returned.\r
d5954c61 32\r
33 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r
34 for the specific SCSI target.\r
35 @param[in] Timeout The timeout in 100 ns units to use for the execution\r
36 of this SCSI Request Packet. A Timeout value of\r
37 zero means that this function will wait indefinitely\r
38 for the SCSI Request Packet to execute. If Timeout\r
39 is greater than zero, then this function will return\r
40 EFI_TIMEOUT if the time required to execute the SCSI\r
41 Request Packet is greater than Timeout.\r
42 @param[in, out] SenseData A pointer to sense data that was generated by\r
43 the execution of the SCSI Request Packet. This\r
44 buffer must be allocated by the caller.\r
45 If SenseDataLength is 0, then this parameter is\r
46 optional and may be NULL.\r
47 @param[in, out] SenseDataLength On input, a pointer to the length in bytes of\r
9638ba6d 48 the SenseData buffer. On output, a pointer to\r
9095d37b 49 the number of bytes written to the SenseData buffer.\r
d5954c61 50 @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces\r
51 the SCSI bus containing the SCSI target specified by\r
52 ScsiIo when the SCSI Request Packet was executed.\r
53 See the EFI SCSI I/O Protocol in the UEFI Specification\r
54 for details on the possible return values.\r
55 @param[out] TargetStatus The status returned by the SCSI target specified\r
9638ba6d 56 by ScsiIo when the SCSI Request Packet was executed\r
d5954c61 57 on the SCSI Host Controller. See the EFI SCSI I/O\r
58 Protocol in the UEFI Specification for details on\r
9095d37b 59 the possible return values.\r
d5954c61 60\r
d658727b
FT
61 @retval EFI_SUCCESS The command was executed successfully.\r
62 See HostAdapterStatus, TargetStatus, SenseDataLength,\r
63 and SenseData in that order for additional status\r
64 information.\r
65 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
66 there are too many SCSI Command Packets already\r
67 queued. The SCSI Request Packet was not sent, so\r
68 no additional status information is available.\r
69 The caller may retry again later.\r
70 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r
71 SCSI Request Packet. See HostAdapterStatus,\r
72 TargetStatus, SenseDataLength, and SenseData in that\r
73 order for additional status information.\r
74 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
75 is not supported by the SCSI initiator(i.e., SCSI\r
76 Host Controller). The SCSI Request Packet was not\r
77 sent, so no additional status information is available.\r
78 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r
79 Packet to execute. See HostAdapterStatus, TargetStatus,\r
80 SenseDataLength, and SenseData in that order for\r
81 additional status information.\r
82 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
fc30687f 83\r
bf231ea6 84**/\r
fb3df220 85EFI_STATUS\r
373b5cf9 86EFIAPI\r
d35be2a4 87ScsiTestUnitReadyCommand (\r
d5954c61 88 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
89 IN UINT64 Timeout,\r
90 IN OUT VOID *SenseData, OPTIONAL\r
91 IN OUT UINT8 *SenseDataLength,\r
92 OUT UINT8 *HostAdapterStatus,\r
93 OUT UINT8 *TargetStatus\r
bf231ea6
A
94 );\r
95\r
96\r
fc30687f 97/**\r
d5954c61 98 Execute Inquiry SCSI command on a specific SCSI target.\r
b91d5eca 99\r
d5954c61 100 Executes the Inquiry command on the SCSI target specified by ScsiIo.\r
101 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
102 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r
103 If ScsiIo is NULL, then ASSERT().\r
b91d5eca 104 If SenseDataLength is NULL, then ASSERT().\r
b91d5eca 105 If HostAdapterStatus is NULL, then ASSERT().\r
b91d5eca 106 If TargetStatus is NULL, then ASSERT().\r
b91d5eca 107 If InquiryDataLength is NULL, then ASSERT().\r
108\r
d658727b
FT
109 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
110 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
111 gets returned.\r
112\r
113 If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer\r
114 must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
115 EFI_INVALID_PARAMETER gets returned.\r
116\r
d5954c61 117 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r
118 for the specific SCSI target.\r
119 @param[in] Timeout The timeout in 100 ns units to use for the\r
120 execution of this SCSI Request Packet. A Timeout\r
121 value of zero means that this function will wait\r
122 indefinitely for the SCSI Request Packet to execute.\r
123 If Timeout is greater than zero, then this function\r
124 will return EFI_TIMEOUT if the time required to\r
125 execute the SCSI Request Packet is greater than Timeout.\r
126 @param[in, out] SenseData A pointer to sense data that was generated\r
127 by the execution of the SCSI Request Packet.\r
128 This buffer must be allocated by the caller.\r
129 If SenseDataLength is 0, then this parameter\r
130 is optional and may be NULL.\r
131 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r
9095d37b 132 On output, the number of bytes written to the SenseData buffer.\r
d5954c61 133 @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r
134 produces the SCSI bus containing the SCSI\r
135 target specified by ScsiIo when the SCSI\r
136 Request Packet was executed. See the EFI\r
137 SCSI I/O Protocol in the UEFI Specification\r
138 for details on the possible return values.\r
139 @param[out] TargetStatus The status returned by the SCSI target specified\r
9638ba6d 140 by ScsiIo when the SCSI Request Packet was\r
d5954c61 141 executed on the SCSI Host Controller.\r
142 See the EFI SCSI I/O Protocol in the UEFI\r
143 Specification for details on the possible\r
9095d37b 144 return values.\r
d5954c61 145 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r
146 by the execution of the SCSI Request Packet.\r
147 This buffer must be allocated by the caller.\r
148 If InquiryDataLength is 0, then this parameter\r
9095d37b 149 is optional and may be NULL.\r
d5954c61 150 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r
151 of the InquiryDataBuffer buffer.\r
152 On output, a pointer to the number of bytes\r
153 written to the InquiryDataBuffer buffer.\r
154 @param[in] EnableVitalProductData If TRUE, then the supported vital product\r
155 data is returned in InquiryDataBuffer.\r
156 If FALSE, then the standard inquiry data is\r
9095d37b 157 returned in InquiryDataBuffer.\r
d5954c61 158\r
d658727b
FT
159 @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,\r
160 TargetStatus, SenseDataLength, and SenseData in that order\r
161 for additional status information.\r
162 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r
163 InquiryDataBuffer could not be transferred. The actual\r
164 number of bytes transferred is returned in InquiryDataLength.\r
165 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r
166 are too many SCSI Command Packets already queued.\r
167 The SCSI Request Packet was not sent, so no additional\r
168 status information is available. The caller may retry again later.\r
169 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r
170 Request Packet. See HostAdapterStatus, TargetStatus,\r
171 SenseDataLength, and SenseData in that order for additional\r
172 status information.\r
173 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r
174 supported by the SCSI initiator(i.e., SCSI Host Controller).\r
175 The SCSI Request Packet was not sent, so no additional\r
176 status information is available.\r
177 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r
178 Packet to execute. See HostAdapterStatus, TargetStatus,\r
179 SenseDataLength, and SenseData in that order for\r
180 additional status information.\r
181 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
fc30687f 182\r
bf231ea6 183**/\r
fb3df220 184EFI_STATUS\r
373b5cf9 185EFIAPI\r
d35be2a4 186ScsiInquiryCommand (\r
d5954c61 187 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
188 IN UINT64 Timeout,\r
189 IN OUT VOID *SenseData, OPTIONAL\r
190 IN OUT UINT8 *SenseDataLength,\r
191 OUT UINT8 *HostAdapterStatus,\r
192 OUT UINT8 *TargetStatus,\r
193 IN OUT VOID *InquiryDataBuffer, OPTIONAL\r
194 IN OUT UINT32 *InquiryDataLength,\r
195 IN BOOLEAN EnableVitalProductData\r
bf231ea6
A
196 );\r
197\r
198\r
b8a62661
RN
199/**\r
200 Execute Inquiry SCSI command on a specific SCSI target.\r
201\r
202 Executes the Inquiry command on the SCSI target specified by ScsiIo.\r
203 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
204 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r
205 If ScsiIo is NULL, then ASSERT().\r
206 If SenseDataLength is NULL, then ASSERT().\r
207 If HostAdapterStatus is NULL, then ASSERT().\r
208 If TargetStatus is NULL, then ASSERT().\r
209 If InquiryDataLength is NULL, then ASSERT().\r
210\r
d658727b
FT
211 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
212 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
213 gets returned.\r
214\r
215 If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer\r
216 must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
217 EFI_INVALID_PARAMETER gets returned.\r
218\r
b8a62661
RN
219 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r
220 for the specific SCSI target.\r
221 @param[in] Timeout The timeout in 100 ns units to use for the\r
222 execution of this SCSI Request Packet. A Timeout\r
223 value of zero means that this function will wait\r
224 indefinitely for the SCSI Request Packet to execute.\r
225 If Timeout is greater than zero, then this function\r
226 will return EFI_TIMEOUT if the time required to\r
227 execute the SCSI Request Packet is greater than Timeout.\r
228 @param[in, out] SenseData A pointer to sense data that was generated\r
229 by the execution of the SCSI Request Packet.\r
230 This buffer must be allocated by the caller.\r
231 If SenseDataLength is 0, then this parameter\r
232 is optional and may be NULL.\r
233 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r
9095d37b 234 On output, the number of bytes written to the SenseData buffer.\r
b8a62661
RN
235 @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r
236 produces the SCSI bus containing the SCSI\r
237 target specified by ScsiIo when the SCSI\r
238 Request Packet was executed. See the EFI\r
239 SCSI I/O Protocol in the UEFI Specification\r
240 for details on the possible return values.\r
241 @param[out] TargetStatus The status returned by the SCSI target specified\r
242 by ScsiIo when the SCSI Request Packet was\r
243 executed on the SCSI Host Controller.\r
244 See the EFI SCSI I/O Protocol in the UEFI\r
245 Specification for details on the possible\r
9095d37b 246 return values.\r
b8a62661
RN
247 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r
248 by the execution of the SCSI Request Packet.\r
249 This buffer must be allocated by the caller.\r
250 If InquiryDataLength is 0, then this parameter\r
9095d37b 251 is optional and may be NULL.\r
b8a62661
RN
252 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r
253 of the InquiryDataBuffer buffer.\r
254 On output, a pointer to the number of bytes\r
255 written to the InquiryDataBuffer buffer.\r
256 @param[in] EnableVitalProductData If TRUE, then the supported vital product\r
257 data for the PageCode is returned in InquiryDataBuffer.\r
258 If FALSE, then the standard inquiry data is\r
259 returned in InquiryDataBuffer and PageCode is ignored.\r
260 @param[in] PageCode The page code of the vital product data.\r
261 It's ignored if EnableVitalProductData is FALSE.\r
262\r
d658727b
FT
263 @retval EFI_SUCCESS The command executed successfully. See HostAdapterStatus,\r
264 TargetStatus, SenseDataLength, and SenseData in that order\r
265 for additional status information.\r
266 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r
267 InquiryDataBuffer could not be transferred. The actual\r
268 number of bytes transferred is returned in InquiryDataLength.\r
269 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r
270 are too many SCSI Command Packets already queued.\r
271 The SCSI Request Packet was not sent, so no additional\r
272 status information is available. The caller may retry again later.\r
273 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r
274 Request Packet. See HostAdapterStatus, TargetStatus,\r
275 SenseDataLength, and SenseData in that order for additional\r
276 status information.\r
277 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r
278 supported by the SCSI initiator(i.e., SCSI Host Controller).\r
279 The SCSI Request Packet was not sent, so no additional\r
280 status information is available.\r
281 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r
282 Packet to execute. See HostAdapterStatus, TargetStatus,\r
283 SenseDataLength, and SenseData in that order for\r
284 additional status information.\r
285 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
b8a62661
RN
286\r
287**/\r
288EFI_STATUS\r
289EFIAPI\r
290ScsiInquiryCommandEx (\r
291 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
292 IN UINT64 Timeout,\r
293 IN OUT VOID *SenseData, OPTIONAL\r
294 IN OUT UINT8 *SenseDataLength,\r
295 OUT UINT8 *HostAdapterStatus,\r
296 OUT UINT8 *TargetStatus,\r
297 IN OUT VOID *InquiryDataBuffer, OPTIONAL\r
298 IN OUT UINT32 *InquiryDataLength,\r
299 IN BOOLEAN EnableVitalProductData,\r
300 IN UINT8 PageCode\r
301 );\r
302\r
303\r
fc30687f 304/**\r
d5954c61 305 Execute Mode Sense(10) SCSI command on a specific SCSI target.\r
306\r
307 Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.\r
308 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
309 If Timeout is greater than zero, then the command is executed and will timeout\r
310 after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters\r
311 are used to construct the CDB for this SCSI command.\r
312 If ScsiIo is NULL, then ASSERT().\r
b91d5eca 313 If SenseDataLength is NULL, then ASSERT().\r
b91d5eca 314 If HostAdapterStatus is NULL, then ASSERT().\r
b91d5eca 315 If TargetStatus is NULL, then ASSERT().\r
b91d5eca 316 If DataLength is NULL, then ASSERT().\r
317\r
d658727b
FT
318 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
319 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
320 gets returned.\r
321\r
322 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
323 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
324 gets returned.\r
d5954c61 325\r
326 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r
327 for the specific SCSI target.\r
328 @param[in] Timeout The timeout in 100 ns units to use for the\r
329 execution of this SCSI Request Packet. A Timeout\r
330 value of zero means that this function will wait\r
331 indefinitely for the SCSI Request Packet to execute.\r
332 If Timeout is greater than zero, then this function\r
333 will return EFI_TIMEOUT if the time required to\r
334 execute the SCSI Request Packet is greater than Timeout.\r
adde977a 335 @param[in, out] SenseData A pointer to sense data that was generated\r
d5954c61 336 by the execution of the SCSI Request Packet.\r
337 This buffer must be allocated by the caller.\r
338 If SenseDataLength is 0, then this parameter\r
339 is optional and may be NULL.\r
adde977a 340 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r
9095d37b 341 On output, the number of bytes written to the SenseData buffer.\r
d5954c61 342 @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r
343 produces the SCSI bus containing the SCSI target\r
344 specified by ScsiIo when the SCSI Request Packet\r
345 was executed. See the EFI SCSI I/O Protocol in the\r
346 UEFI Specification for details on the possible\r
347 return values.\r
348 @param[out] TargetStatus The status returned by the SCSI target specified\r
9638ba6d 349 by ScsiIo when the SCSI Request Packet was executed\r
d5954c61 350 on the SCSI Host Controller. See the EFI SCSI\r
351 I/O Protocol in the UEFI Specification for details\r
352 on the possible return values.\r
adde977a 353 @param[in, out] DataBuffer A pointer to data that was generated by the\r
d5954c61 354 execution of the SCSI Request Packet. This\r
355 buffer must be allocated by the caller. If\r
356 DataLength is 0, then this parameter is optional\r
9095d37b 357 and may be NULL.\r
adde977a 358 @param[in, out] DataLength On input, a pointer to the length in bytes of\r
d5954c61 359 the DataBuffer buffer. On output, a pointer\r
360 to the number of bytes written to the DataBuffer\r
9095d37b 361 buffer.\r
d5954c61 362 @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r
9095d37b
LG
363 @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command.\r
364 @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command.\r
d5954c61 365\r
d658727b
FT
366 @retval EFI_SUCCESS The command was executed successfully.\r
367 See HostAdapterStatus, TargetStatus, SenseDataLength,\r
368 and SenseData in that order for additional status information.\r
369 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the\r
370 entire DataBuffer could not be transferred.\r
371 The actual number of bytes transferred is returned\r
372 in DataLength.\r
373 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
374 there are too many SCSI Command Packets already queued.\r
375 The SCSI Request Packet was not sent, so no additional\r
376 status information is available. The caller may retry\r
377 again later.\r
378 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r
379 SCSI Request Packet. See HostAdapterStatus, TargetStatus,\r
380 SenseDataLength, and SenseData in that order for\r
381 additional status information.\r
382 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
383 is not supported by the SCSI initiator(i.e., SCSI\r
384 Host Controller). The SCSI Request Packet was not\r
385 sent, so no additional status information is available.\r
386 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r
387 Request Packet to execute. See HostAdapterStatus,\r
388 TargetStatus, SenseDataLength, and SenseData in that\r
389 order for additional status information.\r
390 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
fc30687f 391\r
bf231ea6 392**/\r
fb3df220 393EFI_STATUS\r
373b5cf9 394EFIAPI\r
d35be2a4 395ScsiModeSense10Command (\r
d5954c61 396 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
397 IN UINT64 Timeout,\r
398 IN OUT VOID *SenseData, OPTIONAL\r
399 IN OUT UINT8 *SenseDataLength,\r
400 OUT UINT8 *HostAdapterStatus,\r
401 OUT UINT8 *TargetStatus,\r
402 IN OUT VOID *DataBuffer, OPTIONAL\r
403 IN OUT UINT32 *DataLength,\r
404 IN UINT8 DBDField, OPTIONAL\r
405 IN UINT8 PageControl,\r
406 IN UINT8 PageCode\r
bf231ea6
A
407 );\r
408\r
409\r
410\r
fc30687f 411/**\r
d5954c61 412 Execute Request Sense SCSI command on a specific SCSI target.\r
b91d5eca 413\r
d5954c61 414 Executes the Request Sense command on the SCSI target specified by ScsiIo.\r
415 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
416 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r
417 If ScsiIo is NULL, then ASSERT().\r
b91d5eca 418 If SenseDataLength is NULL, then ASSERT().\r
b91d5eca 419 If HostAdapterStatus is NULL, then ASSERT().\r
b91d5eca 420 If TargetStatus is NULL, then ASSERT().\r
421\r
d658727b
FT
422 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
423 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
424 gets returned.\r
425\r
b91d5eca 426 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
427 @param[in] Timeout The length of timeout period.\r
d5954c61 428 @param[in, out] SenseData A pointer to output sense data.\r
429 @param[in, out] SenseDataLength The length of output sense data.\r
b91d5eca 430 @param[out] HostAdapterStatus The status of Host Adapter.\r
431 @param[out] TargetStatus The status of the target.\r
432\r
433 @retval EFI_SUCCESS Command is executed successfully.\r
434 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are\r
435 too many SCSI Command Packets already queued.\r
436 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
437 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
438 the SCSI initiator(i.e., SCSI Host Controller)\r
439 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
d658727b 440 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
fc30687f 441\r
bf231ea6 442**/\r
fb3df220 443EFI_STATUS\r
373b5cf9 444EFIAPI\r
d35be2a4 445ScsiRequestSenseCommand (\r
d5954c61 446 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
447 IN UINT64 Timeout,\r
448 IN OUT VOID *SenseData, OPTIONAL\r
449 IN OUT UINT8 *SenseDataLength,\r
450 OUT UINT8 *HostAdapterStatus,\r
451 OUT UINT8 *TargetStatus\r
bf231ea6
A
452 );\r
453\r
454\r
fc30687f 455/**\r
d5954c61 456 Execute Read Capacity SCSI command on a specific SCSI target.\r
b91d5eca 457\r
d5954c61 458 Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r
459 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
460 If Timeout is greater than zero, then the command is executed and will timeout after\r
51969ecb 461 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r
d5954c61 462 If ScsiIo is NULL, then ASSERT().\r
b91d5eca 463 If SenseDataLength is NULL, then ASSERT().\r
b91d5eca 464 If HostAdapterStatus is NULL, then ASSERT().\r
b91d5eca 465 If TargetStatus is NULL, then ASSERT().\r
b91d5eca 466 If DataLength is NULL, then ASSERT().\r
467\r
d658727b
FT
468 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
469 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
470 gets returned.\r
471\r
472 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
473 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
474 gets returned.\r
475\r
d5954c61 476 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
477 @param[in] Timeout The length of timeout period.\r
478 @param[in, out] SenseData A pointer to output sense data.\r
6053411e 479 @param[in, out] SenseDataLength The length of output sense data.\r
d5954c61 480 @param[out] HostAdapterStatus The status of Host Adapter.\r
481 @param[out] TargetStatus The status of the target.\r
482 @param[in, out] DataBuffer A pointer to a data buffer.\r
6053411e 483 @param[in, out] DataLength The length of data buffer.\r
51969ecb 484 @param[in] Pmi Partial medium indicator.\r
b91d5eca 485\r
d658727b
FT
486 @retval EFI_SUCCESS Command is executed successfully.\r
487 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r
488 DataBuffer could not be transferred. The actual\r
489 number of bytes transferred is returned in DataLength.\r
490 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
491 there are too many SCSI Command Packets already queued.\r
492 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
493 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
494 is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r
495 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
496 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
fc30687f 497\r
bf231ea6 498**/\r
fb3df220 499EFI_STATUS\r
9199040c 500EFIAPI\r
d35be2a4 501ScsiReadCapacityCommand (\r
d5954c61 502 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
503 IN UINT64 Timeout,\r
504 IN OUT VOID *SenseData, OPTIONAL\r
505 IN OUT UINT8 *SenseDataLength,\r
506 OUT UINT8 *HostAdapterStatus,\r
507 OUT UINT8 *TargetStatus,\r
508 IN OUT VOID *DataBuffer, OPTIONAL\r
509 IN OUT UINT32 *DataLength,\r
51969ecb 510 IN BOOLEAN Pmi\r
bf231ea6
A
511 );\r
512\r
513\r
ccb491c8 514/**\r
5e11e7c6 515 Execute Read Capacity SCSI 16 command on a specific SCSI target.\r
516\r
517 Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.\r
518 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
519 If Timeout is greater than zero, then the command is executed and will timeout after\r
520 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r
521 If ScsiIo is NULL, then ASSERT().\r
522 If SenseDataLength is NULL, then ASSERT().\r
523 If HostAdapterStatus is NULL, then ASSERT().\r
524 If TargetStatus is NULL, then ASSERT().\r
525 If DataLength is NULL, then ASSERT().\r
526\r
d658727b
FT
527 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
528 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
529 gets returned.\r
530\r
531 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
532 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
533 gets returned.\r
534\r
5e11e7c6 535 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
536 @param[in] Timeout The length of timeout period.\r
537 @param[in, out] SenseData A pointer to output sense data.\r
538 @param[in, out] SenseDataLength The length of output sense data.\r
539 @param[out] HostAdapterStatus The status of Host Adapter.\r
540 @param[out] TargetStatus The status of the target.\r
541 @param[in, out] DataBuffer A pointer to a data buffer.\r
542 @param[in, out] DataLength The length of data buffer.\r
543 @param[in] Pmi Partial medium indicator.\r
544\r
d658727b
FT
545 @retval EFI_SUCCESS Command is executed successfully.\r
546 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r
547 DataBuffer could not be transferred. The actual\r
548 number of bytes transferred is returned in DataLength.\r
549 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
550 there are too many SCSI Command Packets already queued.\r
551 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
552 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
553 is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r
554 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
555 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
ccb491c8 556\r
557**/\r
ccb491c8 558EFI_STATUS\r
559EFIAPI\r
560ScsiReadCapacity16Command (\r
f158ee67 561 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
562 IN UINT64 Timeout,\r
563 IN OUT VOID *SenseData, OPTIONAL\r
564 IN OUT UINT8 *SenseDataLength,\r
565 OUT UINT8 *HostAdapterStatus,\r
566 OUT UINT8 *TargetStatus,\r
567 IN OUT VOID *DataBuffer, OPTIONAL\r
568 IN OUT UINT32 *DataLength,\r
569 IN BOOLEAN Pmi\r
ccb491c8 570 );\r
571\r
572\r
fc30687f 573/**\r
d5954c61 574 Execute Read(10) SCSI command on a specific SCSI target.\r
575\r
576 Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r
577 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
578 If Timeout is greater than zero, then the command is executed and will timeout\r
579 after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r
580 construct the CDB for this SCSI command.\r
581 If ScsiIo is NULL, then ASSERT().\r
b91d5eca 582 If SenseDataLength is NULL, then ASSERT().\r
b91d5eca 583 If HostAdapterStatus is NULL, then ASSERT().\r
b91d5eca 584 If TargetStatus is NULL, then ASSERT().\r
b91d5eca 585 If DataLength is NULL, then ASSERT().\r
586\r
d658727b
FT
587 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
588 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
589 gets returned.\r
590\r
591 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
592 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
593 gets returned.\r
d5954c61 594\r
595 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
596 @param[in] Timeout The length of timeout period.\r
597 @param[in, out] SenseData A pointer to output sense data.\r
6053411e 598 @param[in, out] SenseDataLength The length of output sense data.\r
d5954c61 599 @param[out] HostAdapterStatus The status of Host Adapter.\r
600 @param[out] TargetStatus The status of the target.\r
601 @param[in, out] DataBuffer Read 10 command data.\r
6053411e 602 @param[in, out] DataLength The length of data buffer.\r
d5954c61 603 @param[in] StartLba The start address of LBA.\r
b95eb5e0 604 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
b91d5eca 605\r
d658727b
FT
606 @retval EFI_SUCCESS Command is executed successfully.\r
607 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
608 not be transferred. The actual number of bytes transferred is returned in DataLength.\r
609 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r
610 SCSI Command Packets already queued.\r
611 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
612 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
613 the SCSI initiator(i.e., SCSI Host Controller)\r
614 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
615 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
fc30687f 616\r
bf231ea6 617**/\r
fb3df220 618EFI_STATUS\r
373b5cf9 619EFIAPI\r
d35be2a4 620ScsiRead10Command (\r
d5954c61 621 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
622 IN UINT64 Timeout,\r
623 IN OUT VOID *SenseData, OPTIONAL\r
624 IN OUT UINT8 *SenseDataLength,\r
625 OUT UINT8 *HostAdapterStatus,\r
626 OUT UINT8 *TargetStatus,\r
627 IN OUT VOID *DataBuffer, OPTIONAL\r
628 IN OUT UINT32 *DataLength,\r
629 IN UINT32 StartLba,\r
630 IN UINT32 SectorSize\r
bf231ea6
A
631 );\r
632\r
633\r
fc30687f 634/**\r
d5954c61 635 Execute Write(10) SCSI command on a specific SCSI target.\r
636\r
637 Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r
638 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
639 If Timeout is greater than zero, then the command is executed and will timeout after\r
640 Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r
641 the CDB for this SCSI command.\r
642 If ScsiIo is NULL, then ASSERT().\r
b91d5eca 643 If SenseDataLength is NULL, then ASSERT().\r
b91d5eca 644 If HostAdapterStatus is NULL, then ASSERT().\r
b91d5eca 645 If TargetStatus is NULL, then ASSERT().\r
b91d5eca 646 If DataLength is NULL, then ASSERT().\r
647\r
d658727b
FT
648 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
649 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
650 gets returned.\r
651\r
652 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
653 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
654 gets returned.\r
655\r
d5954c61 656 @param[in] ScsiIo SCSI IO Protocol to use\r
657 @param[in] Timeout The length of timeout period.\r
658 @param[in, out] SenseData A pointer to output sense data.\r
6053411e 659 @param[in, out] SenseDataLength The length of output sense data.\r
d5954c61 660 @param[out] HostAdapterStatus The status of Host Adapter.\r
661 @param[out] TargetStatus The status of the target.\r
662 @param[in, out] DataBuffer A pointer to a data buffer.\r
6053411e 663 @param[in, out] DataLength The length of data buffer.\r
d5954c61 664 @param[in] StartLba The start address of LBA.\r
b95eb5e0 665 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
b91d5eca 666\r
d658727b
FT
667 @retval EFI_SUCCESS Command is executed successfully.\r
668 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
669 not be transferred. The actual number of bytes transferred is returned in DataLength.\r
670 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r
671 SCSI Command Packets already queued.\r
672 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
673 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
674 the SCSI initiator(i.e., SCSI Host Controller)\r
675 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
676 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
fc30687f 677\r
bf231ea6 678**/\r
fb3df220 679EFI_STATUS\r
373b5cf9 680EFIAPI\r
d35be2a4 681ScsiWrite10Command (\r
d5954c61 682 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
683 IN UINT64 Timeout,\r
684 IN OUT VOID *SenseData, OPTIONAL\r
685 IN OUT UINT8 *SenseDataLength,\r
686 OUT UINT8 *HostAdapterStatus,\r
687 OUT UINT8 *TargetStatus,\r
688 IN OUT VOID *DataBuffer, OPTIONAL\r
689 IN OUT UINT32 *DataLength,\r
690 IN UINT32 StartLba,\r
691 IN UINT32 SectorSize\r
bf231ea6 692 );\r
fb3df220 693\r
a24faca3 694/**\r
695 Execute Read(16) SCSI command on a specific SCSI target.\r
696\r
697 Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.\r
698 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
699 If Timeout is greater than zero, then the command is executed and will timeout\r
700 after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r
701 construct the CDB for this SCSI command.\r
702 If ScsiIo is NULL, then ASSERT().\r
703 If SenseDataLength is NULL, then ASSERT().\r
704 If HostAdapterStatus is NULL, then ASSERT().\r
705 If TargetStatus is NULL, then ASSERT().\r
706 If DataLength is NULL, then ASSERT().\r
707\r
d658727b
FT
708 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
709 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
710 gets returned.\r
711\r
712 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
713 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
714 gets returned.\r
a24faca3 715\r
716 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
717 @param[in] Timeout The length of timeout period.\r
718 @param[in, out] SenseData A pointer to output sense data.\r
719 @param[in, out] SenseDataLength The length of output sense data.\r
720 @param[out] HostAdapterStatus The status of Host Adapter.\r
721 @param[out] TargetStatus The status of the target.\r
722 @param[in, out] DataBuffer Read 16 command data.\r
723 @param[in, out] DataLength The length of data buffer.\r
724 @param[in] StartLba The start address of LBA.\r
b95eb5e0 725 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
a24faca3 726\r
d658727b
FT
727 @retval EFI_SUCCESS Command is executed successfully.\r
728 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
729 not be transferred. The actual number of bytes transferred is returned in DataLength.\r
730 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r
731 SCSI Command Packets already queued.\r
732 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
733 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
734 the SCSI initiator(i.e., SCSI Host Controller)\r
735 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
736 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
a24faca3 737\r
738**/\r
739EFI_STATUS\r
740EFIAPI\r
741ScsiRead16Command (\r
742 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
743 IN UINT64 Timeout,\r
744 IN OUT VOID *SenseData, OPTIONAL\r
745 IN OUT UINT8 *SenseDataLength,\r
746 OUT UINT8 *HostAdapterStatus,\r
747 OUT UINT8 *TargetStatus,\r
748 IN OUT VOID *DataBuffer, OPTIONAL\r
749 IN OUT UINT32 *DataLength,\r
750 IN UINT64 StartLba,\r
751 IN UINT32 SectorSize\r
752 );\r
753\r
754\r
755/**\r
756 Execute Write(16) SCSI command on a specific SCSI target.\r
757\r
758 Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.\r
759 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
760 If Timeout is greater than zero, then the command is executed and will timeout after\r
761 Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r
762 the CDB for this SCSI command.\r
763 If ScsiIo is NULL, then ASSERT().\r
764 If SenseDataLength is NULL, then ASSERT().\r
765 If HostAdapterStatus is NULL, then ASSERT().\r
766 If TargetStatus is NULL, then ASSERT().\r
767 If DataLength is NULL, then ASSERT().\r
768\r
d658727b
FT
769 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
770 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
771 gets returned.\r
772\r
773 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
774 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
775 gets returned.\r
776\r
a24faca3 777 @param[in] ScsiIo SCSI IO Protocol to use\r
778 @param[in] Timeout The length of timeout period.\r
779 @param[in, out] SenseData A pointer to output sense data.\r
780 @param[in, out] SenseDataLength The length of output sense data.\r
781 @param[out] HostAdapterStatus The status of Host Adapter.\r
782 @param[out] TargetStatus The status of the target.\r
783 @param[in, out] DataBuffer A pointer to a data buffer.\r
784 @param[in, out] DataLength The length of data buffer.\r
785 @param[in] StartLba The start address of LBA.\r
b95eb5e0 786 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
a24faca3 787\r
d658727b
FT
788 @retval EFI_SUCCESS Command is executed successfully.\r
789 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
790 not be transferred. The actual number of bytes transferred is returned in DataLength.\r
791 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r
792 SCSI Command Packets already queued.\r
793 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
794 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
795 the SCSI initiator(i.e., SCSI Host Controller)\r
796 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
797 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
a24faca3 798\r
799**/\r
800EFI_STATUS\r
801EFIAPI\r
802ScsiWrite16Command (\r
803 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
804 IN UINT64 Timeout,\r
805 IN OUT VOID *SenseData, OPTIONAL\r
806 IN OUT UINT8 *SenseDataLength,\r
807 OUT UINT8 *HostAdapterStatus,\r
808 OUT UINT8 *TargetStatus,\r
809 IN OUT VOID *DataBuffer, OPTIONAL\r
810 IN OUT UINT32 *DataLength,\r
811 IN UINT64 StartLba,\r
812 IN UINT32 SectorSize\r
813 );\r
fb3df220 814\r
9c581939
HW
815\r
816/**\r
817 Execute blocking/non-blocking Read(10) SCSI command on a specific SCSI\r
818 target.\r
819\r
820 Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r
821 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
822 command will be executed.\r
823 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
824 for the command to complete. If Timeout is greater than zero, then the\r
825 command is executed and will timeout after Timeout 100 ns units.\r
826 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
827 the command to completes. If Timeout is greater than zero, Event will also be\r
828 signaled after Timeout 100 ns units.\r
829 The StartLba and SectorSize parameters are used to construct the CDB for this\r
830 SCSI command.\r
831\r
832 If ScsiIo is NULL, then ASSERT().\r
833 If SenseDataLength is NULL, then ASSERT().\r
834 If HostAdapterStatus is NULL, then ASSERT().\r
835 If TargetStatus is NULL, then ASSERT().\r
836 If DataLength is NULL, then ASSERT().\r
837\r
838 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
839 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
840 EFI_INVALID_PARAMETER gets returned.\r
841\r
842 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
843 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
844 EFI_INVALID_PARAMETER gets returned.\r
845\r
846 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
847 @param[in] Timeout The length of timeout period.\r
848 @param[in, out] SenseData A pointer to output sense data.\r
849 @param[in, out] SenseDataLength The length of output sense data.\r
850 @param[out] HostAdapterStatus The status of Host Adapter.\r
851 @param[out] TargetStatus The status of the target.\r
852 @param[in, out] DataBuffer Read 16 command data.\r
853 @param[in, out] DataLength The length of data buffer.\r
854 @param[in] StartLba The start address of LBA.\r
855 @param[in] SectorSize The number of contiguous logical blocks\r
856 of data that shall be transferred.\r
857 @param[in] Event If the SCSI target does not support\r
858 non-blocking I/O, then Event is ignored,\r
859 and blocking I/O is performed. If Event\r
860 is NULL, then blocking I/O is performed.\r
861 If Event is not NULL and non-blocking\r
862 I/O is supported, then non-blocking I/O\r
863 is performed, and Event will be signaled\r
864 when the SCSI Read(10) command\r
865 completes.\r
866\r
867 @retval EFI_SUCCESS Command is executed successfully.\r
868 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
869 but the entire DataBuffer could not be\r
870 transferred. The actual number of bytes\r
871 transferred is returned in DataLength.\r
872 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
873 sent because there are too many SCSI\r
874 Command Packets already queued.\r
875 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
876 to send SCSI Request Packet.\r
877 @retval EFI_UNSUPPORTED The command described by the SCSI\r
878 Request Packet is not supported by the\r
879 SCSI initiator(i.e., SCSI Host\r
880 Controller)\r
881 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
882 SCSI Request Packet to execute.\r
883 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
884 are invalid.\r
885 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
886 to a lack of resources.\r
887\r
888**/\r
889EFI_STATUS\r
890EFIAPI\r
891ScsiRead10CommandEx (\r
892 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
893 IN UINT64 Timeout,\r
894 IN OUT VOID *SenseData, OPTIONAL\r
895 IN OUT UINT8 *SenseDataLength,\r
896 OUT UINT8 *HostAdapterStatus,\r
897 OUT UINT8 *TargetStatus,\r
898 IN OUT VOID *DataBuffer, OPTIONAL\r
899 IN OUT UINT32 *DataLength,\r
900 IN UINT32 StartLba,\r
901 IN UINT32 SectorSize,\r
902 IN EFI_EVENT Event OPTIONAL\r
903 );\r
904\r
905\r
906/**\r
907 Execute blocking/non-blocking Write(10) SCSI command on a specific SCSI\r
908 target.\r
909\r
910 Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r
911 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
912 command will be executed.\r
913 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
914 for the command to complete. If Timeout is greater than zero, then the\r
915 command is executed and will timeout after Timeout 100 ns units.\r
916 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
917 the command to completes. If Timeout is greater than zero, Event will also be\r
918 signaled after Timeout 100 ns units.\r
919 The StartLba and SectorSize parameters are used to construct the CDB for this\r
920 SCSI command.\r
921\r
922 If ScsiIo is NULL, then ASSERT().\r
923 If SenseDataLength is NULL, then ASSERT().\r
924 If HostAdapterStatus is NULL, then ASSERT().\r
925 If TargetStatus is NULL, then ASSERT().\r
926 If DataLength is NULL, then ASSERT().\r
927\r
928 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
929 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
930 EFI_INVALID_PARAMETER gets returned.\r
931\r
932 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
933 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
934 EFI_INVALID_PARAMETER gets returned.\r
935\r
936 @param[in] ScsiIo SCSI IO Protocol to use\r
937 @param[in] Timeout The length of timeout period.\r
938 @param[in, out] SenseData A pointer to output sense data.\r
939 @param[in, out] SenseDataLength The length of output sense data.\r
940 @param[out] HostAdapterStatus The status of Host Adapter.\r
941 @param[out] TargetStatus The status of the target.\r
942 @param[in, out] DataBuffer A pointer to a data buffer.\r
943 @param[in, out] DataLength The length of data buffer.\r
944 @param[in] StartLba The start address of LBA.\r
945 @param[in] SectorSize The number of contiguous logical blocks\r
946 of data that shall be transferred.\r
947 @param[in] Event If the SCSI target does not support\r
948 non-blocking I/O, then Event is ignored,\r
949 and blocking I/O is performed. If Event\r
950 is NULL, then blocking I/O is performed.\r
951 If Event is not NULL and non-blocking\r
952 I/O is supported, then non-blocking I/O\r
953 is performed, and Event will be signaled\r
954 when the SCSI Write(10) command\r
955 completes.\r
956\r
957 @retval EFI_SUCCESS Command is executed successfully.\r
958 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
959 but the entire DataBuffer could not be\r
960 transferred. The actual number of bytes\r
961 transferred is returned in DataLength.\r
962 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
963 sent because there are too many SCSI\r
964 Command Packets already queued.\r
965 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
966 to send SCSI Request Packet.\r
967 @retval EFI_UNSUPPORTED The command described by the SCSI\r
968 Request Packet is not supported by the\r
969 SCSI initiator(i.e., SCSI Host\r
970 Controller)\r
971 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
972 SCSI Request Packet to execute.\r
973 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
974 are invalid.\r
975 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
976 to a lack of resources.\r
977\r
978**/\r
979EFI_STATUS\r
980EFIAPI\r
981ScsiWrite10CommandEx (\r
982 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
983 IN UINT64 Timeout,\r
984 IN OUT VOID *SenseData, OPTIONAL\r
985 IN OUT UINT8 *SenseDataLength,\r
986 OUT UINT8 *HostAdapterStatus,\r
987 OUT UINT8 *TargetStatus,\r
988 IN OUT VOID *DataBuffer, OPTIONAL\r
989 IN OUT UINT32 *DataLength,\r
990 IN UINT32 StartLba,\r
991 IN UINT32 SectorSize,\r
992 IN EFI_EVENT Event OPTIONAL\r
993 );\r
994\r
995\r
996/**\r
997 Execute blocking/non-blocking Read(16) SCSI command on a specific SCSI\r
998 target.\r
999\r
1000 Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.\r
1001 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
1002 command will be executed.\r
1003 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
1004 for the command to complete. If Timeout is greater than zero, then the\r
1005 command is executed and will timeout after Timeout 100 ns units.\r
1006 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
1007 the command to completes. If Timeout is greater than zero, Event will also be\r
1008 signaled after Timeout 100 ns units.\r
1009 The StartLba and SectorSize parameters are used to construct the CDB for this\r
1010 SCSI command.\r
1011\r
1012 If ScsiIo is NULL, then ASSERT().\r
1013 If SenseDataLength is NULL, then ASSERT().\r
1014 If HostAdapterStatus is NULL, then ASSERT().\r
1015 If TargetStatus is NULL, then ASSERT().\r
1016 If DataLength is NULL, then ASSERT().\r
1017\r
1018 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
1019 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1020 EFI_INVALID_PARAMETER gets returned.\r
1021\r
1022 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
1023 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1024 EFI_INVALID_PARAMETER gets returned.\r
1025\r
1026 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
1027 @param[in] Timeout The length of timeout period.\r
1028 @param[in, out] SenseData A pointer to output sense data.\r
1029 @param[in, out] SenseDataLength The length of output sense data.\r
1030 @param[out] HostAdapterStatus The status of Host Adapter.\r
1031 @param[out] TargetStatus The status of the target.\r
1032 @param[in, out] DataBuffer Read 16 command data.\r
1033 @param[in, out] DataLength The length of data buffer.\r
1034 @param[in] StartLba The start address of LBA.\r
1035 @param[in] SectorSize The number of contiguous logical blocks\r
1036 of data that shall be transferred.\r
1037 @param[in] Event If the SCSI target does not support\r
1038 non-blocking I/O, then Event is ignored,\r
1039 and blocking I/O is performed. If Event\r
1040 is NULL, then blocking I/O is performed.\r
1041 If Event is not NULL and non-blocking\r
1042 I/O is supported, then non-blocking I/O\r
1043 is performed, and Event will be signaled\r
1044 when the SCSI Read(16) command\r
1045 completes.\r
1046\r
1047 @retval EFI_SUCCESS Command is executed successfully.\r
1048 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
1049 but the entire DataBuffer could not be\r
1050 transferred. The actual number of bytes\r
1051 transferred is returned in DataLength.\r
1052 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
1053 sent because there are too many SCSI\r
1054 Command Packets already queued.\r
1055 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
1056 to send SCSI Request Packet.\r
1057 @retval EFI_UNSUPPORTED The command described by the SCSI\r
1058 Request Packet is not supported by the\r
1059 SCSI initiator(i.e., SCSI Host\r
1060 Controller)\r
1061 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
1062 SCSI Request Packet to execute.\r
1063 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
1064 are invalid.\r
1065 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
1066 to a lack of resources.\r
1067\r
1068**/\r
1069EFI_STATUS\r
1070EFIAPI\r
1071ScsiRead16CommandEx (\r
1072 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
1073 IN UINT64 Timeout,\r
1074 IN OUT VOID *SenseData, OPTIONAL\r
1075 IN OUT UINT8 *SenseDataLength,\r
1076 OUT UINT8 *HostAdapterStatus,\r
1077 OUT UINT8 *TargetStatus,\r
1078 IN OUT VOID *DataBuffer, OPTIONAL\r
1079 IN OUT UINT32 *DataLength,\r
1080 IN UINT64 StartLba,\r
1081 IN UINT32 SectorSize,\r
1082 IN EFI_EVENT Event OPTIONAL\r
1083 );\r
1084\r
1085\r
1086/**\r
1087 Execute blocking/non-blocking Write(16) SCSI command on a specific SCSI\r
1088 target.\r
1089\r
1090 Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.\r
1091 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
1092 command will be executed.\r
1093 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
1094 for the command to complete. If Timeout is greater than zero, then the\r
1095 command is executed and will timeout after Timeout 100 ns units.\r
1096 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
1097 the command to completes. If Timeout is greater than zero, Event will also be\r
1098 signaled after Timeout 100 ns units.\r
1099 The StartLba and SectorSize parameters are used to construct the CDB for this\r
1100 SCSI command.\r
1101\r
1102 If ScsiIo is NULL, then ASSERT().\r
1103 If SenseDataLength is NULL, then ASSERT().\r
1104 If HostAdapterStatus is NULL, then ASSERT().\r
1105 If TargetStatus is NULL, then ASSERT().\r
1106 If DataLength is NULL, then ASSERT().\r
1107\r
1108 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
1109 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1110 EFI_INVALID_PARAMETER gets returned.\r
1111\r
1112 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
1113 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1114 EFI_INVALID_PARAMETER gets returned.\r
1115\r
1116 @param[in] ScsiIo SCSI IO Protocol to use\r
1117 @param[in] Timeout The length of timeout period.\r
1118 @param[in, out] SenseData A pointer to output sense data.\r
1119 @param[in, out] SenseDataLength The length of output sense data.\r
1120 @param[out] HostAdapterStatus The status of Host Adapter.\r
1121 @param[out] TargetStatus The status of the target.\r
1122 @param[in, out] DataBuffer A pointer to a data buffer.\r
1123 @param[in, out] DataLength The length of data buffer.\r
1124 @param[in] StartLba The start address of LBA.\r
1125 @param[in] SectorSize The number of contiguous logical blocks\r
1126 of data that shall be transferred.\r
1127 @param[in] Event If the SCSI target does not support\r
1128 non-blocking I/O, then Event is ignored,\r
1129 and blocking I/O is performed. If Event\r
1130 is NULL, then blocking I/O is performed.\r
1131 If Event is not NULL and non-blocking\r
1132 I/O is supported, then non-blocking I/O\r
1133 is performed, and Event will be signaled\r
1134 when the SCSI Write(16) command\r
1135 completes.\r
1136\r
1137 @retval EFI_SUCCESS Command is executed successfully.\r
1138 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
1139 but the entire DataBuffer could not be\r
1140 transferred. The actual number of bytes\r
1141 transferred is returned in DataLength.\r
1142 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
1143 sent because there are too many SCSI\r
1144 Command Packets already queued.\r
1145 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
1146 to send SCSI Request Packet.\r
1147 @retval EFI_UNSUPPORTED The command described by the SCSI\r
1148 Request Packet is not supported by the\r
1149 SCSI initiator(i.e., SCSI Host\r
1150 Controller)\r
1151 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
1152 SCSI Request Packet to execute.\r
1153 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
1154 are invalid.\r
1155 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
1156 to a lack of resources.\r
1157\r
1158**/\r
1159EFI_STATUS\r
1160EFIAPI\r
1161ScsiWrite16CommandEx (\r
1162 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
1163 IN UINT64 Timeout,\r
1164 IN OUT VOID *SenseData, OPTIONAL\r
1165 IN OUT UINT8 *SenseDataLength,\r
1166 OUT UINT8 *HostAdapterStatus,\r
1167 OUT UINT8 *TargetStatus,\r
1168 IN OUT VOID *DataBuffer, OPTIONAL\r
1169 IN OUT UINT32 *DataLength,\r
1170 IN UINT64 StartLba,\r
1171 IN UINT32 SectorSize,\r
1172 IN EFI_EVENT Event OPTIONAL\r
1173 );\r
1174\r
fb3df220 1175#endif\r