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