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