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