]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.\r | |
3 | \r | |
4 | This library class provides the functions to submit SCSI commands defined in SCSI-2 specification\r | |
5 | for hard drive, CD and DVD devices that are the most common SCSI boot targets used by UEFI platforms.\r | |
6 | This library class depends on SCSI I/O Protocol defined in UEFI Specification and SCSI-2 industry standard.\r | |
7 | \r | |
8 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
9 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
10 | \r | |
11 | **/\r | |
12 | \r | |
13 | #ifndef __SCSI_LIB_H__\r | |
14 | #define __SCSI_LIB_H__\r | |
15 | \r | |
16 | #include <Protocol/ScsiIo.h>\r | |
17 | \r | |
18 | /**\r | |
19 | Execute Test Unit Ready SCSI command on a specific SCSI target.\r | |
20 | \r | |
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 | |
25 | If SenseDataLength is NULL, then ASSERT().\r | |
26 | If HostAdapterStatus is NULL, then ASSERT().\r | |
27 | If TargetStatus is NULL, then ASSERT().\r | |
28 | \r | |
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 | |
32 | \r | |
33 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
34 | for the specific SCSI target.\r | |
35 | @param[in] Timeout The timeout in 100 ns units to use for the execution\r | |
36 | of this SCSI Request Packet. A Timeout value of\r | |
37 | zero means that this function will wait indefinitely\r | |
38 | for the SCSI Request Packet to execute. If Timeout\r | |
39 | is greater than zero, then this function will return\r | |
40 | EFI_TIMEOUT if the time required to execute the SCSI\r | |
41 | Request Packet is greater than Timeout.\r | |
42 | @param[in, out] SenseData A pointer to sense data that was generated by\r | |
43 | the execution of the SCSI Request Packet. This\r | |
44 | buffer must be allocated by the caller.\r | |
45 | If SenseDataLength is 0, then this parameter is\r | |
46 | optional and may be NULL.\r | |
47 | @param[in, out] SenseDataLength On input, a pointer to the length in bytes of\r | |
48 | the SenseData buffer. On output, a pointer to\r | |
49 | the number of bytes written to the SenseData buffer.\r | |
50 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces\r | |
51 | the SCSI bus containing the SCSI target specified by\r | |
52 | ScsiIo when the SCSI Request Packet was executed.\r | |
53 | See the EFI SCSI I/O Protocol in the UEFI Specification\r | |
54 | for details on the possible return values.\r | |
55 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
56 | by ScsiIo when the SCSI Request Packet was executed\r | |
57 | on the SCSI Host Controller. See the EFI SCSI I/O\r | |
58 | Protocol in the UEFI Specification for details on\r | |
59 | the possible return values.\r | |
60 | \r | |
61 | @retval EFI_SUCCESS The command was executed successfully.\r | |
62 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
63 | and SenseData in that order for additional status\r | |
64 | information.\r | |
65 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
66 | there are too many SCSI Command Packets already\r | |
67 | queued. The SCSI Request Packet was not sent, so\r | |
68 | no additional status information is available.\r | |
69 | The caller may retry again later.\r | |
70 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
71 | SCSI Request Packet. See HostAdapterStatus,\r | |
72 | TargetStatus, SenseDataLength, and SenseData in that\r | |
73 | order for additional status information.\r | |
74 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
75 | is not supported by the SCSI initiator(i.e., SCSI\r | |
76 | Host Controller). The SCSI Request Packet was not\r | |
77 | sent, so no additional status information is available.\r | |
78 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
79 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
80 | SenseDataLength, and SenseData in that order for\r | |
81 | additional status information.\r | |
82 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
83 | \r | |
84 | **/\r | |
85 | EFI_STATUS\r | |
86 | EFIAPI\r | |
87 | ScsiTestUnitReadyCommand (\r | |
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 | |
94 | );\r | |
95 | \r | |
96 | \r | |
97 | /**\r | |
98 | Execute Inquiry SCSI command on a specific SCSI target.\r | |
99 | \r | |
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 | |
104 | If SenseDataLength is NULL, then ASSERT().\r | |
105 | If HostAdapterStatus is NULL, then ASSERT().\r | |
106 | If TargetStatus is NULL, then ASSERT().\r | |
107 | If InquiryDataLength is NULL, then ASSERT().\r | |
108 | \r | |
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 | |
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 | |
132 | On output, the number of bytes written to the SenseData buffer.\r | |
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 | |
140 | by ScsiIo when the SCSI Request Packet was\r | |
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 | |
144 | return values.\r | |
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 | |
149 | is optional and may be NULL.\r | |
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 | |
157 | returned in InquiryDataBuffer.\r | |
158 | \r | |
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 | |
182 | \r | |
183 | **/\r | |
184 | EFI_STATUS\r | |
185 | EFIAPI\r | |
186 | ScsiInquiryCommand (\r | |
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 | |
196 | );\r | |
197 | \r | |
198 | \r | |
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 | |
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 | |
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 | |
234 | On output, the number of bytes written to the SenseData buffer.\r | |
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 | |
246 | return values.\r | |
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 | |
251 | is optional and may be NULL.\r | |
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 | |
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 | |
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 | |
304 | /**\r | |
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 | |
313 | If SenseDataLength is NULL, then ASSERT().\r | |
314 | If HostAdapterStatus is NULL, then ASSERT().\r | |
315 | If TargetStatus is NULL, then ASSERT().\r | |
316 | If DataLength is NULL, then ASSERT().\r | |
317 | \r | |
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 | |
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 | |
335 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
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 | |
340 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
341 | On output, the number of bytes written to the SenseData buffer.\r | |
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 | |
349 | by ScsiIo when the SCSI Request Packet was executed\r | |
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 | |
353 | @param[in, out] DataBuffer A pointer to data that was generated by the\r | |
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 | |
357 | and may be NULL.\r | |
358 | @param[in, out] DataLength On input, a pointer to the length in bytes of\r | |
359 | the DataBuffer buffer. On output, a pointer\r | |
360 | to the number of bytes written to the DataBuffer\r | |
361 | buffer.\r | |
362 | @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r | |
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 | |
365 | \r | |
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 | |
391 | \r | |
392 | **/\r | |
393 | EFI_STATUS\r | |
394 | EFIAPI\r | |
395 | ScsiModeSense10Command (\r | |
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 | |
407 | );\r | |
408 | \r | |
409 | \r | |
410 | \r | |
411 | /**\r | |
412 | Execute Request Sense SCSI command on a specific SCSI target.\r | |
413 | \r | |
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 | |
418 | If SenseDataLength is NULL, then ASSERT().\r | |
419 | If HostAdapterStatus is NULL, then ASSERT().\r | |
420 | If TargetStatus is NULL, then ASSERT().\r | |
421 | \r | |
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 | |
426 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
427 | @param[in] Timeout The length of timeout period.\r | |
428 | @param[in, out] SenseData A pointer to output sense data.\r | |
429 | @param[in, out] SenseDataLength The length of output sense data.\r | |
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 | |
440 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
441 | \r | |
442 | **/\r | |
443 | EFI_STATUS\r | |
444 | EFIAPI\r | |
445 | ScsiRequestSenseCommand (\r | |
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 | |
452 | );\r | |
453 | \r | |
454 | \r | |
455 | /**\r | |
456 | Execute Read Capacity SCSI command on a specific SCSI target.\r | |
457 | \r | |
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 | |
461 | Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r | |
462 | If ScsiIo is NULL, then ASSERT().\r | |
463 | If SenseDataLength is NULL, then ASSERT().\r | |
464 | If HostAdapterStatus is NULL, then ASSERT().\r | |
465 | If TargetStatus is NULL, then ASSERT().\r | |
466 | If DataLength is NULL, then ASSERT().\r | |
467 | \r | |
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 | |
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 | |
479 | @param[in, out] SenseDataLength The length of output sense data.\r | |
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 | |
483 | @param[in, out] DataLength The length of data buffer.\r | |
484 | @param[in] Pmi Partial medium indicator.\r | |
485 | \r | |
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 | |
497 | \r | |
498 | **/\r | |
499 | EFI_STATUS\r | |
500 | EFIAPI\r | |
501 | ScsiReadCapacityCommand (\r | |
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 | |
510 | IN BOOLEAN Pmi\r | |
511 | );\r | |
512 | \r | |
513 | \r | |
514 | /**\r | |
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 | |
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 | |
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 | |
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 | |
556 | \r | |
557 | **/\r | |
558 | EFI_STATUS\r | |
559 | EFIAPI\r | |
560 | ScsiReadCapacity16Command (\r | |
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 | |
570 | );\r | |
571 | \r | |
572 | \r | |
573 | /**\r | |
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 | |
582 | If SenseDataLength is NULL, then ASSERT().\r | |
583 | If HostAdapterStatus is NULL, then ASSERT().\r | |
584 | If TargetStatus is NULL, then ASSERT().\r | |
585 | If DataLength is NULL, then ASSERT().\r | |
586 | \r | |
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 | |
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 | |
598 | @param[in, out] SenseDataLength The length of output sense data.\r | |
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 | |
602 | @param[in, out] DataLength The length of data buffer.\r | |
603 | @param[in] StartLba The start address of LBA.\r | |
604 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r | |
605 | \r | |
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 | |
616 | \r | |
617 | **/\r | |
618 | EFI_STATUS\r | |
619 | EFIAPI\r | |
620 | ScsiRead10Command (\r | |
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 | |
631 | );\r | |
632 | \r | |
633 | \r | |
634 | /**\r | |
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 | |
643 | If SenseDataLength is NULL, then ASSERT().\r | |
644 | If HostAdapterStatus is NULL, then ASSERT().\r | |
645 | If TargetStatus is NULL, then ASSERT().\r | |
646 | If DataLength is NULL, then ASSERT().\r | |
647 | \r | |
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 | |
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 | |
659 | @param[in, out] SenseDataLength The length of output sense data.\r | |
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 | |
663 | @param[in, out] DataLength The length of data buffer.\r | |
664 | @param[in] StartLba The start address of LBA.\r | |
665 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r | |
666 | \r | |
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 | |
677 | \r | |
678 | **/\r | |
679 | EFI_STATUS\r | |
680 | EFIAPI\r | |
681 | ScsiWrite10Command (\r | |
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 | |
692 | );\r | |
693 | \r | |
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 | |
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 | |
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 | |
725 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r | |
726 | \r | |
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 | |
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 | |
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 | |
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 | |
786 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r | |
787 | \r | |
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 | |
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 | |
814 | \r | |
815 | \r | |
816 | /**\r | |
817 | Execute blocking/non-blocking Read(10) SCSI command on a specific SCSI\r | |
818 | target.\r | |
819 | \r | |
820 | Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r | |
821 | When Event is NULL, blocking command will be executed. Otherwise non-blocking\r | |
822 | command will be executed.\r | |
823 | For blocking I/O, if Timeout is zero, this function will wait indefinitely\r | |
824 | for the command to complete. If Timeout is greater than zero, then the\r | |
825 | command is executed and will timeout after Timeout 100 ns units.\r | |
826 | For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r | |
827 | the command to completes. If Timeout is greater than zero, Event will also be\r | |
828 | signaled after Timeout 100 ns units.\r | |
829 | The StartLba and SectorSize parameters are used to construct the CDB for this\r | |
830 | SCSI command.\r | |
831 | \r | |
832 | If ScsiIo is NULL, then ASSERT().\r | |
833 | If SenseDataLength is NULL, then ASSERT().\r | |
834 | If HostAdapterStatus is NULL, then ASSERT().\r | |
835 | If TargetStatus is NULL, then ASSERT().\r | |
836 | If DataLength is NULL, then ASSERT().\r | |
837 | \r | |
838 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r | |
839 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
840 | EFI_INVALID_PARAMETER gets returned.\r | |
841 | \r | |
842 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r | |
843 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
844 | EFI_INVALID_PARAMETER gets returned.\r | |
845 | \r | |
846 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
847 | @param[in] Timeout The length of timeout period.\r | |
848 | @param[in, out] SenseData A pointer to output sense data.\r | |
849 | @param[in, out] SenseDataLength The length of output sense data.\r | |
850 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
851 | @param[out] TargetStatus The status of the target.\r | |
852 | @param[in, out] DataBuffer Read 16 command data.\r | |
853 | @param[in, out] DataLength The length of data buffer.\r | |
854 | @param[in] StartLba The start address of LBA.\r | |
855 | @param[in] SectorSize The number of contiguous logical blocks\r | |
856 | of data that shall be transferred.\r | |
857 | @param[in] Event If the SCSI target does not support\r | |
858 | non-blocking I/O, then Event is ignored,\r | |
859 | and blocking I/O is performed. If Event\r | |
860 | is NULL, then blocking I/O is performed.\r | |
861 | If Event is not NULL and non-blocking\r | |
862 | I/O is supported, then non-blocking I/O\r | |
863 | is performed, and Event will be signaled\r | |
864 | when the SCSI Read(10) command\r | |
865 | completes.\r | |
866 | \r | |
867 | @retval EFI_SUCCESS Command is executed successfully.\r | |
868 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r | |
869 | but the entire DataBuffer could not be\r | |
870 | transferred. The actual number of bytes\r | |
871 | transferred is returned in DataLength.\r | |
872 | @retval EFI_NOT_READY The SCSI Request Packet could not be\r | |
873 | sent because there are too many SCSI\r | |
874 | Command Packets already queued.\r | |
875 | @retval EFI_DEVICE_ERROR A device error occurred while attempting\r | |
876 | to send SCSI Request Packet.\r | |
877 | @retval EFI_UNSUPPORTED The command described by the SCSI\r | |
878 | Request Packet is not supported by the\r | |
879 | SCSI initiator(i.e., SCSI Host\r | |
880 | Controller)\r | |
881 | @retval EFI_TIMEOUT A timeout occurred while waiting for the\r | |
882 | SCSI Request Packet to execute.\r | |
883 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r | |
884 | are invalid.\r | |
885 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r | |
886 | to a lack of resources.\r | |
887 | \r | |
888 | **/\r | |
889 | EFI_STATUS\r | |
890 | EFIAPI\r | |
891 | ScsiRead10CommandEx (\r | |
892 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
893 | IN UINT64 Timeout,\r | |
894 | IN OUT VOID *SenseData, OPTIONAL\r | |
895 | IN OUT UINT8 *SenseDataLength,\r | |
896 | OUT UINT8 *HostAdapterStatus,\r | |
897 | OUT UINT8 *TargetStatus,\r | |
898 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
899 | IN OUT UINT32 *DataLength,\r | |
900 | IN UINT32 StartLba,\r | |
901 | IN UINT32 SectorSize,\r | |
902 | IN EFI_EVENT Event OPTIONAL\r | |
903 | );\r | |
904 | \r | |
905 | \r | |
906 | /**\r | |
907 | Execute blocking/non-blocking Write(10) SCSI command on a specific SCSI\r | |
908 | target.\r | |
909 | \r | |
910 | Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r | |
911 | When Event is NULL, blocking command will be executed. Otherwise non-blocking\r | |
912 | command will be executed.\r | |
913 | For blocking I/O, if Timeout is zero, this function will wait indefinitely\r | |
914 | for the command to complete. If Timeout is greater than zero, then the\r | |
915 | command is executed and will timeout after Timeout 100 ns units.\r | |
916 | For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r | |
917 | the command to completes. If Timeout is greater than zero, Event will also be\r | |
918 | signaled after Timeout 100 ns units.\r | |
919 | The StartLba and SectorSize parameters are used to construct the CDB for this\r | |
920 | SCSI command.\r | |
921 | \r | |
922 | If ScsiIo is NULL, then ASSERT().\r | |
923 | If SenseDataLength is NULL, then ASSERT().\r | |
924 | If HostAdapterStatus is NULL, then ASSERT().\r | |
925 | If TargetStatus is NULL, then ASSERT().\r | |
926 | If DataLength is NULL, then ASSERT().\r | |
927 | \r | |
928 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r | |
929 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
930 | EFI_INVALID_PARAMETER gets returned.\r | |
931 | \r | |
932 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r | |
933 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
934 | EFI_INVALID_PARAMETER gets returned.\r | |
935 | \r | |
936 | @param[in] ScsiIo SCSI IO Protocol to use\r | |
937 | @param[in] Timeout The length of timeout period.\r | |
938 | @param[in, out] SenseData A pointer to output sense data.\r | |
939 | @param[in, out] SenseDataLength The length of output sense data.\r | |
940 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
941 | @param[out] TargetStatus The status of the target.\r | |
942 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
943 | @param[in, out] DataLength The length of data buffer.\r | |
944 | @param[in] StartLba The start address of LBA.\r | |
945 | @param[in] SectorSize The number of contiguous logical blocks\r | |
946 | of data that shall be transferred.\r | |
947 | @param[in] Event If the SCSI target does not support\r | |
948 | non-blocking I/O, then Event is ignored,\r | |
949 | and blocking I/O is performed. If Event\r | |
950 | is NULL, then blocking I/O is performed.\r | |
951 | If Event is not NULL and non-blocking\r | |
952 | I/O is supported, then non-blocking I/O\r | |
953 | is performed, and Event will be signaled\r | |
954 | when the SCSI Write(10) command\r | |
955 | completes.\r | |
956 | \r | |
957 | @retval EFI_SUCCESS Command is executed successfully.\r | |
958 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r | |
959 | but the entire DataBuffer could not be\r | |
960 | transferred. The actual number of bytes\r | |
961 | transferred is returned in DataLength.\r | |
962 | @retval EFI_NOT_READY The SCSI Request Packet could not be\r | |
963 | sent because there are too many SCSI\r | |
964 | Command Packets already queued.\r | |
965 | @retval EFI_DEVICE_ERROR A device error occurred while attempting\r | |
966 | to send SCSI Request Packet.\r | |
967 | @retval EFI_UNSUPPORTED The command described by the SCSI\r | |
968 | Request Packet is not supported by the\r | |
969 | SCSI initiator(i.e., SCSI Host\r | |
970 | Controller)\r | |
971 | @retval EFI_TIMEOUT A timeout occurred while waiting for the\r | |
972 | SCSI Request Packet to execute.\r | |
973 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r | |
974 | are invalid.\r | |
975 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r | |
976 | to a lack of resources.\r | |
977 | \r | |
978 | **/\r | |
979 | EFI_STATUS\r | |
980 | EFIAPI\r | |
981 | ScsiWrite10CommandEx (\r | |
982 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
983 | IN UINT64 Timeout,\r | |
984 | IN OUT VOID *SenseData, OPTIONAL\r | |
985 | IN OUT UINT8 *SenseDataLength,\r | |
986 | OUT UINT8 *HostAdapterStatus,\r | |
987 | OUT UINT8 *TargetStatus,\r | |
988 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
989 | IN OUT UINT32 *DataLength,\r | |
990 | IN UINT32 StartLba,\r | |
991 | IN UINT32 SectorSize,\r | |
992 | IN EFI_EVENT Event OPTIONAL\r | |
993 | );\r | |
994 | \r | |
995 | \r | |
996 | /**\r | |
997 | Execute blocking/non-blocking Read(16) SCSI command on a specific SCSI\r | |
998 | target.\r | |
999 | \r | |
1000 | Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.\r | |
1001 | When Event is NULL, blocking command will be executed. Otherwise non-blocking\r | |
1002 | command will be executed.\r | |
1003 | For blocking I/O, if Timeout is zero, this function will wait indefinitely\r | |
1004 | for the command to complete. If Timeout is greater than zero, then the\r | |
1005 | command is executed and will timeout after Timeout 100 ns units.\r | |
1006 | For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r | |
1007 | the command to completes. If Timeout is greater than zero, Event will also be\r | |
1008 | signaled after Timeout 100 ns units.\r | |
1009 | The StartLba and SectorSize parameters are used to construct the CDB for this\r | |
1010 | SCSI command.\r | |
1011 | \r | |
1012 | If ScsiIo is NULL, then ASSERT().\r | |
1013 | If SenseDataLength is NULL, then ASSERT().\r | |
1014 | If HostAdapterStatus is NULL, then ASSERT().\r | |
1015 | If TargetStatus is NULL, then ASSERT().\r | |
1016 | If DataLength is NULL, then ASSERT().\r | |
1017 | \r | |
1018 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r | |
1019 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
1020 | EFI_INVALID_PARAMETER gets returned.\r | |
1021 | \r | |
1022 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r | |
1023 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
1024 | EFI_INVALID_PARAMETER gets returned.\r | |
1025 | \r | |
1026 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
1027 | @param[in] Timeout The length of timeout period.\r | |
1028 | @param[in, out] SenseData A pointer to output sense data.\r | |
1029 | @param[in, out] SenseDataLength The length of output sense data.\r | |
1030 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
1031 | @param[out] TargetStatus The status of the target.\r | |
1032 | @param[in, out] DataBuffer Read 16 command data.\r | |
1033 | @param[in, out] DataLength The length of data buffer.\r | |
1034 | @param[in] StartLba The start address of LBA.\r | |
1035 | @param[in] SectorSize The number of contiguous logical blocks\r | |
1036 | of data that shall be transferred.\r | |
1037 | @param[in] Event If the SCSI target does not support\r | |
1038 | non-blocking I/O, then Event is ignored,\r | |
1039 | and blocking I/O is performed. If Event\r | |
1040 | is NULL, then blocking I/O is performed.\r | |
1041 | If Event is not NULL and non-blocking\r | |
1042 | I/O is supported, then non-blocking I/O\r | |
1043 | is performed, and Event will be signaled\r | |
1044 | when the SCSI Read(16) command\r | |
1045 | completes.\r | |
1046 | \r | |
1047 | @retval EFI_SUCCESS Command is executed successfully.\r | |
1048 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r | |
1049 | but the entire DataBuffer could not be\r | |
1050 | transferred. The actual number of bytes\r | |
1051 | transferred is returned in DataLength.\r | |
1052 | @retval EFI_NOT_READY The SCSI Request Packet could not be\r | |
1053 | sent because there are too many SCSI\r | |
1054 | Command Packets already queued.\r | |
1055 | @retval EFI_DEVICE_ERROR A device error occurred while attempting\r | |
1056 | to send SCSI Request Packet.\r | |
1057 | @retval EFI_UNSUPPORTED The command described by the SCSI\r | |
1058 | Request Packet is not supported by the\r | |
1059 | SCSI initiator(i.e., SCSI Host\r | |
1060 | Controller)\r | |
1061 | @retval EFI_TIMEOUT A timeout occurred while waiting for the\r | |
1062 | SCSI Request Packet to execute.\r | |
1063 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r | |
1064 | are invalid.\r | |
1065 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r | |
1066 | to a lack of resources.\r | |
1067 | \r | |
1068 | **/\r | |
1069 | EFI_STATUS\r | |
1070 | EFIAPI\r | |
1071 | ScsiRead16CommandEx (\r | |
1072 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
1073 | IN UINT64 Timeout,\r | |
1074 | IN OUT VOID *SenseData, OPTIONAL\r | |
1075 | IN OUT UINT8 *SenseDataLength,\r | |
1076 | OUT UINT8 *HostAdapterStatus,\r | |
1077 | OUT UINT8 *TargetStatus,\r | |
1078 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
1079 | IN OUT UINT32 *DataLength,\r | |
1080 | IN UINT64 StartLba,\r | |
1081 | IN UINT32 SectorSize,\r | |
1082 | IN EFI_EVENT Event OPTIONAL\r | |
1083 | );\r | |
1084 | \r | |
1085 | \r | |
1086 | /**\r | |
1087 | Execute blocking/non-blocking Write(16) SCSI command on a specific SCSI\r | |
1088 | target.\r | |
1089 | \r | |
1090 | Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.\r | |
1091 | When Event is NULL, blocking command will be executed. Otherwise non-blocking\r | |
1092 | command will be executed.\r | |
1093 | For blocking I/O, if Timeout is zero, this function will wait indefinitely\r | |
1094 | for the command to complete. If Timeout is greater than zero, then the\r | |
1095 | command is executed and will timeout after Timeout 100 ns units.\r | |
1096 | For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r | |
1097 | the command to completes. If Timeout is greater than zero, Event will also be\r | |
1098 | signaled after Timeout 100 ns units.\r | |
1099 | The StartLba and SectorSize parameters are used to construct the CDB for this\r | |
1100 | SCSI command.\r | |
1101 | \r | |
1102 | If ScsiIo is NULL, then ASSERT().\r | |
1103 | If SenseDataLength is NULL, then ASSERT().\r | |
1104 | If HostAdapterStatus is NULL, then ASSERT().\r | |
1105 | If TargetStatus is NULL, then ASSERT().\r | |
1106 | If DataLength is NULL, then ASSERT().\r | |
1107 | \r | |
1108 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r | |
1109 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
1110 | EFI_INVALID_PARAMETER gets returned.\r | |
1111 | \r | |
1112 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r | |
1113 | buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
1114 | EFI_INVALID_PARAMETER gets returned.\r | |
1115 | \r | |
1116 | @param[in] ScsiIo SCSI IO Protocol to use\r | |
1117 | @param[in] Timeout The length of timeout period.\r | |
1118 | @param[in, out] SenseData A pointer to output sense data.\r | |
1119 | @param[in, out] SenseDataLength The length of output sense data.\r | |
1120 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
1121 | @param[out] TargetStatus The status of the target.\r | |
1122 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
1123 | @param[in, out] DataLength The length of data buffer.\r | |
1124 | @param[in] StartLba The start address of LBA.\r | |
1125 | @param[in] SectorSize The number of contiguous logical blocks\r | |
1126 | of data that shall be transferred.\r | |
1127 | @param[in] Event If the SCSI target does not support\r | |
1128 | non-blocking I/O, then Event is ignored,\r | |
1129 | and blocking I/O is performed. If Event\r | |
1130 | is NULL, then blocking I/O is performed.\r | |
1131 | If Event is not NULL and non-blocking\r | |
1132 | I/O is supported, then non-blocking I/O\r | |
1133 | is performed, and Event will be signaled\r | |
1134 | when the SCSI Write(16) command\r | |
1135 | completes.\r | |
1136 | \r | |
1137 | @retval EFI_SUCCESS Command is executed successfully.\r | |
1138 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,\r | |
1139 | but the entire DataBuffer could not be\r | |
1140 | transferred. The actual number of bytes\r | |
1141 | transferred is returned in DataLength.\r | |
1142 | @retval EFI_NOT_READY The SCSI Request Packet could not be\r | |
1143 | sent because there are too many SCSI\r | |
1144 | Command Packets already queued.\r | |
1145 | @retval EFI_DEVICE_ERROR A device error occurred while attempting\r | |
1146 | to send SCSI Request Packet.\r | |
1147 | @retval EFI_UNSUPPORTED The command described by the SCSI\r | |
1148 | Request Packet is not supported by the\r | |
1149 | SCSI initiator(i.e., SCSI Host\r | |
1150 | Controller)\r | |
1151 | @retval EFI_TIMEOUT A timeout occurred while waiting for the\r | |
1152 | SCSI Request Packet to execute.\r | |
1153 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet\r | |
1154 | are invalid.\r | |
1155 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due\r | |
1156 | to a lack of resources.\r | |
1157 | \r | |
1158 | **/\r | |
1159 | EFI_STATUS\r | |
1160 | EFIAPI\r | |
1161 | ScsiWrite16CommandEx (\r | |
1162 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
1163 | IN UINT64 Timeout,\r | |
1164 | IN OUT VOID *SenseData, OPTIONAL\r | |
1165 | IN OUT UINT8 *SenseDataLength,\r | |
1166 | OUT UINT8 *HostAdapterStatus,\r | |
1167 | OUT UINT8 *TargetStatus,\r | |
1168 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
1169 | IN OUT UINT32 *DataLength,\r | |
1170 | IN UINT64 StartLba,\r | |
1171 | IN UINT32 SectorSize,\r | |
1172 | IN EFI_EVENT Event OPTIONAL\r | |
1173 | );\r | |
1174 | \r | |
1175 | #endif\r |