]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/UefiScsiLib.h
Add 2 functions to UefiLib library class: CatSPrint and CatVSPrint.
[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 - 2011, Intel Corporation. All rights reserved.<BR>
9 This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 **/
18
19 #ifndef __SCSI_LIB_H__
20 #define __SCSI_LIB_H__
21
22 #include <Protocol/ScsiIo.h>
23
24 /**
25 Execute Test Unit Ready SCSI command on a specific SCSI target.
26
27 Executes the Test Unit Ready command on the SCSI target specified by ScsiIo.
28 If Timeout is zero, then this function waits indefinitely for the command to complete.
29 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
30 If ScsiIo is NULL, then ASSERT().
31 If SenseDataLength is NULL, then ASSERT().
32 If HostAdapterStatus is NULL, then ASSERT().
33 If TargetStatus is NULL, then ASSERT().
34
35
36 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
37 for the specific SCSI target.
38 @param[in] Timeout The timeout in 100 ns units to use for the execution
39 of this SCSI Request Packet. A Timeout value of
40 zero means that this function will wait indefinitely
41 for the SCSI Request Packet to execute. If Timeout
42 is greater than zero, then this function will return
43 EFI_TIMEOUT if the time required to execute the SCSI
44 Request Packet is greater than Timeout.
45 @param[in, out] SenseData A pointer to sense data that was generated by
46 the execution of the SCSI Request Packet. This
47 buffer must be allocated by the caller.
48 If SenseDataLength is 0, then this parameter is
49 optional and may be NULL.
50 @param[in, out] SenseDataLength On input, a pointer to the length in bytes of
51 the SenseData buffer. On output, a pointer to
52 the number of bytes written to the SenseData buffer.
53 @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces
54 the SCSI bus containing the SCSI target specified by
55 ScsiIo when the SCSI Request Packet was executed.
56 See the EFI SCSI I/O Protocol in the UEFI Specification
57 for details on the possible return values.
58 @param[out] TargetStatus The status returned by the SCSI target specified
59 by ScsiIo when the SCSI Request Packet was executed
60 on the SCSI Host Controller. See the EFI SCSI I/O
61 Protocol in the UEFI Specification for details on
62 the possible return values.
63
64 @retval EFI_SUCCESS The command was executed successfully.
65 See HostAdapterStatus, TargetStatus, SenseDataLength,
66 and SenseData in that order for additional status
67 information.
68 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
69 there are too many SCSI Command Packets already
70 queued. The SCSI Request Packet was not sent, so
71 no additional status information is available.
72 The caller may retry again later.
73 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
74 SCSI Request Packet. See HostAdapterStatus,
75 TargetStatus, SenseDataLength, and SenseData in that
76 order for additional status information.
77 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
78 is not supported by the SCSI initiator(i.e., SCSI
79 Host Controller). The SCSI Request Packet was not
80 sent, so no additional status information is available.
81 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
82 Packet to execute. See HostAdapterStatus, TargetStatus,
83 SenseDataLength, and SenseData in that order for
84 additional status information.
85
86 **/
87 EFI_STATUS
88 EFIAPI
89 ScsiTestUnitReadyCommand (
90 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
91 IN UINT64 Timeout,
92 IN OUT VOID *SenseData, OPTIONAL
93 IN OUT UINT8 *SenseDataLength,
94 OUT UINT8 *HostAdapterStatus,
95 OUT UINT8 *TargetStatus
96 );
97
98
99 /**
100 Execute Inquiry SCSI command on a specific SCSI target.
101
102 Executes the Inquiry command on the SCSI target specified by ScsiIo.
103 If Timeout is zero, then this function waits indefinitely for the command to complete.
104 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
105 If ScsiIo is NULL, then ASSERT().
106 If SenseDataLength is NULL, then ASSERT().
107 If HostAdapterStatus is NULL, then ASSERT().
108 If TargetStatus is NULL, then ASSERT().
109 If InquiryDataLength is NULL, then ASSERT().
110
111 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
112 for the specific SCSI target.
113 @param[in] Timeout The timeout in 100 ns units to use for the
114 execution of this SCSI Request Packet. A Timeout
115 value of zero means that this function will wait
116 indefinitely for the SCSI Request Packet to execute.
117 If Timeout is greater than zero, then this function
118 will return EFI_TIMEOUT if the time required to
119 execute the SCSI Request Packet is greater than Timeout.
120 @param[in, out] SenseData A pointer to sense data that was generated
121 by the execution of the SCSI Request Packet.
122 This buffer must be allocated by the caller.
123 If SenseDataLength is 0, then this parameter
124 is optional and may be NULL.
125 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
126 On output, the number of bytes written to the SenseData buffer.
127 @param[out] HostAdapterStatus The status of the SCSI Host Controller that
128 produces the SCSI bus containing the SCSI
129 target specified by ScsiIo when the SCSI
130 Request Packet was executed. See the EFI
131 SCSI I/O Protocol in the UEFI Specification
132 for details on the possible return values.
133 @param[out] TargetStatus The status returned by the SCSI target specified
134 by ScsiIo when the SCSI Request Packet was
135 executed on the SCSI Host Controller.
136 See the EFI SCSI I/O Protocol in the UEFI
137 Specification for details on the possible
138 return values.
139 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated
140 by the execution of the SCSI Request Packet.
141 This buffer must be allocated by the caller.
142 If InquiryDataLength is 0, then this parameter
143 is optional and may be NULL.
144 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes
145 of the InquiryDataBuffer buffer.
146 On output, a pointer to the number of bytes
147 written to the InquiryDataBuffer buffer.
148 @param[in] EnableVitalProductData If TRUE, then the supported vital product
149 data is returned in InquiryDataBuffer.
150 If FALSE, then the standard inquiry data is
151 returned in InquiryDataBuffer.
152
153 @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,
154 TargetStatus, SenseDataLength, and SenseData in that order
155 for additional status information.
156 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
157 InquiryDataBuffer could not be transferred. The actual
158 number of bytes transferred is returned in InquiryDataLength.
159 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there
160 are too many SCSI Command Packets already queued.
161 The SCSI Request Packet was not sent, so no additional
162 status information is available. The caller may retry again later.
163 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI
164 Request Packet. See HostAdapterStatus, TargetStatus,
165 SenseDataLength, and SenseData in that order for additional
166 status information.
167 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not
168 supported by the SCSI initiator(i.e., SCSI Host Controller).
169 The SCSI Request Packet was not sent, so no additional
170 status information is available.
171 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
172 Packet to execute. See HostAdapterStatus, TargetStatus,
173 SenseDataLength, and SenseData in that order for
174 additional status information.
175
176 **/
177 EFI_STATUS
178 EFIAPI
179 ScsiInquiryCommand (
180 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
181 IN UINT64 Timeout,
182 IN OUT VOID *SenseData, OPTIONAL
183 IN OUT UINT8 *SenseDataLength,
184 OUT UINT8 *HostAdapterStatus,
185 OUT UINT8 *TargetStatus,
186 IN OUT VOID *InquiryDataBuffer, OPTIONAL
187 IN OUT UINT32 *InquiryDataLength,
188 IN BOOLEAN EnableVitalProductData
189 );
190
191
192 /**
193 Execute Inquiry SCSI command on a specific SCSI target.
194
195 Executes the Inquiry command on the SCSI target specified by ScsiIo.
196 If Timeout is zero, then this function waits indefinitely for the command to complete.
197 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
198 If ScsiIo is NULL, then ASSERT().
199 If SenseDataLength is NULL, then ASSERT().
200 If HostAdapterStatus is NULL, then ASSERT().
201 If TargetStatus is NULL, then ASSERT().
202 If InquiryDataLength is NULL, then ASSERT().
203
204 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
205 for the specific SCSI target.
206 @param[in] Timeout The timeout in 100 ns units to use for the
207 execution of this SCSI Request Packet. A Timeout
208 value of zero means that this function will wait
209 indefinitely for the SCSI Request Packet to execute.
210 If Timeout is greater than zero, then this function
211 will return EFI_TIMEOUT if the time required to
212 execute the SCSI Request Packet is greater than Timeout.
213 @param[in, out] SenseData A pointer to sense data that was generated
214 by the execution of the SCSI Request Packet.
215 This buffer must be allocated by the caller.
216 If SenseDataLength is 0, then this parameter
217 is optional and may be NULL.
218 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
219 On output, the number of bytes written to the SenseData buffer.
220 @param[out] HostAdapterStatus The status of the SCSI Host Controller that
221 produces the SCSI bus containing the SCSI
222 target specified by ScsiIo when the SCSI
223 Request Packet was executed. See the EFI
224 SCSI I/O Protocol in the UEFI Specification
225 for details on the possible return values.
226 @param[out] TargetStatus The status returned by the SCSI target specified
227 by ScsiIo when the SCSI Request Packet was
228 executed on the SCSI Host Controller.
229 See the EFI SCSI I/O Protocol in the UEFI
230 Specification for details on the possible
231 return values.
232 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated
233 by the execution of the SCSI Request Packet.
234 This buffer must be allocated by the caller.
235 If InquiryDataLength is 0, then this parameter
236 is optional and may be NULL.
237 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes
238 of the InquiryDataBuffer buffer.
239 On output, a pointer to the number of bytes
240 written to the InquiryDataBuffer buffer.
241 @param[in] EnableVitalProductData If TRUE, then the supported vital product
242 data for the PageCode is returned in InquiryDataBuffer.
243 If FALSE, then the standard inquiry data is
244 returned in InquiryDataBuffer and PageCode is ignored.
245 @param[in] PageCode The page code of the vital product data.
246 It's ignored if EnableVitalProductData is FALSE.
247
248 @retval EFI_SUCCESS The command executed successfully. See HostAdapterStatus,
249 TargetStatus, SenseDataLength, and SenseData in that order
250 for additional status information.
251 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
252 InquiryDataBuffer could not be transferred. The actual
253 number of bytes transferred is returned in InquiryDataLength.
254 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there
255 are too many SCSI Command Packets already queued.
256 The SCSI Request Packet was not sent, so no additional
257 status information is available. The caller may retry again later.
258 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI
259 Request Packet. See HostAdapterStatus, TargetStatus,
260 SenseDataLength, and SenseData in that order for additional
261 status information.
262 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not
263 supported by the SCSI initiator(i.e., SCSI Host Controller).
264 The SCSI Request Packet was not sent, so no additional
265 status information is available.
266 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request
267 Packet to execute. See HostAdapterStatus, TargetStatus,
268 SenseDataLength, and SenseData in that order for
269 additional status information.
270
271 **/
272 EFI_STATUS
273 EFIAPI
274 ScsiInquiryCommandEx (
275 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
276 IN UINT64 Timeout,
277 IN OUT VOID *SenseData, OPTIONAL
278 IN OUT UINT8 *SenseDataLength,
279 OUT UINT8 *HostAdapterStatus,
280 OUT UINT8 *TargetStatus,
281 IN OUT VOID *InquiryDataBuffer, OPTIONAL
282 IN OUT UINT32 *InquiryDataLength,
283 IN BOOLEAN EnableVitalProductData,
284 IN UINT8 PageCode
285 );
286
287
288 /**
289 Execute Mode Sense(10) SCSI command on a specific SCSI target.
290
291 Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.
292 If Timeout is zero, then this function waits indefinitely for the command to complete.
293 If Timeout is greater than zero, then the command is executed and will timeout
294 after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters
295 are used to construct the CDB for this SCSI command.
296 If ScsiIo is NULL, then ASSERT().
297 If SenseDataLength is NULL, then ASSERT().
298 If HostAdapterStatus is NULL, then ASSERT().
299 If TargetStatus is NULL, then ASSERT().
300 If DataLength is NULL, then ASSERT().
301
302
303 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance
304 for the specific SCSI target.
305 @param[in] Timeout The timeout in 100 ns units to use for the
306 execution of this SCSI Request Packet. A Timeout
307 value of zero means that this function will wait
308 indefinitely for the SCSI Request Packet to execute.
309 If Timeout is greater than zero, then this function
310 will return EFI_TIMEOUT if the time required to
311 execute the SCSI Request Packet is greater than Timeout.
312 @param[in, out] SenseData A pointer to sense data that was generated
313 by the execution of the SCSI Request Packet.
314 This buffer must be allocated by the caller.
315 If SenseDataLength is 0, then this parameter
316 is optional and may be NULL.
317 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.
318 On output, the number of bytes written to the SenseData buffer.
319 @param[out] HostAdapterStatus The status of the SCSI Host Controller that
320 produces the SCSI bus containing the SCSI target
321 specified by ScsiIo when the SCSI Request Packet
322 was executed. See the EFI SCSI I/O Protocol in the
323 UEFI Specification for details on the possible
324 return values.
325 @param[out] TargetStatus The status returned by the SCSI target specified
326 by ScsiIo when the SCSI Request Packet was executed
327 on the SCSI Host Controller. See the EFI SCSI
328 I/O Protocol in the UEFI Specification for details
329 on the possible return values.
330 @param[in, out] DataBuffer A pointer to data that was generated by the
331 execution of the SCSI Request Packet. This
332 buffer must be allocated by the caller. If
333 DataLength is 0, then this parameter is optional
334 and may be NULL.
335 @param[in, out] DataLength On input, a pointer to the length in bytes of
336 the DataBuffer buffer. On output, a pointer
337 to the number of bytes written to the DataBuffer
338 buffer.
339 @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.
340 @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command.
341 @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command.
342
343 @retval EFI_SUCCESS The command was executed successfully.
344 See HostAdapterStatus, TargetStatus, SenseDataLength,
345 and SenseData in that order for additional status information.
346 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the
347 entire DataBuffer could not be transferred.
348 The actual number of bytes transferred is returned
349 in DataLength.
350 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
351 there are too many SCSI Command Packets already queued.
352 The SCSI Request Packet was not sent, so no additional
353 status information is available. The caller may retry
354 again later.
355 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send
356 SCSI Request Packet. See HostAdapterStatus, TargetStatus,
357 SenseDataLength, and SenseData in that order for
358 additional status information.
359 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
360 is not supported by the SCSI initiator(i.e., SCSI
361 Host Controller). The SCSI Request Packet was not
362 sent, so no additional status information is available.
363 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
364 Request Packet to execute. See HostAdapterStatus,
365 TargetStatus, SenseDataLength, and SenseData in that
366 order for additional status information.
367
368 **/
369 EFI_STATUS
370 EFIAPI
371 ScsiModeSense10Command (
372 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
373 IN UINT64 Timeout,
374 IN OUT VOID *SenseData, OPTIONAL
375 IN OUT UINT8 *SenseDataLength,
376 OUT UINT8 *HostAdapterStatus,
377 OUT UINT8 *TargetStatus,
378 IN OUT VOID *DataBuffer, OPTIONAL
379 IN OUT UINT32 *DataLength,
380 IN UINT8 DBDField, OPTIONAL
381 IN UINT8 PageControl,
382 IN UINT8 PageCode
383 );
384
385
386
387 /**
388 Execute Request Sense SCSI command on a specific SCSI target.
389
390 Executes the Request Sense command on the SCSI target specified by ScsiIo.
391 If Timeout is zero, then this function waits indefinitely for the command to complete.
392 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.
393 If ScsiIo is NULL, then ASSERT().
394 If SenseDataLength is NULL, then ASSERT().
395 If HostAdapterStatus is NULL, then ASSERT().
396 If TargetStatus is NULL, then ASSERT().
397
398 @param[in] ScsiIo A pointer to SCSI IO protocol.
399 @param[in] Timeout The length of timeout period.
400 @param[in, out] SenseData A pointer to output sense data.
401 @param[in, out] SenseDataLength The length of output sense data.
402 @param[out] HostAdapterStatus The status of Host Adapter.
403 @param[out] TargetStatus The status of the target.
404
405 @retval EFI_SUCCESS Command is executed successfully.
406 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are
407 too many SCSI Command Packets already queued.
408 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
409 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
410 the SCSI initiator(i.e., SCSI Host Controller)
411 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
412
413 **/
414 EFI_STATUS
415 EFIAPI
416 ScsiRequestSenseCommand (
417 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
418 IN UINT64 Timeout,
419 IN OUT VOID *SenseData, OPTIONAL
420 IN OUT UINT8 *SenseDataLength,
421 OUT UINT8 *HostAdapterStatus,
422 OUT UINT8 *TargetStatus
423 );
424
425
426 /**
427 Execute Read Capacity SCSI command on a specific SCSI target.
428
429 Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.
430 If Timeout is zero, then this function waits indefinitely for the command to complete.
431 If Timeout is greater than zero, then the command is executed and will timeout after
432 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.
433 If ScsiIo is NULL, then ASSERT().
434 If SenseDataLength is NULL, then ASSERT().
435 If HostAdapterStatus is NULL, then ASSERT().
436 If TargetStatus is NULL, then ASSERT().
437 If DataLength is NULL, then ASSERT().
438
439 @param[in] ScsiIo A pointer to SCSI IO protocol.
440 @param[in] Timeout The length of timeout period.
441 @param[in, out] SenseData A pointer to output sense data.
442 @param[in, out] SenseDataLength The length of output sense data.
443 @param[out] HostAdapterStatus The status of Host Adapter.
444 @param[out] TargetStatus The status of the target.
445 @param[in, out] DataBuffer A pointer to a data buffer.
446 @param[in, out] DataLength The length of data buffer.
447 @param[in] Pmi Partial medium indicator.
448
449 @retval EFI_SUCCESS Command is executed successfully.
450 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
451 DataBuffer could not be transferred. The actual
452 number of bytes transferred is returned in DataLength.
453 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
454 there are too many SCSI Command Packets already queued.
455 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
456 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
457 is not supported by the SCSI initiator(i.e., SCSI Host Controller)
458 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
459
460 **/
461 EFI_STATUS
462 EFIAPI
463 ScsiReadCapacityCommand (
464 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
465 IN UINT64 Timeout,
466 IN OUT VOID *SenseData, OPTIONAL
467 IN OUT UINT8 *SenseDataLength,
468 OUT UINT8 *HostAdapterStatus,
469 OUT UINT8 *TargetStatus,
470 IN OUT VOID *DataBuffer, OPTIONAL
471 IN OUT UINT32 *DataLength,
472 IN BOOLEAN Pmi
473 );
474
475
476 /**
477 Execute Read Capacity SCSI 16 command on a specific SCSI target.
478
479 Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.
480 If Timeout is zero, then this function waits indefinitely for the command to complete.
481 If Timeout is greater than zero, then the command is executed and will timeout after
482 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.
483 If ScsiIo is NULL, then ASSERT().
484 If SenseDataLength is NULL, then ASSERT().
485 If HostAdapterStatus is NULL, then ASSERT().
486 If TargetStatus is NULL, then ASSERT().
487 If DataLength is NULL, then ASSERT().
488
489 @param[in] ScsiIo A pointer to SCSI IO protocol.
490 @param[in] Timeout The length of timeout period.
491 @param[in, out] SenseData A pointer to output sense data.
492 @param[in, out] SenseDataLength The length of output sense data.
493 @param[out] HostAdapterStatus The status of Host Adapter.
494 @param[out] TargetStatus The status of the target.
495 @param[in, out] DataBuffer A pointer to a data buffer.
496 @param[in, out] DataLength The length of data buffer.
497 @param[in] Pmi Partial medium indicator.
498
499 @retval EFI_SUCCESS Command is executed successfully.
500 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire
501 DataBuffer could not be transferred. The actual
502 number of bytes transferred is returned in DataLength.
503 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because
504 there are too many SCSI Command Packets already queued.
505 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
506 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
507 is not supported by the SCSI initiator(i.e., SCSI Host Controller)
508 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
509
510 **/
511 EFI_STATUS
512 EFIAPI
513 ScsiReadCapacity16Command (
514 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
515 IN UINT64 Timeout,
516 IN OUT VOID *SenseData, OPTIONAL
517 IN OUT UINT8 *SenseDataLength,
518 OUT UINT8 *HostAdapterStatus,
519 OUT UINT8 *TargetStatus,
520 IN OUT VOID *DataBuffer, OPTIONAL
521 IN OUT UINT32 *DataLength,
522 IN BOOLEAN Pmi
523 );
524
525
526 /**
527 Execute Read(10) SCSI command on a specific SCSI target.
528
529 Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.
530 If Timeout is zero, then this function waits indefinitely for the command to complete.
531 If Timeout is greater than zero, then the command is executed and will timeout
532 after Timeout 100 ns units. The StartLba and SectorSize parameters are used to
533 construct the CDB for this SCSI command.
534 If ScsiIo is NULL, then ASSERT().
535 If SenseDataLength is NULL, then ASSERT().
536 If HostAdapterStatus is NULL, then ASSERT().
537 If TargetStatus is NULL, then ASSERT().
538 If DataLength is NULL, then ASSERT().
539
540
541 @param[in] ScsiIo A pointer to SCSI IO protocol.
542 @param[in] Timeout The length of timeout period.
543 @param[in, out] SenseData A pointer to output sense data.
544 @param[in, out] SenseDataLength The length of output sense data.
545 @param[out] HostAdapterStatus The status of Host Adapter.
546 @param[out] TargetStatus The status of the target.
547 @param[in, out] DataBuffer Read 10 command data.
548 @param[in, out] DataLength The length of data buffer.
549 @param[in] StartLba The start address of LBA.
550 @param[in] SectorSize The sector size.
551
552 @retval EFI_SUCCESS Command is executed successfully.
553 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
554 not be transferred. The actual number of bytes transferred is returned in DataLength.
555 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
556 SCSI Command Packets already queued.
557 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
558 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
559 the SCSI initiator(i.e., SCSI Host Controller)
560 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
561
562 **/
563 EFI_STATUS
564 EFIAPI
565 ScsiRead10Command (
566 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
567 IN UINT64 Timeout,
568 IN OUT VOID *SenseData, OPTIONAL
569 IN OUT UINT8 *SenseDataLength,
570 OUT UINT8 *HostAdapterStatus,
571 OUT UINT8 *TargetStatus,
572 IN OUT VOID *DataBuffer, OPTIONAL
573 IN OUT UINT32 *DataLength,
574 IN UINT32 StartLba,
575 IN UINT32 SectorSize
576 );
577
578
579 /**
580 Execute Write(10) SCSI command on a specific SCSI target.
581
582 Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.
583 If Timeout is zero, then this function waits indefinitely for the command to complete.
584 If Timeout is greater than zero, then the command is executed and will timeout after
585 Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct
586 the CDB for this SCSI command.
587 If ScsiIo is NULL, then ASSERT().
588 If SenseDataLength is NULL, then ASSERT().
589 If HostAdapterStatus is NULL, then ASSERT().
590 If TargetStatus is NULL, then ASSERT().
591 If DataLength is NULL, then ASSERT().
592
593 @param[in] ScsiIo SCSI IO Protocol to use
594 @param[in] Timeout The length of timeout period.
595 @param[in, out] SenseData A pointer to output sense data.
596 @param[in, out] SenseDataLength The length of output sense data.
597 @param[out] HostAdapterStatus The status of Host Adapter.
598 @param[out] TargetStatus The status of the target.
599 @param[in, out] DataBuffer A pointer to a data buffer.
600 @param[in, out] DataLength The length of data buffer.
601 @param[in] StartLba The start address of LBA.
602 @param[in] SectorSize The sector size.
603
604 @retval EFI_SUCCESS Command is executed successfully.
605 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
606 not be transferred. The actual number of bytes transferred is returned in DataLength.
607 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
608 SCSI Command Packets already queued.
609 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
610 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
611 the SCSI initiator(i.e., SCSI Host Controller)
612 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
613
614 **/
615 EFI_STATUS
616 EFIAPI
617 ScsiWrite10Command (
618 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
619 IN UINT64 Timeout,
620 IN OUT VOID *SenseData, OPTIONAL
621 IN OUT UINT8 *SenseDataLength,
622 OUT UINT8 *HostAdapterStatus,
623 OUT UINT8 *TargetStatus,
624 IN OUT VOID *DataBuffer, OPTIONAL
625 IN OUT UINT32 *DataLength,
626 IN UINT32 StartLba,
627 IN UINT32 SectorSize
628 );
629
630 /**
631 Execute Read(16) SCSI command on a specific SCSI target.
632
633 Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.
634 If Timeout is zero, then this function waits indefinitely for the command to complete.
635 If Timeout is greater than zero, then the command is executed and will timeout
636 after Timeout 100 ns units. The StartLba and SectorSize parameters are used to
637 construct the CDB for this SCSI command.
638 If ScsiIo is NULL, then ASSERT().
639 If SenseDataLength is NULL, then ASSERT().
640 If HostAdapterStatus is NULL, then ASSERT().
641 If TargetStatus is NULL, then ASSERT().
642 If DataLength is NULL, then ASSERT().
643
644
645 @param[in] ScsiIo A pointer to SCSI IO protocol.
646 @param[in] Timeout The length of timeout period.
647 @param[in, out] SenseData A pointer to output sense data.
648 @param[in, out] SenseDataLength The length of output sense data.
649 @param[out] HostAdapterStatus The status of Host Adapter.
650 @param[out] TargetStatus The status of the target.
651 @param[in, out] DataBuffer Read 16 command data.
652 @param[in, out] DataLength The length of data buffer.
653 @param[in] StartLba The start address of LBA.
654 @param[in] SectorSize The sector size.
655
656 @retval EFI_SUCCESS Command is executed successfully.
657 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
658 not be transferred. The actual number of bytes transferred is returned in DataLength.
659 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
660 SCSI Command Packets already queued.
661 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
662 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
663 the SCSI initiator(i.e., SCSI Host Controller)
664 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
665
666 **/
667 EFI_STATUS
668 EFIAPI
669 ScsiRead16Command (
670 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
671 IN UINT64 Timeout,
672 IN OUT VOID *SenseData, OPTIONAL
673 IN OUT UINT8 *SenseDataLength,
674 OUT UINT8 *HostAdapterStatus,
675 OUT UINT8 *TargetStatus,
676 IN OUT VOID *DataBuffer, OPTIONAL
677 IN OUT UINT32 *DataLength,
678 IN UINT64 StartLba,
679 IN UINT32 SectorSize
680 );
681
682
683 /**
684 Execute Write(16) SCSI command on a specific SCSI target.
685
686 Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.
687 If Timeout is zero, then this function waits indefinitely for the command to complete.
688 If Timeout is greater than zero, then the command is executed and will timeout after
689 Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct
690 the CDB for this SCSI command.
691 If ScsiIo is NULL, then ASSERT().
692 If SenseDataLength is NULL, then ASSERT().
693 If HostAdapterStatus is NULL, then ASSERT().
694 If TargetStatus is NULL, then ASSERT().
695 If DataLength is NULL, then ASSERT().
696
697 @param[in] ScsiIo SCSI IO Protocol to use
698 @param[in] Timeout The length of timeout period.
699 @param[in, out] SenseData A pointer to output sense data.
700 @param[in, out] SenseDataLength The length of output sense data.
701 @param[out] HostAdapterStatus The status of Host Adapter.
702 @param[out] TargetStatus The status of the target.
703 @param[in, out] DataBuffer A pointer to a data buffer.
704 @param[in, out] DataLength The length of data buffer.
705 @param[in] StartLba The start address of LBA.
706 @param[in] SectorSize The sector size.
707
708 @retval EFI_SUCCESS Command is executed successfully.
709 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could
710 not be transferred. The actual number of bytes transferred is returned in DataLength.
711 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
712 SCSI Command Packets already queued.
713 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.
714 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by
715 the SCSI initiator(i.e., SCSI Host Controller)
716 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
717
718 **/
719 EFI_STATUS
720 EFIAPI
721 ScsiWrite16Command (
722 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
723 IN UINT64 Timeout,
724 IN OUT VOID *SenseData, OPTIONAL
725 IN OUT UINT8 *SenseDataLength,
726 OUT UINT8 *HostAdapterStatus,
727 OUT UINT8 *TargetStatus,
728 IN OUT VOID *DataBuffer, OPTIONAL
729 IN OUT UINT32 *DataLength,
730 IN UINT64 StartLba,
731 IN UINT32 SectorSize
732 );
733
734 #endif