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