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