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