2 Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.
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.
8 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #ifndef __SCSI_LIB_H__
14 #define __SCSI_LIB_H__
16 #include <Protocol/ScsiIo.h>
19 Execute Test Unit Ready SCSI command on a specific SCSI target.
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().
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
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.
61 @retval EFI_SUCCESS The command was executed successfully.
62 See HostAdapterStatus, TargetStatus, SenseDataLength,
63 and SenseData in that order for additional status
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.
87 ScsiTestUnitReadyCommand (
88 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
90 IN OUT VOID
*SenseData OPTIONAL
,
91 IN OUT UINT8
*SenseDataLength
,
92 OUT UINT8
*HostAdapterStatus
,
93 OUT UINT8
*TargetStatus
97 Execute Inquiry SCSI command on a specific SCSI target.
99 Executes the Inquiry command on the SCSI target specified by ScsiIo.
100 If Timeout is zero, then this function waits indefinitely for the command to complete.
101 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
102 If ScsiIo is NULL, then ASSERT().
103 If SenseDataLength is NULL, then ASSERT().
104 If HostAdapterStatus is NULL, then ASSERT().
105 If TargetStatus is NULL, then ASSERT().
106 If InquiryDataLength is NULL, then ASSERT().
108 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
109 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
112 If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer
113 must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
114 EFI_INVALID_PARAMETER gets returned.
116 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
117 for the specific SCSI target.
118 @param[in] Timeout The timeout in 100 ns units to use for the
119 execution of this SCSI Request Packet. A Timeout
120 value of zero means that this function will wait
121 indefinitely for the SCSI Request Packet to execute.
122 If Timeout is greater than zero, then this function
123 will return EFI_TIMEOUT if the time required to
124 execute the SCSI Request Packet is greater than Timeout.
125 @param[in, out] SenseData A pointer to sense data that was generated
126 by the execution of the SCSI Request Packet.
127 This buffer must be allocated by the caller.
128 If SenseDataLength is 0, then this parameter
129 is optional and may be NULL.
130 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
131 On output, the number of bytes written to the SenseData buffer.
132 @param[out] HostAdapterStatus The status of the SCSI Host Controller that
133 produces the SCSI bus containing the SCSI
134 target specified by ScsiIo when the SCSI
135 Request Packet was executed. See the EFI
136 SCSI I/O Protocol in the UEFI Specification
137 for details on the possible return values.
138 @param[out] TargetStatus The status returned by the SCSI target specified
139 by ScsiIo when the SCSI Request Packet was
140 executed on the SCSI Host Controller.
141 See the EFI SCSI I/O Protocol in the UEFI
142 Specification for details on the possible
144 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated
145 by the execution of the SCSI Request Packet.
146 This buffer must be allocated by the caller.
147 If InquiryDataLength is 0, then this parameter
148 is optional and may be NULL.
149 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes
150 of the InquiryDataBuffer buffer.
151 On output, a pointer to the number of bytes
152 written to the InquiryDataBuffer buffer.
153 @param[in] EnableVitalProductData If TRUE, then the supported vital product
154 data is returned in InquiryDataBuffer.
155 If FALSE, then the standard inquiry data is
156 returned in InquiryDataBuffer.
158 @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,
159 TargetStatus, SenseDataLength, and SenseData in that order
160 for additional status information.
161 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
162 InquiryDataBuffer could not be transferred. The actual
163 number of bytes transferred is returned in InquiryDataLength.
164 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there
165 are too many SCSI Command Packets already queued.
166 The SCSI Request Packet was not sent, so no additional
167 status information is available. The caller may retry again later.
168 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI
169 Request Packet. See HostAdapterStatus, TargetStatus,
170 SenseDataLength, and SenseData in that order for additional
172 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not
173 supported by the SCSI initiator(i.e., SCSI Host Controller).
174 The SCSI Request Packet was not sent, so no additional
175 status information is available.
176 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
177 Packet to execute. See HostAdapterStatus, TargetStatus,
178 SenseDataLength, and SenseData in that order for
179 additional status information.
180 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
186 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
188 IN OUT VOID
*SenseData OPTIONAL
,
189 IN OUT UINT8
*SenseDataLength
,
190 OUT UINT8
*HostAdapterStatus
,
191 OUT UINT8
*TargetStatus
,
192 IN OUT VOID
*InquiryDataBuffer OPTIONAL
,
193 IN OUT UINT32
*InquiryDataLength
,
194 IN BOOLEAN EnableVitalProductData
198 Execute Inquiry SCSI command on a specific SCSI target.
200 Executes the Inquiry command on the SCSI target specified by ScsiIo.
201 If Timeout is zero, then this function waits indefinitely for the command to complete.
202 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
203 If ScsiIo is NULL, then ASSERT().
204 If SenseDataLength is NULL, then ASSERT().
205 If HostAdapterStatus is NULL, then ASSERT().
206 If TargetStatus is NULL, then ASSERT().
207 If InquiryDataLength is NULL, then ASSERT().
209 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
210 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
213 If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer
214 must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
215 EFI_INVALID_PARAMETER gets returned.
217 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
218 for the specific SCSI target.
219 @param[in] Timeout The timeout in 100 ns units to use for the
220 execution of this SCSI Request Packet. A Timeout
221 value of zero means that this function will wait
222 indefinitely for the SCSI Request Packet to execute.
223 If Timeout is greater than zero, then this function
224 will return EFI_TIMEOUT if the time required to
225 execute the SCSI Request Packet is greater than Timeout.
226 @param[in, out] SenseData A pointer to sense data that was generated
227 by the execution of the SCSI Request Packet.
228 This buffer must be allocated by the caller.
229 If SenseDataLength is 0, then this parameter
230 is optional and may be NULL.
231 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
232 On output, the number of bytes written to the SenseData buffer.
233 @param[out] HostAdapterStatus The status of the SCSI Host Controller that
234 produces the SCSI bus containing the SCSI
235 target specified by ScsiIo when the SCSI
236 Request Packet was executed. See the EFI
237 SCSI I/O Protocol in the UEFI Specification
238 for details on the possible return values.
239 @param[out] TargetStatus The status returned by the SCSI target specified
240 by ScsiIo when the SCSI Request Packet was
241 executed on the SCSI Host Controller.
242 See the EFI SCSI I/O Protocol in the UEFI
243 Specification for details on the possible
245 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated
246 by the execution of the SCSI Request Packet.
247 This buffer must be allocated by the caller.
248 If InquiryDataLength is 0, then this parameter
249 is optional and may be NULL.
250 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes
251 of the InquiryDataBuffer buffer.
252 On output, a pointer to the number of bytes
253 written to the InquiryDataBuffer buffer.
254 @param[in] EnableVitalProductData If TRUE, then the supported vital product
255 data for the PageCode is returned in InquiryDataBuffer.
256 If FALSE, then the standard inquiry data is
257 returned in InquiryDataBuffer and PageCode is ignored.
258 @param[in] PageCode The page code of the vital product data.
259 It's ignored if EnableVitalProductData is FALSE.
261 @retval EFI_SUCCESS The command executed successfully. See HostAdapterStatus,
262 TargetStatus, SenseDataLength, and SenseData in that order
263 for additional status information.
264 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
265 InquiryDataBuffer could not be transferred. The actual
266 number of bytes transferred is returned in InquiryDataLength.
267 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there
268 are too many SCSI Command Packets already queued.
269 The SCSI Request Packet was not sent, so no additional
270 status information is available. The caller may retry again later.
271 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI
272 Request Packet. See HostAdapterStatus, TargetStatus,
273 SenseDataLength, and SenseData in that order for additional
275 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not
276 supported by the SCSI initiator(i.e., SCSI Host Controller).
277 The SCSI Request Packet was not sent, so no additional
278 status information is available.
279 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
280 Packet to execute. See HostAdapterStatus, TargetStatus,
281 SenseDataLength, and SenseData in that order for
282 additional status information.
283 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
288 ScsiInquiryCommandEx (
289 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
291 IN OUT VOID
*SenseData OPTIONAL
,
292 IN OUT UINT8
*SenseDataLength
,
293 OUT UINT8
*HostAdapterStatus
,
294 OUT UINT8
*TargetStatus
,
295 IN OUT VOID
*InquiryDataBuffer OPTIONAL
,
296 IN OUT UINT32
*InquiryDataLength
,
297 IN BOOLEAN EnableVitalProductData
,
302 Execute Mode Sense(10) SCSI command on a specific SCSI target.
304 Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.
305 If Timeout is zero, then this function waits indefinitely for the command to complete.
306 If Timeout is greater than zero, then the command is executed and will timeout
307 after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters
308 are used to construct the CDB for this SCSI command.
309 If ScsiIo is NULL, then ASSERT().
310 If SenseDataLength is NULL, then ASSERT().
311 If HostAdapterStatus is NULL, then ASSERT().
312 If TargetStatus is NULL, then ASSERT().
313 If DataLength is NULL, then ASSERT().
315 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
316 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
319 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
320 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
323 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
324 for the specific SCSI target.
325 @param[in] Timeout The timeout in 100 ns units to use for the
326 execution of this SCSI Request Packet. A Timeout
327 value of zero means that this function will wait
328 indefinitely for the SCSI Request Packet to execute.
329 If Timeout is greater than zero, then this function
330 will return EFI_TIMEOUT if the time required to
331 execute the SCSI Request Packet is greater than Timeout.
332 @param[in, out] SenseData A pointer to sense data that was generated
333 by the execution of the SCSI Request Packet.
334 This buffer must be allocated by the caller.
335 If SenseDataLength is 0, then this parameter
336 is optional and may be NULL.
337 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
338 On output, the number of bytes written to the SenseData buffer.
339 @param[out] HostAdapterStatus The status of the SCSI Host Controller that
340 produces the SCSI bus containing the SCSI target
341 specified by ScsiIo when the SCSI Request Packet
342 was executed. See the EFI SCSI I/O Protocol in the
343 UEFI Specification for details on the possible
345 @param[out] TargetStatus The status returned by the SCSI target specified
346 by ScsiIo when the SCSI Request Packet was executed
347 on the SCSI Host Controller. See the EFI SCSI
348 I/O Protocol in the UEFI Specification for details
349 on the possible return values.
350 @param[in, out] DataBuffer A pointer to data that was generated by the
351 execution of the SCSI Request Packet. This
352 buffer must be allocated by the caller. If
353 DataLength is 0, then this parameter is optional
355 @param[in, out] DataLength On input, a pointer to the length in bytes of
356 the DataBuffer buffer. On output, a pointer
357 to the number of bytes written to the DataBuffer
359 @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.
360 @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command.
361 @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command.
363 @retval EFI_SUCCESS The command was executed successfully.
364 See HostAdapterStatus, TargetStatus, SenseDataLength,
365 and SenseData in that order for additional status information.
366 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the
367 entire DataBuffer could not be transferred.
368 The actual number of bytes transferred is returned
370 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
371 there are too many SCSI Command Packets already queued.
372 The SCSI Request Packet was not sent, so no additional
373 status information is available. The caller may retry
375 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
376 SCSI Request Packet. See HostAdapterStatus, TargetStatus,
377 SenseDataLength, and SenseData in that order for
378 additional status information.
379 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
380 is not supported by the SCSI initiator(i.e., SCSI
381 Host Controller). The SCSI Request Packet was not
382 sent, so no additional status information is available.
383 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
384 Request Packet to execute. See HostAdapterStatus,
385 TargetStatus, SenseDataLength, and SenseData in that
386 order for additional status information.
387 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
392 ScsiModeSense10Command (
393 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
395 IN OUT VOID
*SenseData OPTIONAL
,
396 IN OUT UINT8
*SenseDataLength
,
397 OUT UINT8
*HostAdapterStatus
,
398 OUT UINT8
*TargetStatus
,
399 IN OUT VOID
*DataBuffer OPTIONAL
,
400 IN OUT UINT32
*DataLength
,
401 IN UINT8 DBDField OPTIONAL
,
402 IN UINT8 PageControl
,
407 Execute Request Sense SCSI command on a specific SCSI target.
409 Executes the Request Sense command on the SCSI target specified by ScsiIo.
410 If Timeout is zero, then this function waits indefinitely for the command to complete.
411 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
412 If ScsiIo is NULL, then ASSERT().
413 If SenseDataLength is NULL, then ASSERT().
414 If HostAdapterStatus is NULL, then ASSERT().
415 If TargetStatus is NULL, then ASSERT().
417 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
418 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
421 @param[in] ScsiIo A pointer to SCSI IO protocol.
422 @param[in] Timeout The length of timeout period.
423 @param[in, out] SenseData A pointer to output sense data.
424 @param[in, out] SenseDataLength The length of output sense data.
425 @param[out] HostAdapterStatus The status of Host Adapter.
426 @param[out] TargetStatus The status of the target.
428 @retval EFI_SUCCESS Command is executed successfully.
429 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are
430 too many SCSI Command Packets already queued.
431 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
432 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
433 the SCSI initiator(i.e., SCSI Host Controller)
434 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
435 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
440 ScsiRequestSenseCommand (
441 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
443 IN OUT VOID
*SenseData OPTIONAL
,
444 IN OUT UINT8
*SenseDataLength
,
445 OUT UINT8
*HostAdapterStatus
,
446 OUT UINT8
*TargetStatus
450 Execute Read Capacity SCSI command on a specific SCSI target.
452 Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.
453 If Timeout is zero, then this function waits indefinitely for the command to complete.
454 If Timeout is greater than zero, then the command is executed and will timeout after
455 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.
456 If ScsiIo is NULL, then ASSERT().
457 If SenseDataLength is NULL, then ASSERT().
458 If HostAdapterStatus is NULL, then ASSERT().
459 If TargetStatus is NULL, then ASSERT().
460 If DataLength is NULL, then ASSERT().
462 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
463 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
466 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
467 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
470 @param[in] ScsiIo A pointer to SCSI IO protocol.
471 @param[in] Timeout The length of timeout period.
472 @param[in, out] SenseData A pointer to output sense data.
473 @param[in, out] SenseDataLength The length of output sense data.
474 @param[out] HostAdapterStatus The status of Host Adapter.
475 @param[out] TargetStatus The status of the target.
476 @param[in, out] DataBuffer A pointer to a data buffer.
477 @param[in, out] DataLength The length of data buffer.
478 @param[in] Pmi Partial medium indicator.
480 @retval EFI_SUCCESS Command is executed successfully.
481 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
482 DataBuffer could not be transferred. The actual
483 number of bytes transferred is returned in DataLength.
484 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
485 there are too many SCSI Command Packets already queued.
486 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
487 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
488 is not supported by the SCSI initiator(i.e., SCSI Host Controller)
489 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
490 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
495 ScsiReadCapacityCommand (
496 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
498 IN OUT VOID
*SenseData OPTIONAL
,
499 IN OUT UINT8
*SenseDataLength
,
500 OUT UINT8
*HostAdapterStatus
,
501 OUT UINT8
*TargetStatus
,
502 IN OUT VOID
*DataBuffer OPTIONAL
,
503 IN OUT UINT32
*DataLength
,
508 Execute Read Capacity SCSI 16 command on a specific SCSI target.
510 Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.
511 If Timeout is zero, then this function waits indefinitely for the command to complete.
512 If Timeout is greater than zero, then the command is executed and will timeout after
513 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.
514 If ScsiIo is NULL, then ASSERT().
515 If SenseDataLength is NULL, then ASSERT().
516 If HostAdapterStatus is NULL, then ASSERT().
517 If TargetStatus is NULL, then ASSERT().
518 If DataLength is NULL, then ASSERT().
520 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
521 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
524 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
525 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
528 @param[in] ScsiIo A pointer to SCSI IO protocol.
529 @param[in] Timeout The length of timeout period.
530 @param[in, out] SenseData A pointer to output sense data.
531 @param[in, out] SenseDataLength The length of output sense data.
532 @param[out] HostAdapterStatus The status of Host Adapter.
533 @param[out] TargetStatus The status of the target.
534 @param[in, out] DataBuffer A pointer to a data buffer.
535 @param[in, out] DataLength The length of data buffer.
536 @param[in] Pmi Partial medium indicator.
538 @retval EFI_SUCCESS Command is executed successfully.
539 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
540 DataBuffer could not be transferred. The actual
541 number of bytes transferred is returned in DataLength.
542 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
543 there are too many SCSI Command Packets already queued.
544 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
545 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
546 is not supported by the SCSI initiator(i.e., SCSI Host Controller)
547 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
548 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
553 ScsiReadCapacity16Command (
554 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
556 IN OUT VOID
*SenseData OPTIONAL
,
557 IN OUT UINT8
*SenseDataLength
,
558 OUT UINT8
*HostAdapterStatus
,
559 OUT UINT8
*TargetStatus
,
560 IN OUT VOID
*DataBuffer OPTIONAL
,
561 IN OUT UINT32
*DataLength
,
566 Execute Read(10) SCSI command on a specific SCSI target.
568 Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.
569 If Timeout is zero, then this function waits indefinitely for the command to complete.
570 If Timeout is greater than zero, then the command is executed and will timeout
571 after Timeout 100 ns units. The StartLba and SectorSize parameters are used to
572 construct the CDB for this SCSI command.
573 If ScsiIo is NULL, then ASSERT().
574 If SenseDataLength is NULL, then ASSERT().
575 If HostAdapterStatus is NULL, then ASSERT().
576 If TargetStatus is NULL, then ASSERT().
577 If DataLength is NULL, then ASSERT().
579 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
580 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
583 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
584 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
587 @param[in] ScsiIo A pointer to SCSI IO protocol.
588 @param[in] Timeout The length of timeout period.
589 @param[in, out] SenseData A pointer to output sense data.
590 @param[in, out] SenseDataLength The length of output sense data.
591 @param[out] HostAdapterStatus The status of Host Adapter.
592 @param[out] TargetStatus The status of the target.
593 @param[in, out] DataBuffer Read 10 command data.
594 @param[in, out] DataLength The length of data buffer.
595 @param[in] StartLba The start address of LBA.
596 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
598 @retval EFI_SUCCESS Command is executed successfully.
599 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
600 not be transferred. The actual number of bytes transferred is returned in DataLength.
601 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
602 SCSI Command Packets already queued.
603 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
604 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
605 the SCSI initiator(i.e., SCSI Host Controller)
606 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
607 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
613 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
615 IN OUT VOID
*SenseData OPTIONAL
,
616 IN OUT UINT8
*SenseDataLength
,
617 OUT UINT8
*HostAdapterStatus
,
618 OUT UINT8
*TargetStatus
,
619 IN OUT VOID
*DataBuffer OPTIONAL
,
620 IN OUT UINT32
*DataLength
,
626 Execute Write(10) SCSI command on a specific SCSI target.
628 Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.
629 If Timeout is zero, then this function waits indefinitely for the command to complete.
630 If Timeout is greater than zero, then the command is executed and will timeout after
631 Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct
632 the CDB for this SCSI command.
633 If ScsiIo is NULL, then ASSERT().
634 If SenseDataLength is NULL, then ASSERT().
635 If HostAdapterStatus is NULL, then ASSERT().
636 If TargetStatus is NULL, then ASSERT().
637 If DataLength is NULL, then ASSERT().
639 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
640 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
643 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
644 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
647 @param[in] ScsiIo SCSI IO Protocol to use
648 @param[in] Timeout The length of timeout period.
649 @param[in, out] SenseData A pointer to output sense data.
650 @param[in, out] SenseDataLength The length of output sense data.
651 @param[out] HostAdapterStatus The status of Host Adapter.
652 @param[out] TargetStatus The status of the target.
653 @param[in, out] DataBuffer A pointer to a data buffer.
654 @param[in, out] DataLength The length of data buffer.
655 @param[in] StartLba The start address of LBA.
656 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
658 @retval EFI_SUCCESS Command is executed successfully.
659 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
660 not be transferred. The actual number of bytes transferred is returned in DataLength.
661 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
662 SCSI Command Packets already queued.
663 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
664 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
665 the SCSI initiator(i.e., SCSI Host Controller)
666 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
667 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
673 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
675 IN OUT VOID
*SenseData OPTIONAL
,
676 IN OUT UINT8
*SenseDataLength
,
677 OUT UINT8
*HostAdapterStatus
,
678 OUT UINT8
*TargetStatus
,
679 IN OUT VOID
*DataBuffer OPTIONAL
,
680 IN OUT UINT32
*DataLength
,
686 Execute Read(16) SCSI command on a specific SCSI target.
688 Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.
689 If Timeout is zero, then this function waits indefinitely for the command to complete.
690 If Timeout is greater than zero, then the command is executed and will timeout
691 after Timeout 100 ns units. The StartLba and SectorSize parameters are used to
692 construct the CDB for this SCSI command.
693 If ScsiIo is NULL, then ASSERT().
694 If SenseDataLength is NULL, then ASSERT().
695 If HostAdapterStatus is NULL, then ASSERT().
696 If TargetStatus is NULL, then ASSERT().
697 If DataLength is NULL, then ASSERT().
699 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
700 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
703 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
704 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
707 @param[in] ScsiIo A pointer to SCSI IO protocol.
708 @param[in] Timeout The length of timeout period.
709 @param[in, out] SenseData A pointer to output sense data.
710 @param[in, out] SenseDataLength The length of output sense data.
711 @param[out] HostAdapterStatus The status of Host Adapter.
712 @param[out] TargetStatus The status of the target.
713 @param[in, out] DataBuffer Read 16 command data.
714 @param[in, out] DataLength The length of data buffer.
715 @param[in] StartLba The start address of LBA.
716 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
718 @retval EFI_SUCCESS Command is executed successfully.
719 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
720 not be transferred. The actual number of bytes transferred is returned in DataLength.
721 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
722 SCSI Command Packets already queued.
723 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
724 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
725 the SCSI initiator(i.e., SCSI Host Controller)
726 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
727 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
733 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
735 IN OUT VOID
*SenseData OPTIONAL
,
736 IN OUT UINT8
*SenseDataLength
,
737 OUT UINT8
*HostAdapterStatus
,
738 OUT UINT8
*TargetStatus
,
739 IN OUT VOID
*DataBuffer OPTIONAL
,
740 IN OUT UINT32
*DataLength
,
746 Execute Write(16) SCSI command on a specific SCSI target.
748 Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.
749 If Timeout is zero, then this function waits indefinitely for the command to complete.
750 If Timeout is greater than zero, then the command is executed and will timeout after
751 Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct
752 the CDB for this SCSI command.
753 If ScsiIo is NULL, then ASSERT().
754 If SenseDataLength is NULL, then ASSERT().
755 If HostAdapterStatus is NULL, then ASSERT().
756 If TargetStatus is NULL, then ASSERT().
757 If DataLength is NULL, then ASSERT().
759 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
760 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
763 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
764 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
767 @param[in] ScsiIo SCSI IO Protocol to use
768 @param[in] Timeout The length of timeout period.
769 @param[in, out] SenseData A pointer to output sense data.
770 @param[in, out] SenseDataLength The length of output sense data.
771 @param[out] HostAdapterStatus The status of Host Adapter.
772 @param[out] TargetStatus The status of the target.
773 @param[in, out] DataBuffer A pointer to a data buffer.
774 @param[in, out] DataLength The length of data buffer.
775 @param[in] StartLba The start address of LBA.
776 @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.
778 @retval EFI_SUCCESS Command is executed successfully.
779 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
780 not be transferred. The actual number of bytes transferred is returned in DataLength.
781 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
782 SCSI Command Packets already queued.
783 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
784 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
785 the SCSI initiator(i.e., SCSI Host Controller)
786 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
787 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
793 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
795 IN OUT VOID
*SenseData OPTIONAL
,
796 IN OUT UINT8
*SenseDataLength
,
797 OUT UINT8
*HostAdapterStatus
,
798 OUT UINT8
*TargetStatus
,
799 IN OUT VOID
*DataBuffer OPTIONAL
,
800 IN OUT UINT32
*DataLength
,
806 Execute Security Protocol In SCSI command on a specific SCSI target.
808 Executes the SCSI Security Protocol In command on the SCSI target specified by ScsiIo.
809 If Timeout is zero, then this function waits indefinitely for the command to complete.
810 If Timeout is greater than zero, then the command is executed and will timeout after
811 Timeout 100 ns units.
812 If ScsiIo is NULL, then ASSERT().
813 If SenseDataLength is NULL, then ASSERT().
814 If HostAdapterStatus is NULL, then ASSERT().
815 If TargetStatus is NULL, then ASSERT().
816 If TransferLength is NULL, then ASSERT().
818 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
819 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
822 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
823 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
826 @param[in] ScsiIo SCSI IO Protocol to use.
827 @param[in] Timeout The length of timeout period.
828 @param[in, out] SenseData A pointer to output sense data.
829 @param[in, out] SenseDataLength The length of output sense data.
830 @param[out] HostAdapterStatus The status of Host Adapter.
831 @param[out] TargetStatus The status of the target.
832 @param[in] SecurityProtocol The Security Protocol to use.
833 @param[in] SecurityProtocolSpecific The Security Protocol Specific data.
834 @param[in] Inc512 If TRUE, 512 increment (INC_512) bit will be set for the
835 SECURITY PROTOCOL IN command.
836 @param[in] DataLength The size in bytes of the data buffer.
837 @param[in, out] DataBuffer A pointer to a data buffer.
838 @param[out] TransferLength A pointer to a buffer to store the size in
839 bytes of the data written to the data buffer.
841 @retval EFI_SUCCESS Command is executed successfully.
842 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
843 not be transferred. The actual number of bytes transferred is returned in TransferLength.
844 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
845 SCSI Command Packets already queued.
846 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
847 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
848 the SCSI initiator(i.e., SCSI Host Controller)
849 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
850 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
855 ScsiSecurityProtocolInCommand (
856 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
858 IN OUT VOID
*SenseData OPTIONAL
,
859 IN OUT UINT8
*SenseDataLength
,
860 OUT UINT8
*HostAdapterStatus
,
861 OUT UINT8
*TargetStatus
,
862 IN UINT8 SecurityProtocol
,
863 IN UINT16 SecurityProtocolSpecific
,
866 IN OUT VOID
*DataBuffer OPTIONAL
,
867 OUT UINTN
*TransferLength
871 Execute Security Protocol Out SCSI command on a specific SCSI target.
873 Executes the SCSI Security Protocol Out command on the SCSI target specified by ScsiIo.
874 If Timeout is zero, then this function waits indefinitely for the command to complete.
875 If Timeout is greater than zero, then the command is executed and will timeout after
876 Timeout 100 ns units.
877 If ScsiIo is NULL, then ASSERT().
878 If SenseDataLength is NULL, then ASSERT().
879 If HostAdapterStatus is NULL, then ASSERT().
880 If TargetStatus is NULL, then ASSERT().
882 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer
883 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
886 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer
887 alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER
890 @param[in] ScsiIo SCSI IO Protocol to use.
891 @param[in] Timeout The length of timeout period.
892 @param[in, out] SenseData A pointer to output sense data.
893 @param[in, out] SenseDataLength The length of output sense data.
894 @param[out] HostAdapterStatus The status of Host Adapter.
895 @param[out] TargetStatus The status of the target.
896 @param[in] SecurityProtocol The Security Protocol to use.
897 @param[in] SecurityProtocolSpecific The Security Protocol Specific data.
898 @param[in] Inc512 If TRUE, 512 increment (INC_512) bit will be set for the
899 SECURITY PROTOCOL OUT command.
900 @param[in] DataLength The size in bytes of the transfer data.
901 @param[in, out] DataBuffer A pointer to a data buffer.
903 @retval EFI_SUCCESS Command is executed successfully.
904 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
905 not be transferred. The actual number of bytes transferred is returned in DataLength.
906 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
907 SCSI Command Packets already queued.
908 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
909 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
910 the SCSI initiator(i.e., SCSI Host Controller)
911 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
912 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.
917 ScsiSecurityProtocolOutCommand (
918 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
920 IN OUT VOID
*SenseData OPTIONAL
,
921 IN OUT UINT8
*SenseDataLength
,
922 OUT UINT8
*HostAdapterStatus
,
923 OUT UINT8
*TargetStatus
,
924 IN UINT8 SecurityProtocol
,
925 IN UINT16 SecurityProtocolSpecific
,
928 IN OUT VOID
*DataBuffer OPTIONAL
932 Execute blocking/non-blocking Read(10) SCSI command on a specific SCSI
935 Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.
936 When Event is NULL, blocking command will be executed. Otherwise non-blocking
937 command will be executed.
938 For blocking I/O, if Timeout is zero, this function will wait indefinitely
939 for the command to complete. If Timeout is greater than zero, then the
940 command is executed and will timeout after Timeout 100 ns units.
941 For non-blocking I/O, if Timeout is zero, Event will be signaled only after
942 the command to completes. If Timeout is greater than zero, Event will also be
943 signaled after Timeout 100 ns units.
944 The StartLba and SectorSize parameters are used to construct the CDB for this
947 If ScsiIo is NULL, then ASSERT().
948 If SenseDataLength is NULL, then ASSERT().
949 If HostAdapterStatus is NULL, then ASSERT().
950 If TargetStatus is NULL, then ASSERT().
951 If DataLength is NULL, then ASSERT().
953 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
954 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
955 EFI_INVALID_PARAMETER gets returned.
957 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
958 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
959 EFI_INVALID_PARAMETER gets returned.
961 @param[in] ScsiIo A pointer to SCSI IO protocol.
962 @param[in] Timeout The length of timeout period.
963 @param[in, out] SenseData A pointer to output sense data.
964 @param[in, out] SenseDataLength The length of output sense data.
965 @param[out] HostAdapterStatus The status of Host Adapter.
966 @param[out] TargetStatus The status of the target.
967 @param[in, out] DataBuffer Read 16 command data.
968 @param[in, out] DataLength The length of data buffer.
969 @param[in] StartLba The start address of LBA.
970 @param[in] SectorSize The number of contiguous logical blocks
971 of data that shall be transferred.
972 @param[in] Event If the SCSI target does not support
973 non-blocking I/O, then Event is ignored,
974 and blocking I/O is performed. If Event
975 is NULL, then blocking I/O is performed.
976 If Event is not NULL and non-blocking
977 I/O is supported, then non-blocking I/O
978 is performed, and Event will be signaled
979 when the SCSI Read(10) command
982 @retval EFI_SUCCESS Command is executed successfully.
983 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
984 but the entire DataBuffer could not be
985 transferred. The actual number of bytes
986 transferred is returned in DataLength.
987 @retval EFI_NOT_READY The SCSI Request Packet could not be
988 sent because there are too many SCSI
989 Command Packets already queued.
990 @retval EFI_DEVICE_ERROR A device error occurred while attempting
991 to send SCSI Request Packet.
992 @retval EFI_UNSUPPORTED The command described by the SCSI
993 Request Packet is not supported by the
994 SCSI initiator(i.e., SCSI Host
996 @retval EFI_TIMEOUT A timeout occurred while waiting for the
997 SCSI Request Packet to execute.
998 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
1000 @retval EFI_OUT_OF_RESOURCES The request could not be completed due
1001 to a lack of resources.
1006 ScsiRead10CommandEx (
1007 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
1009 IN OUT VOID
*SenseData OPTIONAL
,
1010 IN OUT UINT8
*SenseDataLength
,
1011 OUT UINT8
*HostAdapterStatus
,
1012 OUT UINT8
*TargetStatus
,
1013 IN OUT VOID
*DataBuffer OPTIONAL
,
1014 IN OUT UINT32
*DataLength
,
1016 IN UINT32 SectorSize
,
1017 IN EFI_EVENT Event OPTIONAL
1021 Execute blocking/non-blocking Write(10) SCSI command on a specific SCSI
1024 Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.
1025 When Event is NULL, blocking command will be executed. Otherwise non-blocking
1026 command will be executed.
1027 For blocking I/O, if Timeout is zero, this function will wait indefinitely
1028 for the command to complete. If Timeout is greater than zero, then the
1029 command is executed and will timeout after Timeout 100 ns units.
1030 For non-blocking I/O, if Timeout is zero, Event will be signaled only after
1031 the command to completes. If Timeout is greater than zero, Event will also be
1032 signaled after Timeout 100 ns units.
1033 The StartLba and SectorSize parameters are used to construct the CDB for this
1036 If ScsiIo is NULL, then ASSERT().
1037 If SenseDataLength is NULL, then ASSERT().
1038 If HostAdapterStatus is NULL, then ASSERT().
1039 If TargetStatus is NULL, then ASSERT().
1040 If DataLength is NULL, then ASSERT().
1042 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
1043 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
1044 EFI_INVALID_PARAMETER gets returned.
1046 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
1047 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
1048 EFI_INVALID_PARAMETER gets returned.
1050 @param[in] ScsiIo SCSI IO Protocol to use
1051 @param[in] Timeout The length of timeout period.
1052 @param[in, out] SenseData A pointer to output sense data.
1053 @param[in, out] SenseDataLength The length of output sense data.
1054 @param[out] HostAdapterStatus The status of Host Adapter.
1055 @param[out] TargetStatus The status of the target.
1056 @param[in, out] DataBuffer A pointer to a data buffer.
1057 @param[in, out] DataLength The length of data buffer.
1058 @param[in] StartLba The start address of LBA.
1059 @param[in] SectorSize The number of contiguous logical blocks
1060 of data that shall be transferred.
1061 @param[in] Event If the SCSI target does not support
1062 non-blocking I/O, then Event is ignored,
1063 and blocking I/O is performed. If Event
1064 is NULL, then blocking I/O is performed.
1065 If Event is not NULL and non-blocking
1066 I/O is supported, then non-blocking I/O
1067 is performed, and Event will be signaled
1068 when the SCSI Write(10) command
1071 @retval EFI_SUCCESS Command is executed successfully.
1072 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
1073 but the entire DataBuffer could not be
1074 transferred. The actual number of bytes
1075 transferred is returned in DataLength.
1076 @retval EFI_NOT_READY The SCSI Request Packet could not be
1077 sent because there are too many SCSI
1078 Command Packets already queued.
1079 @retval EFI_DEVICE_ERROR A device error occurred while attempting
1080 to send SCSI Request Packet.
1081 @retval EFI_UNSUPPORTED The command described by the SCSI
1082 Request Packet is not supported by the
1083 SCSI initiator(i.e., SCSI Host
1085 @retval EFI_TIMEOUT A timeout occurred while waiting for the
1086 SCSI Request Packet to execute.
1087 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
1089 @retval EFI_OUT_OF_RESOURCES The request could not be completed due
1090 to a lack of resources.
1095 ScsiWrite10CommandEx (
1096 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
1098 IN OUT VOID
*SenseData OPTIONAL
,
1099 IN OUT UINT8
*SenseDataLength
,
1100 OUT UINT8
*HostAdapterStatus
,
1101 OUT UINT8
*TargetStatus
,
1102 IN OUT VOID
*DataBuffer OPTIONAL
,
1103 IN OUT UINT32
*DataLength
,
1105 IN UINT32 SectorSize
,
1106 IN EFI_EVENT Event OPTIONAL
1110 Execute blocking/non-blocking Read(16) SCSI command on a specific SCSI
1113 Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.
1114 When Event is NULL, blocking command will be executed. Otherwise non-blocking
1115 command will be executed.
1116 For blocking I/O, if Timeout is zero, this function will wait indefinitely
1117 for the command to complete. If Timeout is greater than zero, then the
1118 command is executed and will timeout after Timeout 100 ns units.
1119 For non-blocking I/O, if Timeout is zero, Event will be signaled only after
1120 the command to completes. If Timeout is greater than zero, Event will also be
1121 signaled after Timeout 100 ns units.
1122 The StartLba and SectorSize parameters are used to construct the CDB for this
1125 If ScsiIo is NULL, then ASSERT().
1126 If SenseDataLength is NULL, then ASSERT().
1127 If HostAdapterStatus is NULL, then ASSERT().
1128 If TargetStatus is NULL, then ASSERT().
1129 If DataLength is NULL, then ASSERT().
1131 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
1132 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
1133 EFI_INVALID_PARAMETER gets returned.
1135 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
1136 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
1137 EFI_INVALID_PARAMETER gets returned.
1139 @param[in] ScsiIo A pointer to SCSI IO protocol.
1140 @param[in] Timeout The length of timeout period.
1141 @param[in, out] SenseData A pointer to output sense data.
1142 @param[in, out] SenseDataLength The length of output sense data.
1143 @param[out] HostAdapterStatus The status of Host Adapter.
1144 @param[out] TargetStatus The status of the target.
1145 @param[in, out] DataBuffer Read 16 command data.
1146 @param[in, out] DataLength The length of data buffer.
1147 @param[in] StartLba The start address of LBA.
1148 @param[in] SectorSize The number of contiguous logical blocks
1149 of data that shall be transferred.
1150 @param[in] Event If the SCSI target does not support
1151 non-blocking I/O, then Event is ignored,
1152 and blocking I/O is performed. If Event
1153 is NULL, then blocking I/O is performed.
1154 If Event is not NULL and non-blocking
1155 I/O is supported, then non-blocking I/O
1156 is performed, and Event will be signaled
1157 when the SCSI Read(16) command
1160 @retval EFI_SUCCESS Command is executed successfully.
1161 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
1162 but the entire DataBuffer could not be
1163 transferred. The actual number of bytes
1164 transferred is returned in DataLength.
1165 @retval EFI_NOT_READY The SCSI Request Packet could not be
1166 sent because there are too many SCSI
1167 Command Packets already queued.
1168 @retval EFI_DEVICE_ERROR A device error occurred while attempting
1169 to send SCSI Request Packet.
1170 @retval EFI_UNSUPPORTED The command described by the SCSI
1171 Request Packet is not supported by the
1172 SCSI initiator(i.e., SCSI Host
1174 @retval EFI_TIMEOUT A timeout occurred while waiting for the
1175 SCSI Request Packet to execute.
1176 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
1178 @retval EFI_OUT_OF_RESOURCES The request could not be completed due
1179 to a lack of resources.
1184 ScsiRead16CommandEx (
1185 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
1187 IN OUT VOID
*SenseData OPTIONAL
,
1188 IN OUT UINT8
*SenseDataLength
,
1189 OUT UINT8
*HostAdapterStatus
,
1190 OUT UINT8
*TargetStatus
,
1191 IN OUT VOID
*DataBuffer OPTIONAL
,
1192 IN OUT UINT32
*DataLength
,
1194 IN UINT32 SectorSize
,
1195 IN EFI_EVENT Event OPTIONAL
1199 Execute blocking/non-blocking Write(16) SCSI command on a specific SCSI
1202 Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.
1203 When Event is NULL, blocking command will be executed. Otherwise non-blocking
1204 command will be executed.
1205 For blocking I/O, if Timeout is zero, this function will wait indefinitely
1206 for the command to complete. If Timeout is greater than zero, then the
1207 command is executed and will timeout after Timeout 100 ns units.
1208 For non-blocking I/O, if Timeout is zero, Event will be signaled only after
1209 the command to completes. If Timeout is greater than zero, Event will also be
1210 signaled after Timeout 100 ns units.
1211 The StartLba and SectorSize parameters are used to construct the CDB for this
1214 If ScsiIo is NULL, then ASSERT().
1215 If SenseDataLength is NULL, then ASSERT().
1216 If HostAdapterStatus is NULL, then ASSERT().
1217 If TargetStatus is NULL, then ASSERT().
1218 If DataLength is NULL, then ASSERT().
1220 If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet
1221 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
1222 EFI_INVALID_PARAMETER gets returned.
1224 If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet
1225 buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise
1226 EFI_INVALID_PARAMETER gets returned.
1228 @param[in] ScsiIo SCSI IO Protocol to use
1229 @param[in] Timeout The length of timeout period.
1230 @param[in, out] SenseData A pointer to output sense data.
1231 @param[in, out] SenseDataLength The length of output sense data.
1232 @param[out] HostAdapterStatus The status of Host Adapter.
1233 @param[out] TargetStatus The status of the target.
1234 @param[in, out] DataBuffer A pointer to a data buffer.
1235 @param[in, out] DataLength The length of data buffer.
1236 @param[in] StartLba The start address of LBA.
1237 @param[in] SectorSize The number of contiguous logical blocks
1238 of data that shall be transferred.
1239 @param[in] Event If the SCSI target does not support
1240 non-blocking I/O, then Event is ignored,
1241 and blocking I/O is performed. If Event
1242 is NULL, then blocking I/O is performed.
1243 If Event is not NULL and non-blocking
1244 I/O is supported, then non-blocking I/O
1245 is performed, and Event will be signaled
1246 when the SCSI Write(16) command
1249 @retval EFI_SUCCESS Command is executed successfully.
1250 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
1251 but the entire DataBuffer could not be
1252 transferred. The actual number of bytes
1253 transferred is returned in DataLength.
1254 @retval EFI_NOT_READY The SCSI Request Packet could not be
1255 sent because there are too many SCSI
1256 Command Packets already queued.
1257 @retval EFI_DEVICE_ERROR A device error occurred while attempting
1258 to send SCSI Request Packet.
1259 @retval EFI_UNSUPPORTED The command described by the SCSI
1260 Request Packet is not supported by the
1261 SCSI initiator(i.e., SCSI Host
1263 @retval EFI_TIMEOUT A timeout occurred while waiting for the
1264 SCSI Request Packet to execute.
1265 @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet
1267 @retval EFI_OUT_OF_RESOURCES The request could not be completed due
1268 to a lack of resources.
1273 ScsiWrite16CommandEx (
1274 IN EFI_SCSI_IO_PROTOCOL
*ScsiIo
,
1276 IN OUT VOID
*SenseData OPTIONAL
,
1277 IN OUT UINT8
*SenseDataLength
,
1278 OUT UINT8
*HostAdapterStatus
,
1279 OUT UINT8
*TargetStatus
,
1280 IN OUT VOID
*DataBuffer OPTIONAL
,
1281 IN OUT UINT32
*DataLength
,
1283 IN UINT32 SectorSize
,
1284 IN EFI_EVENT Event OPTIONAL