]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Library/UefiScsiLib.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Library / UefiScsiLib.h
... / ...
CommitLineData
1/** @file\r
2 Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.\r
3\r
4 This library class provides the functions to submit SCSI commands defined in SCSI-2 specification\r
5 for hard drive, CD and DVD devices that are the most common SCSI boot targets used by UEFI platforms.\r
6 This library class depends on SCSI I/O Protocol defined in UEFI Specification and SCSI-2 industry standard.\r
7\r
8Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
9This program and the accompanying materials \r
10are licensed and made available under the terms and conditions of the BSD License \r
11which accompanies this distribution. The full text of the license may be found at \r
12http://opensource.org/licenses/bsd-license.php \r
13\r
14THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
15WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
16\r
17**/\r
18\r
19#ifndef __SCSI_LIB_H__\r
20#define __SCSI_LIB_H__\r
21\r
22#include <Protocol/ScsiIo.h>\r
23\r
24/**\r
25 Execute Test Unit Ready SCSI command on a specific SCSI target.\r
26\r
27 Executes the Test Unit Ready command on the SCSI target specified by ScsiIo.\r
28 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
29 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r
30 If ScsiIo is NULL, then ASSERT().\r
31 If SenseDataLength is NULL, then ASSERT().\r
32 If HostAdapterStatus is NULL, then ASSERT().\r
33 If TargetStatus is NULL, then ASSERT().\r
34\r
35\r
36 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r
37 for the specific SCSI target.\r
38 @param[in] Timeout The timeout in 100 ns units to use for the execution\r
39 of this SCSI Request Packet. A Timeout value of\r
40 zero means that this function will wait indefinitely\r
41 for the SCSI Request Packet to execute. If Timeout\r
42 is greater than zero, then this function will return\r
43 EFI_TIMEOUT if the time required to execute the SCSI\r
44 Request Packet is greater than Timeout.\r
45 @param[in, out] SenseData A pointer to sense data that was generated by\r
46 the execution of the SCSI Request Packet. This\r
47 buffer must be allocated by the caller.\r
48 If SenseDataLength is 0, then this parameter is\r
49 optional and may be NULL.\r
50 @param[in, out] SenseDataLength On input, a pointer to the length in bytes of\r
51 the SenseData buffer. On output, a pointer to\r
52 the number of bytes written to the SenseData buffer. \r
53 @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces\r
54 the SCSI bus containing the SCSI target specified by\r
55 ScsiIo when the SCSI Request Packet was executed.\r
56 See the EFI SCSI I/O Protocol in the UEFI Specification\r
57 for details on the possible return values.\r
58 @param[out] TargetStatus The status returned by the SCSI target specified\r
59 by ScsiIo when the SCSI Request Packet was executed\r
60 on the SCSI Host Controller. See the EFI SCSI I/O\r
61 Protocol in the UEFI Specification for details on\r
62 the possible return values. \r
63\r
64 @retval EFI_SUCCESS The command was executed successfully.\r
65 See HostAdapterStatus, TargetStatus, SenseDataLength,\r
66 and SenseData in that order for additional status\r
67 information.\r
68 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
69 there are too many SCSI Command Packets already\r
70 queued. The SCSI Request Packet was not sent, so\r
71 no additional status information is available.\r
72 The caller may retry again later.\r
73 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r
74 SCSI Request Packet. See HostAdapterStatus,\r
75 TargetStatus, SenseDataLength, and SenseData in that\r
76 order for additional status information.\r
77 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
78 is not supported by the SCSI initiator(i.e., SCSI\r
79 Host Controller). The SCSI Request Packet was not\r
80 sent, so no additional status information is available.\r
81 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r
82 Packet to execute. See HostAdapterStatus, TargetStatus,\r
83 SenseDataLength, and SenseData in that order for\r
84 additional status information.\r
85\r
86**/\r
87EFI_STATUS\r
88EFIAPI\r
89ScsiTestUnitReadyCommand (\r
90 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
91 IN UINT64 Timeout,\r
92 IN OUT VOID *SenseData, OPTIONAL\r
93 IN OUT UINT8 *SenseDataLength,\r
94 OUT UINT8 *HostAdapterStatus,\r
95 OUT UINT8 *TargetStatus\r
96 );\r
97\r
98\r
99/**\r
100 Execute Inquiry SCSI command on a specific SCSI target.\r
101\r
102 Executes the Inquiry command on the SCSI target specified by ScsiIo.\r
103 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
104 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r
105 If ScsiIo is NULL, then ASSERT().\r
106 If SenseDataLength is NULL, then ASSERT().\r
107 If HostAdapterStatus is NULL, then ASSERT().\r
108 If TargetStatus is NULL, then ASSERT().\r
109 If InquiryDataLength is NULL, then ASSERT().\r
110\r
111 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r
112 for the specific SCSI target.\r
113 @param[in] Timeout The timeout in 100 ns units to use for the\r
114 execution of this SCSI Request Packet. A Timeout\r
115 value of zero means that this function will wait\r
116 indefinitely for the SCSI Request Packet to execute.\r
117 If Timeout is greater than zero, then this function\r
118 will return EFI_TIMEOUT if the time required to\r
119 execute the SCSI Request Packet is greater than Timeout.\r
120 @param[in, out] SenseData A pointer to sense data that was generated\r
121 by the execution of the SCSI Request Packet.\r
122 This buffer must be allocated by the caller.\r
123 If SenseDataLength is 0, then this parameter\r
124 is optional and may be NULL.\r
125 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r
126 On output, the number of bytes written to the SenseData buffer. \r
127 @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r
128 produces the SCSI bus containing the SCSI\r
129 target specified by ScsiIo when the SCSI\r
130 Request Packet was executed. See the EFI\r
131 SCSI I/O Protocol in the UEFI Specification\r
132 for details on the possible return values.\r
133 @param[out] TargetStatus The status returned by the SCSI target specified\r
134 by ScsiIo when the SCSI Request Packet was\r
135 executed on the SCSI Host Controller.\r
136 See the EFI SCSI I/O Protocol in the UEFI\r
137 Specification for details on the possible\r
138 return values. \r
139 @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r
140 by the execution of the SCSI Request Packet.\r
141 This buffer must be allocated by the caller.\r
142 If InquiryDataLength is 0, then this parameter\r
143 is optional and may be NULL. \r
144 @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r
145 of the InquiryDataBuffer buffer.\r
146 On output, a pointer to the number of bytes\r
147 written to the InquiryDataBuffer buffer.\r
148 @param[in] EnableVitalProductData If TRUE, then the supported vital product\r
149 data is returned in InquiryDataBuffer.\r
150 If FALSE, then the standard inquiry data is\r
151 returned in InquiryDataBuffer. \r
152\r
153 @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,\r
154 TargetStatus, SenseDataLength, and SenseData in that order\r
155 for additional status information.\r
156 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r
157 InquiryDataBuffer could not be transferred. The actual\r
158 number of bytes transferred is returned in InquiryDataLength.\r
159 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r
160 are too many SCSI Command Packets already queued.\r
161 The SCSI Request Packet was not sent, so no additional\r
162 status information is available. The caller may retry again later.\r
163 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r
164 Request Packet. See HostAdapterStatus, TargetStatus,\r
165 SenseDataLength, and SenseData in that order for additional\r
166 status information.\r
167 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r
168 supported by the SCSI initiator(i.e., SCSI Host Controller).\r
169 The SCSI Request Packet was not sent, so no additional\r
170 status information is available.\r
171 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r
172 Packet to execute. See HostAdapterStatus, TargetStatus,\r
173 SenseDataLength, and SenseData in that order for\r
174 additional status information.\r
175\r
176**/\r
177EFI_STATUS\r
178EFIAPI\r
179ScsiInquiryCommand (\r
180 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
181 IN UINT64 Timeout,\r
182 IN OUT VOID *SenseData, OPTIONAL\r
183 IN OUT UINT8 *SenseDataLength,\r
184 OUT UINT8 *HostAdapterStatus,\r
185 OUT UINT8 *TargetStatus,\r
186 IN OUT VOID *InquiryDataBuffer, OPTIONAL\r
187 IN OUT UINT32 *InquiryDataLength,\r
188 IN BOOLEAN EnableVitalProductData\r
189 );\r
190\r
191\r
192/**\r
193 Execute Mode Sense(10) SCSI command on a specific SCSI target.\r
194\r
195 Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.\r
196 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
197 If Timeout is greater than zero, then the command is executed and will timeout\r
198 after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters\r
199 are used to construct the CDB for this SCSI command.\r
200 If ScsiIo is NULL, then ASSERT().\r
201 If SenseDataLength is NULL, then ASSERT().\r
202 If HostAdapterStatus is NULL, then ASSERT().\r
203 If TargetStatus is NULL, then ASSERT().\r
204 If DataLength is NULL, then ASSERT().\r
205\r
206\r
207 @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r
208 for the specific SCSI target.\r
209 @param[in] Timeout The timeout in 100 ns units to use for the\r
210 execution of this SCSI Request Packet. A Timeout\r
211 value of zero means that this function will wait\r
212 indefinitely for the SCSI Request Packet to execute.\r
213 If Timeout is greater than zero, then this function\r
214 will return EFI_TIMEOUT if the time required to\r
215 execute the SCSI Request Packet is greater than Timeout.\r
216 @param[in, out] SenseData A pointer to sense data that was generated\r
217 by the execution of the SCSI Request Packet.\r
218 This buffer must be allocated by the caller.\r
219 If SenseDataLength is 0, then this parameter\r
220 is optional and may be NULL.\r
221 @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r
222 On output, the number of bytes written to the SenseData buffer. \r
223 @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r
224 produces the SCSI bus containing the SCSI target\r
225 specified by ScsiIo when the SCSI Request Packet\r
226 was executed. See the EFI SCSI I/O Protocol in the\r
227 UEFI Specification for details on the possible\r
228 return values.\r
229 @param[out] TargetStatus The status returned by the SCSI target specified\r
230 by ScsiIo when the SCSI Request Packet was executed\r
231 on the SCSI Host Controller. See the EFI SCSI\r
232 I/O Protocol in the UEFI Specification for details\r
233 on the possible return values.\r
234 @param[in, out] DataBuffer A pointer to data that was generated by the\r
235 execution of the SCSI Request Packet. This\r
236 buffer must be allocated by the caller. If\r
237 DataLength is 0, then this parameter is optional\r
238 and may be NULL. \r
239 @param[in, out] DataLength On input, a pointer to the length in bytes of\r
240 the DataBuffer buffer. On output, a pointer\r
241 to the number of bytes written to the DataBuffer\r
242 buffer. \r
243 @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r
244 @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. \r
245 @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. \r
246\r
247 @retval EFI_SUCCESS The command was executed successfully.\r
248 See HostAdapterStatus, TargetStatus, SenseDataLength,\r
249 and SenseData in that order for additional status information.\r
250 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the\r
251 entire DataBuffer could not be transferred.\r
252 The actual number of bytes transferred is returned\r
253 in DataLength.\r
254 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
255 there are too many SCSI Command Packets already queued.\r
256 The SCSI Request Packet was not sent, so no additional\r
257 status information is available. The caller may retry\r
258 again later.\r
259 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r
260 SCSI Request Packet. See HostAdapterStatus, TargetStatus,\r
261 SenseDataLength, and SenseData in that order for\r
262 additional status information.\r
263 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
264 is not supported by the SCSI initiator(i.e., SCSI\r
265 Host Controller). The SCSI Request Packet was not\r
266 sent, so no additional status information is available.\r
267 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r
268 Request Packet to execute. See HostAdapterStatus,\r
269 TargetStatus, SenseDataLength, and SenseData in that\r
270 order for additional status information.\r
271\r
272**/\r
273EFI_STATUS\r
274EFIAPI\r
275ScsiModeSense10Command (\r
276 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
277 IN UINT64 Timeout,\r
278 IN OUT VOID *SenseData, OPTIONAL\r
279 IN OUT UINT8 *SenseDataLength,\r
280 OUT UINT8 *HostAdapterStatus,\r
281 OUT UINT8 *TargetStatus,\r
282 IN OUT VOID *DataBuffer, OPTIONAL\r
283 IN OUT UINT32 *DataLength,\r
284 IN UINT8 DBDField, OPTIONAL\r
285 IN UINT8 PageControl,\r
286 IN UINT8 PageCode\r
287 );\r
288\r
289\r
290\r
291/**\r
292 Execute Request Sense SCSI command on a specific SCSI target.\r
293\r
294 Executes the Request Sense command on the SCSI target specified by ScsiIo.\r
295 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
296 If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r
297 If ScsiIo is NULL, then ASSERT().\r
298 If SenseDataLength is NULL, then ASSERT().\r
299 If HostAdapterStatus is NULL, then ASSERT().\r
300 If TargetStatus is NULL, then ASSERT().\r
301\r
302 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
303 @param[in] Timeout The length of timeout period.\r
304 @param[in, out] SenseData A pointer to output sense data.\r
305 @param[in, out] SenseDataLength The length of output sense data.\r
306 @param[out] HostAdapterStatus The status of Host Adapter.\r
307 @param[out] TargetStatus The status of the target.\r
308\r
309 @retval EFI_SUCCESS Command is executed successfully.\r
310 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are\r
311 too many SCSI Command Packets already queued.\r
312 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
313 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r
314 the SCSI initiator(i.e., SCSI Host Controller)\r
315 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
316\r
317**/\r
318EFI_STATUS\r
319EFIAPI\r
320ScsiRequestSenseCommand (\r
321 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
322 IN UINT64 Timeout,\r
323 IN OUT VOID *SenseData, OPTIONAL\r
324 IN OUT UINT8 *SenseDataLength,\r
325 OUT UINT8 *HostAdapterStatus,\r
326 OUT UINT8 *TargetStatus\r
327 );\r
328\r
329\r
330/**\r
331 Execute Read Capacity SCSI command on a specific SCSI target.\r
332\r
333 Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r
334 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
335 If Timeout is greater than zero, then the command is executed and will timeout after\r
336 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r
337 If ScsiIo is NULL, then ASSERT().\r
338 If SenseDataLength is NULL, then ASSERT().\r
339 If HostAdapterStatus is NULL, then ASSERT().\r
340 If TargetStatus is NULL, then ASSERT().\r
341 If DataLength is NULL, then ASSERT().\r
342\r
343 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
344 @param[in] Timeout The length of timeout period.\r
345 @param[in, out] SenseData A pointer to output sense data.\r
346 @param[in, out] SenseDataLength The length of output sense data.\r
347 @param[out] HostAdapterStatus The status of Host Adapter.\r
348 @param[out] TargetStatus The status of the target.\r
349 @param[in, out] DataBuffer A pointer to a data buffer.\r
350 @param[in, out] DataLength The length of data buffer.\r
351 @param[in] Pmi Partial medium indicator.\r
352\r
353 @retval EFI_SUCCESS Command is executed successfully.\r
354 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r
355 DataBuffer could not be transferred. The actual\r
356 number of bytes transferred is returned in DataLength.\r
357 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
358 there are too many SCSI Command Packets already queued.\r
359 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
360 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
361 is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r
362 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
363\r
364**/\r
365EFI_STATUS\r
366EFIAPI\r
367ScsiReadCapacityCommand (\r
368 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
369 IN UINT64 Timeout,\r
370 IN OUT VOID *SenseData, OPTIONAL\r
371 IN OUT UINT8 *SenseDataLength,\r
372 OUT UINT8 *HostAdapterStatus,\r
373 OUT UINT8 *TargetStatus,\r
374 IN OUT VOID *DataBuffer, OPTIONAL\r
375 IN OUT UINT32 *DataLength,\r
376 IN BOOLEAN Pmi\r
377 );\r
378\r
379\r
380/**\r
381 Execute Read Capacity SCSI 16 command on a specific SCSI target.\r
382\r
383 Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.\r
384 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
385 If Timeout is greater than zero, then the command is executed and will timeout after\r
386 Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r
387 If ScsiIo is NULL, then ASSERT().\r
388 If SenseDataLength is NULL, then ASSERT().\r
389 If HostAdapterStatus is NULL, then ASSERT().\r
390 If TargetStatus is NULL, then ASSERT().\r
391 If DataLength is NULL, then ASSERT().\r
392\r
393 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
394 @param[in] Timeout The length of timeout period.\r
395 @param[in, out] SenseData A pointer to output sense data.\r
396 @param[in, out] SenseDataLength The length of output sense data.\r
397 @param[out] HostAdapterStatus The status of Host Adapter.\r
398 @param[out] TargetStatus The status of the target.\r
399 @param[in, out] DataBuffer A pointer to a data buffer.\r
400 @param[in, out] DataLength The length of data buffer.\r
401 @param[in] Pmi Partial medium indicator.\r
402\r
403 @retval EFI_SUCCESS Command is executed successfully.\r
404 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r
405 DataBuffer could not be transferred. The actual\r
406 number of bytes transferred is returned in DataLength.\r
407 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r
408 there are too many SCSI Command Packets already queued.\r
409 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
410 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r
411 is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r
412 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
413\r
414**/\r
415EFI_STATUS\r
416EFIAPI\r
417ScsiReadCapacity16Command (\r
418 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
419 IN UINT64 Timeout,\r
420 IN OUT VOID *SenseData, OPTIONAL\r
421 IN OUT UINT8 *SenseDataLength,\r
422 OUT UINT8 *HostAdapterStatus,\r
423 OUT UINT8 *TargetStatus,\r
424 IN OUT VOID *DataBuffer, OPTIONAL\r
425 IN OUT UINT32 *DataLength,\r
426 IN BOOLEAN Pmi\r
427 );\r
428\r
429\r
430/**\r
431 Execute Read(10) SCSI command on a specific SCSI target.\r
432\r
433 Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r
434 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
435 If Timeout is greater than zero, then the command is executed and will timeout\r
436 after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r
437 construct the CDB for this SCSI command.\r
438 If ScsiIo is NULL, then ASSERT().\r
439 If SenseDataLength is NULL, then ASSERT().\r
440 If HostAdapterStatus is NULL, then ASSERT().\r
441 If TargetStatus is NULL, then ASSERT().\r
442 If DataLength is NULL, then ASSERT().\r
443\r
444\r
445 @param[in] ScsiIo A pointer to SCSI IO protocol.\r
446 @param[in] Timeout The length of timeout period.\r
447 @param[in, out] SenseData A pointer to output sense data.\r
448 @param[in, out] SenseDataLength The length of output sense data.\r
449 @param[out] HostAdapterStatus The status of Host Adapter.\r
450 @param[out] TargetStatus The status of the target.\r
451 @param[in, out] DataBuffer Read 10 command data.\r
452 @param[in, out] DataLength The length of data buffer.\r
453 @param[in] StartLba The start address of LBA.\r
454 @param[in] SectorSize The sector size.\r
455\r
456 @retval EFI_SUCCESS Command is executed successfully.\r
457 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
458 not be transferred. The actual number of bytes transferred is returned in DataLength.\r
459 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r
460 SCSI Command Packets already queued.\r
461 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
462 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r
463 the SCSI initiator(i.e., SCSI Host Controller)\r
464 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
465\r
466**/\r
467EFI_STATUS\r
468EFIAPI\r
469ScsiRead10Command (\r
470 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
471 IN UINT64 Timeout,\r
472 IN OUT VOID *SenseData, OPTIONAL\r
473 IN OUT UINT8 *SenseDataLength,\r
474 OUT UINT8 *HostAdapterStatus,\r
475 OUT UINT8 *TargetStatus,\r
476 IN OUT VOID *DataBuffer, OPTIONAL\r
477 IN OUT UINT32 *DataLength,\r
478 IN UINT32 StartLba,\r
479 IN UINT32 SectorSize\r
480 );\r
481\r
482\r
483/**\r
484 Execute Write(10) SCSI command on a specific SCSI target.\r
485\r
486 Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r
487 If Timeout is zero, then this function waits indefinitely for the command to complete.\r
488 If Timeout is greater than zero, then the command is executed and will timeout after\r
489 Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r
490 the CDB for this SCSI command.\r
491 If ScsiIo is NULL, then ASSERT().\r
492 If SenseDataLength is NULL, then ASSERT().\r
493 If HostAdapterStatus is NULL, then ASSERT().\r
494 If TargetStatus is NULL, then ASSERT().\r
495 If DataLength is NULL, then ASSERT().\r
496\r
497 @param[in] ScsiIo SCSI IO Protocol to use\r
498 @param[in] Timeout The length of timeout period.\r
499 @param[in, out] SenseData A pointer to output sense data.\r
500 @param[in, out] SenseDataLength The length of output sense data.\r
501 @param[out] HostAdapterStatus The status of Host Adapter.\r
502 @param[out] TargetStatus The status of the target.\r
503 @param[in, out] DataBuffer A pointer to a data buffer.\r
504 @param[in, out] DataLength The length of data buffer.\r
505 @param[in] StartLba The start address of LBA.\r
506 @param[in] SectorSize The sector size.\r
507\r
508 @retval EFI_SUCCESS Command is executed successfully.\r
509 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r
510 not be transferred. The actual number of bytes transferred is returned in DataLength.\r
511 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r
512 SCSI Command Packets already queued.\r
513 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r
514 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r
515 the SCSI initiator(i.e., SCSI Host Controller)\r
516 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r
517\r
518**/\r
519EFI_STATUS\r
520EFIAPI\r
521ScsiWrite10Command (\r
522 IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r
523 IN UINT64 Timeout,\r
524 IN OUT VOID *SenseData, OPTIONAL\r
525 IN OUT UINT8 *SenseDataLength,\r
526 OUT UINT8 *HostAdapterStatus,\r
527 OUT UINT8 *TargetStatus,\r
528 IN OUT VOID *DataBuffer, OPTIONAL\r
529 IN OUT UINT32 *DataLength,\r
530 IN UINT32 StartLba,\r
531 IN UINT32 SectorSize\r
532 );\r
533\r
534\r
535#endif\r