]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Library/UefiScsiLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Library / UefiScsiLib.h
... / ...
CommitLineData
1/** @file\r
2 Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.\r
3\r
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
8Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
9SPDX-License-Identifier: BSD-2-Clause-Patent\r
10\r
11**/\r
12\r
13#ifndef __SCSI_LIB_H__\r
14#define __SCSI_LIB_H__\r
15\r
16#include <Protocol/ScsiIo.h>\r
17\r
18/**\r
19 Execute Test Unit Ready SCSI command on a specific SCSI target.\r
20\r
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
25 If SenseDataLength is NULL, then ASSERT().\r
26 If HostAdapterStatus is NULL, then ASSERT().\r
27 If TargetStatus is NULL, then ASSERT().\r
28\r
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
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
48 the SenseData buffer. On output, a pointer to\r
49 the number of bytes written to the SenseData buffer.\r
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
56 by ScsiIo when the SCSI Request Packet was executed\r
57 on the SCSI Host Controller. See the EFI SCSI I/O\r
58 Protocol in the UEFI Specification for details on\r
59 the possible return values.\r
60\r
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
83\r
84**/\r
85EFI_STATUS\r
86EFIAPI\r
87ScsiTestUnitReadyCommand (\r
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
94 );\r
95\r
96\r
97/**\r
98 Execute Inquiry SCSI command on a specific SCSI target.\r
99\r
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
104 If SenseDataLength is NULL, then ASSERT().\r
105 If HostAdapterStatus is NULL, then ASSERT().\r
106 If TargetStatus is NULL, then ASSERT().\r
107 If InquiryDataLength is NULL, then ASSERT().\r
108\r
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
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
132 On output, the number of bytes written to the SenseData buffer.\r
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
140 by ScsiIo when the SCSI Request Packet was\r
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
144 return values.\r
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
149 is optional and may be NULL.\r
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
157 returned in InquiryDataBuffer.\r
158\r
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
182\r
183**/\r
184EFI_STATUS\r
185EFIAPI\r
186ScsiInquiryCommand (\r
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
196 );\r
197\r
198\r
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
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
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
234 On output, the number of bytes written to the SenseData buffer.\r
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
246 return values.\r
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
251 is optional and may be NULL.\r
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
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
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
304/**\r
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
313 If SenseDataLength is NULL, then ASSERT().\r
314 If HostAdapterStatus is NULL, then ASSERT().\r
315 If TargetStatus is NULL, then ASSERT().\r
316 If DataLength is NULL, then ASSERT().\r
317\r
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
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
335 @param[in, out] SenseData A pointer to sense data that was generated\r
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
340 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r
341 On output, the number of bytes written to the SenseData buffer.\r
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
349 by ScsiIo when the SCSI Request Packet was executed\r
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
353 @param[in, out] DataBuffer A pointer to data that was generated by the\r
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
357 and may be NULL.\r
358 @param[in, out] DataLength On input, a pointer to the length in bytes of\r
359 the DataBuffer buffer. On output, a pointer\r
360 to the number of bytes written to the DataBuffer\r
361 buffer.\r
362 @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r
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
365\r
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
391\r
392**/\r
393EFI_STATUS\r
394EFIAPI\r
395ScsiModeSense10Command (\r
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
407 );\r
408\r
409\r
410\r
411/**\r
412 Execute Request Sense SCSI command on a specific SCSI target.\r
413\r
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
418 If SenseDataLength is NULL, then ASSERT().\r
419 If HostAdapterStatus is NULL, then ASSERT().\r
420 If TargetStatus is NULL, then ASSERT().\r
421\r
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
426 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
427 @param[in] Timeout The length of timeout period.\r
428 @param[in, out] SenseData A pointer to output sense data.\r
429 @param[in, out] SenseDataLength The length of output sense data.\r
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
440 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
441\r
442**/\r
443EFI_STATUS\r
444EFIAPI\r
445ScsiRequestSenseCommand (\r
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
452 );\r
453\r
454\r
455/**\r
456 Execute Read Capacity SCSI command on a specific SCSI target.\r
457\r
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
461 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r
462 If ScsiIo is NULL, then ASSERT().\r
463 If SenseDataLength is NULL, then ASSERT().\r
464 If HostAdapterStatus is NULL, then ASSERT().\r
465 If TargetStatus is NULL, then ASSERT().\r
466 If DataLength is NULL, then ASSERT().\r
467\r
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
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
479 @param[in, out] SenseDataLength The length of output sense data.\r
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
483 @param[in, out] DataLength The length of data buffer.\r
484 @param[in] Pmi Partial medium indicator.\r
485\r
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
497\r
498**/\r
499EFI_STATUS\r
500EFIAPI\r
501ScsiReadCapacityCommand (\r
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
510 IN BOOLEAN Pmi\r
511 );\r
512\r
513\r
514/**\r
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
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
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
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
556\r
557**/\r
558EFI_STATUS\r
559EFIAPI\r
560ScsiReadCapacity16Command (\r
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
570 );\r
571\r
572\r
573/**\r
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
582 If SenseDataLength is NULL, then ASSERT().\r
583 If HostAdapterStatus is NULL, then ASSERT().\r
584 If TargetStatus is NULL, then ASSERT().\r
585 If DataLength is NULL, then ASSERT().\r
586\r
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
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
598 @param[in, out] SenseDataLength The length of output sense data.\r
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
602 @param[in, out] DataLength The length of data buffer.\r
603 @param[in] StartLba The start address of LBA.\r
604 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
605\r
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
616\r
617**/\r
618EFI_STATUS\r
619EFIAPI\r
620ScsiRead10Command (\r
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
631 );\r
632\r
633\r
634/**\r
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
643 If SenseDataLength is NULL, then ASSERT().\r
644 If HostAdapterStatus is NULL, then ASSERT().\r
645 If TargetStatus is NULL, then ASSERT().\r
646 If DataLength is NULL, then ASSERT().\r
647\r
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
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
659 @param[in, out] SenseDataLength The length of output sense data.\r
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
663 @param[in, out] DataLength The length of data buffer.\r
664 @param[in] StartLba The start address of LBA.\r
665 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
666\r
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
677\r
678**/\r
679EFI_STATUS\r
680EFIAPI\r
681ScsiWrite10Command (\r
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
692 );\r
693\r
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
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
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
725 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
726\r
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
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
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
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
786 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r
787\r
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
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
814\r
815\r
816/**\r
817 Execute Security Protocol In SCSI command on a specific SCSI target.\r
818\r
819 Executes the SCSI Security Protocol In command on the SCSI target specified by ScsiIo.\r
820 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
821 If Timeout is greater than zero, then the command is executed and will timeout after\r
822 Timeout 100 ns units.\r
823 If ScsiIo is NULL, then ASSERT().\r
824 If SenseDataLength is NULL, then ASSERT().\r
825 If HostAdapterStatus is NULL, then ASSERT().\r
826 If TargetStatus is NULL, then ASSERT().\r
827 If TransferLength is NULL, then ASSERT().\r
828\r
829 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
830 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
831 gets returned.\r
832\r
833 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
834 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
835 gets returned.\r
836\r
837 @param[in] ScsiIo SCSI IO Protocol to use.\r
838 @param[in] Timeout The length of timeout period.\r
839 @param[in, out] SenseData A pointer to output sense data.\r
840 @param[in, out] SenseDataLength The length of output sense data.\r
841 @param[out] HostAdapterStatus The status of Host Adapter.\r
842 @param[out] TargetStatus The status of the target.\r
843 @param[in] SecurityProtocol The Security Protocol to use.\r
844 @param[in] SecurityProtocolSpecific The Security Protocol Specific data.\r
845 @param[in] Inc512 If TRUE, 512 increment (INC_512) bit will be set for the\r
846 SECURITY PROTOCOL IN command.\r
847 @param[in] DataLength The size in bytes of the data buffer.\r
848 @param[in, out] DataBuffer A pointer to a data buffer.\r
849 @param[out] TransferLength A pointer to a buffer to store the size in\r
850 bytes of the data written to the data buffer.\r
851\r
852 @retval EFI_SUCCESS Command is executed successfully.\r
853 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
854 not be transferred. The actual number of bytes transferred is returned in TransferLength.\r
855 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r
856 SCSI Command Packets already queued.\r
857 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
858 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
859 the SCSI initiator(i.e., SCSI Host Controller)\r
860 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
861 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
862\r
863**/\r
864EFI_STATUS\r
865EFIAPI\r
866ScsiSecurityProtocolInCommand (\r
867 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
868 IN UINT64 Timeout,\r
869 IN OUT VOID *SenseData, OPTIONAL\r
870 IN OUT UINT8 *SenseDataLength,\r
871 OUT UINT8 *HostAdapterStatus,\r
872 OUT UINT8 *TargetStatus,\r
873 IN UINT8 SecurityProtocol,\r
874 IN UINT16 SecurityProtocolSpecific,\r
875 IN BOOLEAN Inc512,\r
876 IN UINTN DataLength,\r
877 IN OUT VOID *DataBuffer, OPTIONAL\r
878 OUT UINTN *TransferLength\r
879 );\r
880\r
881\r
882/**\r
883 Execute Security Protocol Out SCSI command on a specific SCSI target.\r
884\r
885 Executes the SCSI Security Protocol Out command on the SCSI target specified by ScsiIo.\r
886 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
887 If Timeout is greater than zero, then the command is executed and will timeout after\r
888 Timeout 100 ns units.\r
889 If ScsiIo is NULL, then ASSERT().\r
890 If SenseDataLength is NULL, then ASSERT().\r
891 If HostAdapterStatus is NULL, then ASSERT().\r
892 If TargetStatus is NULL, then ASSERT().\r
893\r
894 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
895 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
896 gets returned.\r
897\r
898 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
899 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
900 gets returned.\r
901\r
902 @param[in] ScsiIo SCSI IO Protocol to use.\r
903 @param[in] Timeout The length of timeout period.\r
904 @param[in, out] SenseData A pointer to output sense data.\r
905 @param[in, out] SenseDataLength The length of output sense data.\r
906 @param[out] HostAdapterStatus The status of Host Adapter.\r
907 @param[out] TargetStatus The status of the target.\r
908 @param[in] SecurityProtocol The Security Protocol to use.\r
909 @param[in] SecurityProtocolSpecific The Security Protocol Specific data.\r
910 @param[in] Inc512 If TRUE, 512 increment (INC_512) bit will be set for the\r
911 SECURITY PROTOCOL OUT command.\r
912 @param[in] DataLength The size in bytes of the transfer data.\r
913 @param[in, out] DataBuffer A pointer to a data buffer.\r
914\r
915 @retval EFI_SUCCESS Command is executed successfully.\r
916 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
917 not be transferred. The actual number of bytes transferred is returned in DataLength.\r
918 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r
919 SCSI Command Packets already queued.\r
920 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
921 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
922 the SCSI initiator(i.e., SCSI Host Controller)\r
923 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
924 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r
925\r
926**/\r
927EFI_STATUS\r
928EFIAPI\r
929ScsiSecurityProtocolOutCommand (\r
930 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
931 IN UINT64 Timeout,\r
932 IN OUT VOID *SenseData, OPTIONAL\r
933 IN OUT UINT8 *SenseDataLength,\r
934 OUT UINT8 *HostAdapterStatus,\r
935 OUT UINT8 *TargetStatus,\r
936 IN UINT8 SecurityProtocol,\r
937 IN UINT16 SecurityProtocolSpecific,\r
938 IN BOOLEAN Inc512,\r
939 IN UINTN DataLength,\r
940 IN OUT VOID *DataBuffer OPTIONAL\r
941 );\r
942\r
943\r
944/**\r
945 Execute blocking/non-blocking Read(10) SCSI command on a specific SCSI\r
946 target.\r
947\r
948 Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r
949 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
950 command will be executed.\r
951 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
952 for the command to complete. If Timeout is greater than zero, then the\r
953 command is executed and will timeout after Timeout 100 ns units.\r
954 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
955 the command to completes. If Timeout is greater than zero, Event will also be\r
956 signaled after Timeout 100 ns units.\r
957 The StartLba and SectorSize parameters are used to construct the CDB for this\r
958 SCSI command.\r
959\r
960 If ScsiIo is NULL, then ASSERT().\r
961 If SenseDataLength is NULL, then ASSERT().\r
962 If HostAdapterStatus is NULL, then ASSERT().\r
963 If TargetStatus is NULL, then ASSERT().\r
964 If DataLength is NULL, then ASSERT().\r
965\r
966 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
967 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
968 EFI_INVALID_PARAMETER gets returned.\r
969\r
970 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
971 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
972 EFI_INVALID_PARAMETER gets returned.\r
973\r
974 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
975 @param[in] Timeout The length of timeout period.\r
976 @param[in, out] SenseData A pointer to output sense data.\r
977 @param[in, out] SenseDataLength The length of output sense data.\r
978 @param[out] HostAdapterStatus The status of Host Adapter.\r
979 @param[out] TargetStatus The status of the target.\r
980 @param[in, out] DataBuffer Read 16 command data.\r
981 @param[in, out] DataLength The length of data buffer.\r
982 @param[in] StartLba The start address of LBA.\r
983 @param[in] SectorSize The number of contiguous logical blocks\r
984 of data that shall be transferred.\r
985 @param[in] Event If the SCSI target does not support\r
986 non-blocking I/O, then Event is ignored,\r
987 and blocking I/O is performed. If Event\r
988 is NULL, then blocking I/O is performed.\r
989 If Event is not NULL and non-blocking\r
990 I/O is supported, then non-blocking I/O\r
991 is performed, and Event will be signaled\r
992 when the SCSI Read(10) command\r
993 completes.\r
994\r
995 @retval EFI_SUCCESS Command is executed successfully.\r
996 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
997 but the entire DataBuffer could not be\r
998 transferred. The actual number of bytes\r
999 transferred is returned in DataLength.\r
1000 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
1001 sent because there are too many SCSI\r
1002 Command Packets already queued.\r
1003 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
1004 to send SCSI Request Packet.\r
1005 @retval EFI_UNSUPPORTED The command described by the SCSI\r
1006 Request Packet is not supported by the\r
1007 SCSI initiator(i.e., SCSI Host\r
1008 Controller)\r
1009 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
1010 SCSI Request Packet to execute.\r
1011 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
1012 are invalid.\r
1013 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
1014 to a lack of resources.\r
1015\r
1016**/\r
1017EFI_STATUS\r
1018EFIAPI\r
1019ScsiRead10CommandEx (\r
1020 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
1021 IN UINT64 Timeout,\r
1022 IN OUT VOID *SenseData, OPTIONAL\r
1023 IN OUT UINT8 *SenseDataLength,\r
1024 OUT UINT8 *HostAdapterStatus,\r
1025 OUT UINT8 *TargetStatus,\r
1026 IN OUT VOID *DataBuffer, OPTIONAL\r
1027 IN OUT UINT32 *DataLength,\r
1028 IN UINT32 StartLba,\r
1029 IN UINT32 SectorSize,\r
1030 IN EFI_EVENT Event OPTIONAL\r
1031 );\r
1032\r
1033\r
1034/**\r
1035 Execute blocking/non-blocking Write(10) SCSI command on a specific SCSI\r
1036 target.\r
1037\r
1038 Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r
1039 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
1040 command will be executed.\r
1041 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
1042 for the command to complete. If Timeout is greater than zero, then the\r
1043 command is executed and will timeout after Timeout 100 ns units.\r
1044 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
1045 the command to completes. If Timeout is greater than zero, Event will also be\r
1046 signaled after Timeout 100 ns units.\r
1047 The StartLba and SectorSize parameters are used to construct the CDB for this\r
1048 SCSI command.\r
1049\r
1050 If ScsiIo is NULL, then ASSERT().\r
1051 If SenseDataLength is NULL, then ASSERT().\r
1052 If HostAdapterStatus is NULL, then ASSERT().\r
1053 If TargetStatus is NULL, then ASSERT().\r
1054 If DataLength is NULL, then ASSERT().\r
1055\r
1056 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
1057 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1058 EFI_INVALID_PARAMETER gets returned.\r
1059\r
1060 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
1061 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1062 EFI_INVALID_PARAMETER gets returned.\r
1063\r
1064 @param[in] ScsiIo SCSI IO Protocol to use\r
1065 @param[in] Timeout The length of timeout period.\r
1066 @param[in, out] SenseData A pointer to output sense data.\r
1067 @param[in, out] SenseDataLength The length of output sense data.\r
1068 @param[out] HostAdapterStatus The status of Host Adapter.\r
1069 @param[out] TargetStatus The status of the target.\r
1070 @param[in, out] DataBuffer A pointer to a data buffer.\r
1071 @param[in, out] DataLength The length of data buffer.\r
1072 @param[in] StartLba The start address of LBA.\r
1073 @param[in] SectorSize The number of contiguous logical blocks\r
1074 of data that shall be transferred.\r
1075 @param[in] Event If the SCSI target does not support\r
1076 non-blocking I/O, then Event is ignored,\r
1077 and blocking I/O is performed. If Event\r
1078 is NULL, then blocking I/O is performed.\r
1079 If Event is not NULL and non-blocking\r
1080 I/O is supported, then non-blocking I/O\r
1081 is performed, and Event will be signaled\r
1082 when the SCSI Write(10) command\r
1083 completes.\r
1084\r
1085 @retval EFI_SUCCESS Command is executed successfully.\r
1086 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
1087 but the entire DataBuffer could not be\r
1088 transferred. The actual number of bytes\r
1089 transferred is returned in DataLength.\r
1090 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
1091 sent because there are too many SCSI\r
1092 Command Packets already queued.\r
1093 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
1094 to send SCSI Request Packet.\r
1095 @retval EFI_UNSUPPORTED The command described by the SCSI\r
1096 Request Packet is not supported by the\r
1097 SCSI initiator(i.e., SCSI Host\r
1098 Controller)\r
1099 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
1100 SCSI Request Packet to execute.\r
1101 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
1102 are invalid.\r
1103 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
1104 to a lack of resources.\r
1105\r
1106**/\r
1107EFI_STATUS\r
1108EFIAPI\r
1109ScsiWrite10CommandEx (\r
1110 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
1111 IN UINT64 Timeout,\r
1112 IN OUT VOID *SenseData, OPTIONAL\r
1113 IN OUT UINT8 *SenseDataLength,\r
1114 OUT UINT8 *HostAdapterStatus,\r
1115 OUT UINT8 *TargetStatus,\r
1116 IN OUT VOID *DataBuffer, OPTIONAL\r
1117 IN OUT UINT32 *DataLength,\r
1118 IN UINT32 StartLba,\r
1119 IN UINT32 SectorSize,\r
1120 IN EFI_EVENT Event OPTIONAL\r
1121 );\r
1122\r
1123\r
1124/**\r
1125 Execute blocking/non-blocking Read(16) SCSI command on a specific SCSI\r
1126 target.\r
1127\r
1128 Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.\r
1129 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
1130 command will be executed.\r
1131 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
1132 for the command to complete. If Timeout is greater than zero, then the\r
1133 command is executed and will timeout after Timeout 100 ns units.\r
1134 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
1135 the command to completes. If Timeout is greater than zero, Event will also be\r
1136 signaled after Timeout 100 ns units.\r
1137 The StartLba and SectorSize parameters are used to construct the CDB for this\r
1138 SCSI command.\r
1139\r
1140 If ScsiIo is NULL, then ASSERT().\r
1141 If SenseDataLength is NULL, then ASSERT().\r
1142 If HostAdapterStatus is NULL, then ASSERT().\r
1143 If TargetStatus is NULL, then ASSERT().\r
1144 If DataLength is NULL, then ASSERT().\r
1145\r
1146 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
1147 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1148 EFI_INVALID_PARAMETER gets returned.\r
1149\r
1150 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
1151 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1152 EFI_INVALID_PARAMETER gets returned.\r
1153\r
1154 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
1155 @param[in] Timeout The length of timeout period.\r
1156 @param[in, out] SenseData A pointer to output sense data.\r
1157 @param[in, out] SenseDataLength The length of output sense data.\r
1158 @param[out] HostAdapterStatus The status of Host Adapter.\r
1159 @param[out] TargetStatus The status of the target.\r
1160 @param[in, out] DataBuffer Read 16 command data.\r
1161 @param[in, out] DataLength The length of data buffer.\r
1162 @param[in] StartLba The start address of LBA.\r
1163 @param[in] SectorSize The number of contiguous logical blocks\r
1164 of data that shall be transferred.\r
1165 @param[in] Event If the SCSI target does not support\r
1166 non-blocking I/O, then Event is ignored,\r
1167 and blocking I/O is performed. If Event\r
1168 is NULL, then blocking I/O is performed.\r
1169 If Event is not NULL and non-blocking\r
1170 I/O is supported, then non-blocking I/O\r
1171 is performed, and Event will be signaled\r
1172 when the SCSI Read(16) command\r
1173 completes.\r
1174\r
1175 @retval EFI_SUCCESS Command is executed successfully.\r
1176 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
1177 but the entire DataBuffer could not be\r
1178 transferred. The actual number of bytes\r
1179 transferred is returned in DataLength.\r
1180 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
1181 sent because there are too many SCSI\r
1182 Command Packets already queued.\r
1183 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
1184 to send SCSI Request Packet.\r
1185 @retval EFI_UNSUPPORTED The command described by the SCSI\r
1186 Request Packet is not supported by the\r
1187 SCSI initiator(i.e., SCSI Host\r
1188 Controller)\r
1189 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
1190 SCSI Request Packet to execute.\r
1191 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
1192 are invalid.\r
1193 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
1194 to a lack of resources.\r
1195\r
1196**/\r
1197EFI_STATUS\r
1198EFIAPI\r
1199ScsiRead16CommandEx (\r
1200 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
1201 IN UINT64 Timeout,\r
1202 IN OUT VOID *SenseData, OPTIONAL\r
1203 IN OUT UINT8 *SenseDataLength,\r
1204 OUT UINT8 *HostAdapterStatus,\r
1205 OUT UINT8 *TargetStatus,\r
1206 IN OUT VOID *DataBuffer, OPTIONAL\r
1207 IN OUT UINT32 *DataLength,\r
1208 IN UINT64 StartLba,\r
1209 IN UINT32 SectorSize,\r
1210 IN EFI_EVENT Event OPTIONAL\r
1211 );\r
1212\r
1213\r
1214/**\r
1215 Execute blocking/non-blocking Write(16) SCSI command on a specific SCSI\r
1216 target.\r
1217\r
1218 Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.\r
1219 When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
1220 command will be executed.\r
1221 For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
1222 for the command to complete. If Timeout is greater than zero, then the\r
1223 command is executed and will timeout after Timeout 100 ns units.\r
1224 For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
1225 the command to completes. If Timeout is greater than zero, Event will also be\r
1226 signaled after Timeout 100 ns units.\r
1227 The StartLba and SectorSize parameters are used to construct the CDB for this\r
1228 SCSI command.\r
1229\r
1230 If ScsiIo is NULL, then ASSERT().\r
1231 If SenseDataLength is NULL, then ASSERT().\r
1232 If HostAdapterStatus is NULL, then ASSERT().\r
1233 If TargetStatus is NULL, then ASSERT().\r
1234 If DataLength is NULL, then ASSERT().\r
1235\r
1236 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
1237 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1238 EFI_INVALID_PARAMETER gets returned.\r
1239\r
1240 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
1241 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
1242 EFI_INVALID_PARAMETER gets returned.\r
1243\r
1244 @param[in] ScsiIo SCSI IO Protocol to use\r
1245 @param[in] Timeout The length of timeout period.\r
1246 @param[in, out] SenseData A pointer to output sense data.\r
1247 @param[in, out] SenseDataLength The length of output sense data.\r
1248 @param[out] HostAdapterStatus The status of Host Adapter.\r
1249 @param[out] TargetStatus The status of the target.\r
1250 @param[in, out] DataBuffer A pointer to a data buffer.\r
1251 @param[in, out] DataLength The length of data buffer.\r
1252 @param[in] StartLba The start address of LBA.\r
1253 @param[in] SectorSize The number of contiguous logical blocks\r
1254 of data that shall be transferred.\r
1255 @param[in] Event If the SCSI target does not support\r
1256 non-blocking I/O, then Event is ignored,\r
1257 and blocking I/O is performed. If Event\r
1258 is NULL, then blocking I/O is performed.\r
1259 If Event is not NULL and non-blocking\r
1260 I/O is supported, then non-blocking I/O\r
1261 is performed, and Event will be signaled\r
1262 when the SCSI Write(16) command\r
1263 completes.\r
1264\r
1265 @retval EFI_SUCCESS Command is executed successfully.\r
1266 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r
1267 but the entire DataBuffer could not be\r
1268 transferred. The actual number of bytes\r
1269 transferred is returned in DataLength.\r
1270 @retval EFI_NOT_READY The SCSI Request Packet could not be\r
1271 sent because there are too many SCSI\r
1272 Command Packets already queued.\r
1273 @retval EFI_DEVICE_ERROR A device error occurred while attempting\r
1274 to send SCSI Request Packet.\r
1275 @retval EFI_UNSUPPORTED The command described by the SCSI\r
1276 Request Packet is not supported by the\r
1277 SCSI initiator(i.e., SCSI Host\r
1278 Controller)\r
1279 @retval EFI_TIMEOUT A timeout occurred while waiting for the\r
1280 SCSI Request Packet to execute.\r
1281 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r
1282 are invalid.\r
1283 @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r
1284 to a lack of resources.\r
1285\r
1286**/\r
1287EFI_STATUS\r
1288EFIAPI\r
1289ScsiWrite16CommandEx (\r
1290 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
1291 IN UINT64 Timeout,\r
1292 IN OUT VOID *SenseData, OPTIONAL\r
1293 IN OUT UINT8 *SenseDataLength,\r
1294 OUT UINT8 *HostAdapterStatus,\r
1295 OUT UINT8 *TargetStatus,\r
1296 IN OUT VOID *DataBuffer, OPTIONAL\r
1297 IN OUT UINT32 *DataLength,\r
1298 IN UINT64 StartLba,\r
1299 IN UINT32 SectorSize,\r
1300 IN EFI_EVENT Event OPTIONAL\r
1301 );\r
1302\r
1303#endif\r