]>
Commit | Line | Data |
---|---|---|
842f5579 | 1 | /** @file\r |
1a2f870c | 2 | Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.\r |
fb3df220 | 3 | \r |
cf8ae2f6 | 4 | This library class provides the functions to submit SCSI commands defined in SCSI-2 specification\r |
5 | for hard drive, CD and DVD devices that are the most common SCSI boot targets used by UEFI platforms.\r | |
6 | This library class depends on SCSI I/O Protocol defined in UEFI Specification and SCSI-2 industry standard.\r | |
7 | \r | |
d658727b | 8 | Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r |
9df063a0 | 9 | This program and the accompanying materials \r |
50a64e5b | 10 | are licensed and made available under the terms and conditions of the BSD License \r |
11 | which accompanies this distribution. The full text of the license may be found at \r | |
12 | http://opensource.org/licenses/bsd-license.php \r | |
13 | \r | |
14 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
15 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
fb3df220 | 16 | \r |
842f5579 | 17 | **/\r |
fb3df220 | 18 | \r |
c1f1e9ac | 19 | #ifndef __SCSI_LIB_H__\r |
20 | #define __SCSI_LIB_H__\r | |
fb3df220 | 21 | \r |
c7d265a9 | 22 | #include <Protocol/ScsiIo.h>\r |
23 | \r | |
fc30687f | 24 | /**\r |
d5954c61 | 25 | Execute Test Unit Ready SCSI command on a specific SCSI target.\r |
b91d5eca | 26 | \r |
d5954c61 | 27 | Executes the Test Unit Ready command on the SCSI target specified by ScsiIo.\r |
28 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
29 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
30 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 31 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 32 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 33 | If TargetStatus is NULL, then ASSERT().\r |
34 | \r | |
d658727b FT |
35 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
36 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
37 | gets returned.\r | |
d5954c61 | 38 | \r |
39 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
40 | for the specific SCSI target.\r | |
41 | @param[in] Timeout The timeout in 100 ns units to use for the execution\r | |
42 | of this SCSI Request Packet. A Timeout value of\r | |
43 | zero means that this function will wait indefinitely\r | |
44 | for the SCSI Request Packet to execute. If Timeout\r | |
45 | is greater than zero, then this function will return\r | |
46 | EFI_TIMEOUT if the time required to execute the SCSI\r | |
47 | Request Packet is greater than Timeout.\r | |
48 | @param[in, out] SenseData A pointer to sense data that was generated by\r | |
49 | the execution of the SCSI Request Packet. This\r | |
50 | buffer must be allocated by the caller.\r | |
51 | If SenseDataLength is 0, then this parameter is\r | |
52 | optional and may be NULL.\r | |
53 | @param[in, out] SenseDataLength On input, a pointer to the length in bytes of\r | |
9638ba6d | 54 | the SenseData buffer. On output, a pointer to\r |
d5954c61 | 55 | the number of bytes written to the SenseData buffer. \r |
56 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces\r | |
57 | the SCSI bus containing the SCSI target specified by\r | |
58 | ScsiIo when the SCSI Request Packet was executed.\r | |
59 | See the EFI SCSI I/O Protocol in the UEFI Specification\r | |
60 | for details on the possible return values.\r | |
61 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
9638ba6d | 62 | by ScsiIo when the SCSI Request Packet was executed\r |
d5954c61 | 63 | on the SCSI Host Controller. See the EFI SCSI I/O\r |
64 | Protocol in the UEFI Specification for details on\r | |
65 | the possible return values. \r | |
66 | \r | |
d658727b FT |
67 | @retval EFI_SUCCESS The command was executed successfully.\r |
68 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
69 | and SenseData in that order for additional status\r | |
70 | information.\r | |
71 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
72 | there are too many SCSI Command Packets already\r | |
73 | queued. The SCSI Request Packet was not sent, so\r | |
74 | no additional status information is available.\r | |
75 | The caller may retry again later.\r | |
76 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
77 | SCSI Request Packet. See HostAdapterStatus,\r | |
78 | TargetStatus, SenseDataLength, and SenseData in that\r | |
79 | order for additional status information.\r | |
80 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
81 | is not supported by the SCSI initiator(i.e., SCSI\r | |
82 | Host Controller). The SCSI Request Packet was not\r | |
83 | sent, so no additional status information is available.\r | |
84 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
85 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
86 | SenseDataLength, and SenseData in that order for\r | |
87 | additional status information.\r | |
88 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
fc30687f | 89 | \r |
bf231ea6 | 90 | **/\r |
fb3df220 | 91 | EFI_STATUS\r |
373b5cf9 | 92 | EFIAPI\r |
d35be2a4 | 93 | ScsiTestUnitReadyCommand (\r |
d5954c61 | 94 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
95 | IN UINT64 Timeout,\r | |
96 | IN OUT VOID *SenseData, OPTIONAL\r | |
97 | IN OUT UINT8 *SenseDataLength,\r | |
98 | OUT UINT8 *HostAdapterStatus,\r | |
99 | OUT UINT8 *TargetStatus\r | |
bf231ea6 A |
100 | );\r |
101 | \r | |
102 | \r | |
fc30687f | 103 | /**\r |
d5954c61 | 104 | Execute Inquiry SCSI command on a specific SCSI target.\r |
b91d5eca | 105 | \r |
d5954c61 | 106 | Executes the Inquiry command on the SCSI target specified by ScsiIo.\r |
107 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
108 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
109 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 110 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 111 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 112 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 113 | If InquiryDataLength is NULL, then ASSERT().\r |
114 | \r | |
d658727b FT |
115 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
116 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
117 | gets returned.\r | |
118 | \r | |
119 | If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer\r | |
120 | must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
121 | EFI_INVALID_PARAMETER gets returned.\r | |
122 | \r | |
d5954c61 | 123 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r |
124 | for the specific SCSI target.\r | |
125 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
126 | execution of this SCSI Request Packet. A Timeout\r | |
127 | value of zero means that this function will wait\r | |
128 | indefinitely for the SCSI Request Packet to execute.\r | |
129 | If Timeout is greater than zero, then this function\r | |
130 | will return EFI_TIMEOUT if the time required to\r | |
131 | execute the SCSI Request Packet is greater than Timeout.\r | |
132 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
133 | by the execution of the SCSI Request Packet.\r | |
134 | This buffer must be allocated by the caller.\r | |
135 | If SenseDataLength is 0, then this parameter\r | |
136 | is optional and may be NULL.\r | |
137 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
138 | On output, the number of bytes written to the SenseData buffer. \r | |
139 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
140 | produces the SCSI bus containing the SCSI\r | |
141 | target specified by ScsiIo when the SCSI\r | |
142 | Request Packet was executed. See the EFI\r | |
143 | SCSI I/O Protocol in the UEFI Specification\r | |
144 | for details on the possible return values.\r | |
145 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
9638ba6d | 146 | by ScsiIo when the SCSI Request Packet was\r |
d5954c61 | 147 | executed on the SCSI Host Controller.\r |
148 | See the EFI SCSI I/O Protocol in the UEFI\r | |
149 | Specification for details on the possible\r | |
150 | return values. \r | |
151 | @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r | |
152 | by the execution of the SCSI Request Packet.\r | |
153 | This buffer must be allocated by the caller.\r | |
154 | If InquiryDataLength is 0, then this parameter\r | |
155 | is optional and may be NULL. \r | |
156 | @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r | |
157 | of the InquiryDataBuffer buffer.\r | |
158 | On output, a pointer to the number of bytes\r | |
159 | written to the InquiryDataBuffer buffer.\r | |
160 | @param[in] EnableVitalProductData If TRUE, then the supported vital product\r | |
161 | data is returned in InquiryDataBuffer.\r | |
162 | If FALSE, then the standard inquiry data is\r | |
163 | returned in InquiryDataBuffer. \r | |
164 | \r | |
d658727b FT |
165 | @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,\r |
166 | TargetStatus, SenseDataLength, and SenseData in that order\r | |
167 | for additional status information.\r | |
168 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
169 | InquiryDataBuffer could not be transferred. The actual\r | |
170 | number of bytes transferred is returned in InquiryDataLength.\r | |
171 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r | |
172 | are too many SCSI Command Packets already queued.\r | |
173 | The SCSI Request Packet was not sent, so no additional\r | |
174 | status information is available. The caller may retry again later.\r | |
175 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r | |
176 | Request Packet. See HostAdapterStatus, TargetStatus,\r | |
177 | SenseDataLength, and SenseData in that order for additional\r | |
178 | status information.\r | |
179 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r | |
180 | supported by the SCSI initiator(i.e., SCSI Host Controller).\r | |
181 | The SCSI Request Packet was not sent, so no additional\r | |
182 | status information is available.\r | |
183 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
184 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
185 | SenseDataLength, and SenseData in that order for\r | |
186 | additional status information.\r | |
187 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
fc30687f | 188 | \r |
bf231ea6 | 189 | **/\r |
fb3df220 | 190 | EFI_STATUS\r |
373b5cf9 | 191 | EFIAPI\r |
d35be2a4 | 192 | ScsiInquiryCommand (\r |
d5954c61 | 193 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
194 | IN UINT64 Timeout,\r | |
195 | IN OUT VOID *SenseData, OPTIONAL\r | |
196 | IN OUT UINT8 *SenseDataLength,\r | |
197 | OUT UINT8 *HostAdapterStatus,\r | |
198 | OUT UINT8 *TargetStatus,\r | |
199 | IN OUT VOID *InquiryDataBuffer, OPTIONAL\r | |
200 | IN OUT UINT32 *InquiryDataLength,\r | |
201 | IN BOOLEAN EnableVitalProductData\r | |
bf231ea6 A |
202 | );\r |
203 | \r | |
204 | \r | |
b8a62661 RN |
205 | /**\r |
206 | Execute Inquiry SCSI command on a specific SCSI target.\r | |
207 | \r | |
208 | Executes the Inquiry command on the SCSI target specified by ScsiIo.\r | |
209 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
210 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
211 | If ScsiIo is NULL, then ASSERT().\r | |
212 | If SenseDataLength is NULL, then ASSERT().\r | |
213 | If HostAdapterStatus is NULL, then ASSERT().\r | |
214 | If TargetStatus is NULL, then ASSERT().\r | |
215 | If InquiryDataLength is NULL, then ASSERT().\r | |
216 | \r | |
d658727b FT |
217 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
218 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
219 | gets returned.\r | |
220 | \r | |
221 | If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer\r | |
222 | must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r | |
223 | EFI_INVALID_PARAMETER gets returned.\r | |
224 | \r | |
b8a62661 RN |
225 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r |
226 | for the specific SCSI target.\r | |
227 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
228 | execution of this SCSI Request Packet. A Timeout\r | |
229 | value of zero means that this function will wait\r | |
230 | indefinitely for the SCSI Request Packet to execute.\r | |
231 | If Timeout is greater than zero, then this function\r | |
232 | will return EFI_TIMEOUT if the time required to\r | |
233 | execute the SCSI Request Packet is greater than Timeout.\r | |
234 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
235 | by the execution of the SCSI Request Packet.\r | |
236 | This buffer must be allocated by the caller.\r | |
237 | If SenseDataLength is 0, then this parameter\r | |
238 | is optional and may be NULL.\r | |
239 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
240 | On output, the number of bytes written to the SenseData buffer. \r | |
241 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
242 | produces the SCSI bus containing the SCSI\r | |
243 | target specified by ScsiIo when the SCSI\r | |
244 | Request Packet was executed. See the EFI\r | |
245 | SCSI I/O Protocol in the UEFI Specification\r | |
246 | for details on the possible return values.\r | |
247 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
248 | by ScsiIo when the SCSI Request Packet was\r | |
249 | executed on the SCSI Host Controller.\r | |
250 | See the EFI SCSI I/O Protocol in the UEFI\r | |
251 | Specification for details on the possible\r | |
252 | return values. \r | |
253 | @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r | |
254 | by the execution of the SCSI Request Packet.\r | |
255 | This buffer must be allocated by the caller.\r | |
256 | If InquiryDataLength is 0, then this parameter\r | |
257 | is optional and may be NULL. \r | |
258 | @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r | |
259 | of the InquiryDataBuffer buffer.\r | |
260 | On output, a pointer to the number of bytes\r | |
261 | written to the InquiryDataBuffer buffer.\r | |
262 | @param[in] EnableVitalProductData If TRUE, then the supported vital product\r | |
263 | data for the PageCode is returned in InquiryDataBuffer.\r | |
264 | If FALSE, then the standard inquiry data is\r | |
265 | returned in InquiryDataBuffer and PageCode is ignored.\r | |
266 | @param[in] PageCode The page code of the vital product data.\r | |
267 | It's ignored if EnableVitalProductData is FALSE.\r | |
268 | \r | |
d658727b FT |
269 | @retval EFI_SUCCESS The command executed successfully. See HostAdapterStatus,\r |
270 | TargetStatus, SenseDataLength, and SenseData in that order\r | |
271 | for additional status information.\r | |
272 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
273 | InquiryDataBuffer could not be transferred. The actual\r | |
274 | number of bytes transferred is returned in InquiryDataLength.\r | |
275 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r | |
276 | are too many SCSI Command Packets already queued.\r | |
277 | The SCSI Request Packet was not sent, so no additional\r | |
278 | status information is available. The caller may retry again later.\r | |
279 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r | |
280 | Request Packet. See HostAdapterStatus, TargetStatus,\r | |
281 | SenseDataLength, and SenseData in that order for additional\r | |
282 | status information.\r | |
283 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r | |
284 | supported by the SCSI initiator(i.e., SCSI Host Controller).\r | |
285 | The SCSI Request Packet was not sent, so no additional\r | |
286 | status information is available.\r | |
287 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
288 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
289 | SenseDataLength, and SenseData in that order for\r | |
290 | additional status information.\r | |
291 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
b8a62661 RN |
292 | \r |
293 | **/\r | |
294 | EFI_STATUS\r | |
295 | EFIAPI\r | |
296 | ScsiInquiryCommandEx (\r | |
297 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
298 | IN UINT64 Timeout,\r | |
299 | IN OUT VOID *SenseData, OPTIONAL\r | |
300 | IN OUT UINT8 *SenseDataLength,\r | |
301 | OUT UINT8 *HostAdapterStatus,\r | |
302 | OUT UINT8 *TargetStatus,\r | |
303 | IN OUT VOID *InquiryDataBuffer, OPTIONAL\r | |
304 | IN OUT UINT32 *InquiryDataLength,\r | |
305 | IN BOOLEAN EnableVitalProductData,\r | |
306 | IN UINT8 PageCode\r | |
307 | );\r | |
308 | \r | |
309 | \r | |
fc30687f | 310 | /**\r |
d5954c61 | 311 | Execute Mode Sense(10) SCSI command on a specific SCSI target.\r |
312 | \r | |
313 | Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.\r | |
314 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
315 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
316 | after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters\r | |
317 | are used to construct the CDB for this SCSI command.\r | |
318 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 319 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 320 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 321 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 322 | If DataLength is NULL, then ASSERT().\r |
323 | \r | |
d658727b FT |
324 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
325 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
326 | gets returned.\r | |
327 | \r | |
328 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r | |
329 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
330 | gets returned.\r | |
d5954c61 | 331 | \r |
332 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
333 | for the specific SCSI target.\r | |
334 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
335 | execution of this SCSI Request Packet. A Timeout\r | |
336 | value of zero means that this function will wait\r | |
337 | indefinitely for the SCSI Request Packet to execute.\r | |
338 | If Timeout is greater than zero, then this function\r | |
339 | will return EFI_TIMEOUT if the time required to\r | |
340 | execute the SCSI Request Packet is greater than Timeout.\r | |
adde977a | 341 | @param[in, out] SenseData A pointer to sense data that was generated\r |
d5954c61 | 342 | by the execution of the SCSI Request Packet.\r |
343 | This buffer must be allocated by the caller.\r | |
344 | If SenseDataLength is 0, then this parameter\r | |
345 | is optional and may be NULL.\r | |
adde977a | 346 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r |
d5954c61 | 347 | On output, the number of bytes written to the SenseData buffer. \r |
348 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
349 | produces the SCSI bus containing the SCSI target\r | |
350 | specified by ScsiIo when the SCSI Request Packet\r | |
351 | was executed. See the EFI SCSI I/O Protocol in the\r | |
352 | UEFI Specification for details on the possible\r | |
353 | return values.\r | |
354 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
9638ba6d | 355 | by ScsiIo when the SCSI Request Packet was executed\r |
d5954c61 | 356 | on the SCSI Host Controller. See the EFI SCSI\r |
357 | I/O Protocol in the UEFI Specification for details\r | |
358 | on the possible return values.\r | |
adde977a | 359 | @param[in, out] DataBuffer A pointer to data that was generated by the\r |
d5954c61 | 360 | execution of the SCSI Request Packet. This\r |
361 | buffer must be allocated by the caller. If\r | |
362 | DataLength is 0, then this parameter is optional\r | |
363 | and may be NULL. \r | |
adde977a | 364 | @param[in, out] DataLength On input, a pointer to the length in bytes of\r |
d5954c61 | 365 | the DataBuffer buffer. On output, a pointer\r |
366 | to the number of bytes written to the DataBuffer\r | |
367 | buffer. \r | |
368 | @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r | |
369 | @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. \r | |
370 | @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. \r | |
371 | \r | |
d658727b FT |
372 | @retval EFI_SUCCESS The command was executed successfully.\r |
373 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
374 | and SenseData in that order for additional status information.\r | |
375 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the\r | |
376 | entire DataBuffer could not be transferred.\r | |
377 | The actual number of bytes transferred is returned\r | |
378 | in DataLength.\r | |
379 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
380 | there are too many SCSI Command Packets already queued.\r | |
381 | The SCSI Request Packet was not sent, so no additional\r | |
382 | status information is available. The caller may retry\r | |
383 | again later.\r | |
384 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
385 | SCSI Request Packet. See HostAdapterStatus, TargetStatus,\r | |
386 | SenseDataLength, and SenseData in that order for\r | |
387 | additional status information.\r | |
388 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
389 | is not supported by the SCSI initiator(i.e., SCSI\r | |
390 | Host Controller). The SCSI Request Packet was not\r | |
391 | sent, so no additional status information is available.\r | |
392 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r | |
393 | Request Packet to execute. See HostAdapterStatus,\r | |
394 | TargetStatus, SenseDataLength, and SenseData in that\r | |
395 | order for additional status information.\r | |
396 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
fc30687f | 397 | \r |
bf231ea6 | 398 | **/\r |
fb3df220 | 399 | EFI_STATUS\r |
373b5cf9 | 400 | EFIAPI\r |
d35be2a4 | 401 | ScsiModeSense10Command (\r |
d5954c61 | 402 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
403 | IN UINT64 Timeout,\r | |
404 | IN OUT VOID *SenseData, OPTIONAL\r | |
405 | IN OUT UINT8 *SenseDataLength,\r | |
406 | OUT UINT8 *HostAdapterStatus,\r | |
407 | OUT UINT8 *TargetStatus,\r | |
408 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
409 | IN OUT UINT32 *DataLength,\r | |
410 | IN UINT8 DBDField, OPTIONAL\r | |
411 | IN UINT8 PageControl,\r | |
412 | IN UINT8 PageCode\r | |
bf231ea6 A |
413 | );\r |
414 | \r | |
415 | \r | |
416 | \r | |
fc30687f | 417 | /**\r |
d5954c61 | 418 | Execute Request Sense SCSI command on a specific SCSI target.\r |
b91d5eca | 419 | \r |
d5954c61 | 420 | Executes the Request Sense command on the SCSI target specified by ScsiIo.\r |
421 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
422 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
423 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 424 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 425 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 426 | If TargetStatus is NULL, then ASSERT().\r |
427 | \r | |
d658727b FT |
428 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
429 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
430 | gets returned.\r | |
431 | \r | |
b91d5eca | 432 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r |
433 | @param[in] Timeout The length of timeout period.\r | |
d5954c61 | 434 | @param[in, out] SenseData A pointer to output sense data.\r |
435 | @param[in, out] SenseDataLength The length of output sense data.\r | |
b91d5eca | 436 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
437 | @param[out] TargetStatus The status of the target.\r | |
438 | \r | |
439 | @retval EFI_SUCCESS Command is executed successfully.\r | |
440 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are\r | |
441 | too many SCSI Command Packets already queued.\r | |
442 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
443 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
444 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
445 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
d658727b | 446 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r |
fc30687f | 447 | \r |
bf231ea6 | 448 | **/\r |
fb3df220 | 449 | EFI_STATUS\r |
373b5cf9 | 450 | EFIAPI\r |
d35be2a4 | 451 | ScsiRequestSenseCommand (\r |
d5954c61 | 452 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
453 | IN UINT64 Timeout,\r | |
454 | IN OUT VOID *SenseData, OPTIONAL\r | |
455 | IN OUT UINT8 *SenseDataLength,\r | |
456 | OUT UINT8 *HostAdapterStatus,\r | |
457 | OUT UINT8 *TargetStatus\r | |
bf231ea6 A |
458 | );\r |
459 | \r | |
460 | \r | |
fc30687f | 461 | /**\r |
d5954c61 | 462 | Execute Read Capacity SCSI command on a specific SCSI target.\r |
b91d5eca | 463 | \r |
d5954c61 | 464 | Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r |
465 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
466 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
51969ecb | 467 | Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r |
d5954c61 | 468 | If ScsiIo is NULL, then ASSERT().\r |
b91d5eca | 469 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 470 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 471 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 472 | If DataLength is NULL, then ASSERT().\r |
473 | \r | |
d658727b FT |
474 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
475 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
476 | gets returned.\r | |
477 | \r | |
478 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r | |
479 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
480 | gets returned.\r | |
481 | \r | |
d5954c61 | 482 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r |
483 | @param[in] Timeout The length of timeout period.\r | |
484 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 485 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 486 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
487 | @param[out] TargetStatus The status of the target.\r | |
488 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 489 | @param[in, out] DataLength The length of data buffer.\r |
51969ecb | 490 | @param[in] Pmi Partial medium indicator.\r |
b91d5eca | 491 | \r |
d658727b FT |
492 | @retval EFI_SUCCESS Command is executed successfully.\r |
493 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
494 | DataBuffer could not be transferred. The actual\r | |
495 | number of bytes transferred is returned in DataLength.\r | |
496 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
497 | there are too many SCSI Command Packets already queued.\r | |
498 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
499 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
500 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
501 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
502 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
fc30687f | 503 | \r |
bf231ea6 | 504 | **/\r |
fb3df220 | 505 | EFI_STATUS\r |
9199040c | 506 | EFIAPI\r |
d35be2a4 | 507 | ScsiReadCapacityCommand (\r |
d5954c61 | 508 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
509 | IN UINT64 Timeout,\r | |
510 | IN OUT VOID *SenseData, OPTIONAL\r | |
511 | IN OUT UINT8 *SenseDataLength,\r | |
512 | OUT UINT8 *HostAdapterStatus,\r | |
513 | OUT UINT8 *TargetStatus,\r | |
514 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
515 | IN OUT UINT32 *DataLength,\r | |
51969ecb | 516 | IN BOOLEAN Pmi\r |
bf231ea6 A |
517 | );\r |
518 | \r | |
519 | \r | |
ccb491c8 | 520 | /**\r |
5e11e7c6 | 521 | Execute Read Capacity SCSI 16 command on a specific SCSI target.\r |
522 | \r | |
523 | Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.\r | |
524 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
525 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
526 | Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r | |
527 | If ScsiIo is NULL, then ASSERT().\r | |
528 | If SenseDataLength is NULL, then ASSERT().\r | |
529 | If HostAdapterStatus is NULL, then ASSERT().\r | |
530 | If TargetStatus is NULL, then ASSERT().\r | |
531 | If DataLength is NULL, then ASSERT().\r | |
532 | \r | |
d658727b FT |
533 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
534 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
535 | gets returned.\r | |
536 | \r | |
537 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r | |
538 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
539 | gets returned.\r | |
540 | \r | |
5e11e7c6 | 541 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r |
542 | @param[in] Timeout The length of timeout period.\r | |
543 | @param[in, out] SenseData A pointer to output sense data.\r | |
544 | @param[in, out] SenseDataLength The length of output sense data.\r | |
545 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
546 | @param[out] TargetStatus The status of the target.\r | |
547 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
548 | @param[in, out] DataLength The length of data buffer.\r | |
549 | @param[in] Pmi Partial medium indicator.\r | |
550 | \r | |
d658727b FT |
551 | @retval EFI_SUCCESS Command is executed successfully.\r |
552 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
553 | DataBuffer could not be transferred. The actual\r | |
554 | number of bytes transferred is returned in DataLength.\r | |
555 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
556 | there are too many SCSI Command Packets already queued.\r | |
557 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
558 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
559 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
560 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
561 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
ccb491c8 | 562 | \r |
563 | **/\r | |
ccb491c8 | 564 | EFI_STATUS\r |
565 | EFIAPI\r | |
566 | ScsiReadCapacity16Command (\r | |
f158ee67 | 567 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
568 | IN UINT64 Timeout,\r | |
569 | IN OUT VOID *SenseData, OPTIONAL\r | |
570 | IN OUT UINT8 *SenseDataLength,\r | |
571 | OUT UINT8 *HostAdapterStatus,\r | |
572 | OUT UINT8 *TargetStatus,\r | |
573 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
574 | IN OUT UINT32 *DataLength,\r | |
575 | IN BOOLEAN Pmi\r | |
ccb491c8 | 576 | );\r |
577 | \r | |
578 | \r | |
fc30687f | 579 | /**\r |
d5954c61 | 580 | Execute Read(10) SCSI command on a specific SCSI target.\r |
581 | \r | |
582 | Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r | |
583 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
584 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
585 | after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r | |
586 | construct the CDB for this SCSI command.\r | |
587 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 588 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 589 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 590 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 591 | If DataLength is NULL, then ASSERT().\r |
592 | \r | |
d658727b FT |
593 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
594 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
595 | gets returned.\r | |
596 | \r | |
597 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r | |
598 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
599 | gets returned.\r | |
d5954c61 | 600 | \r |
601 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
602 | @param[in] Timeout The length of timeout period.\r | |
603 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 604 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 605 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
606 | @param[out] TargetStatus The status of the target.\r | |
607 | @param[in, out] DataBuffer Read 10 command data.\r | |
6053411e | 608 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 609 | @param[in] StartLba The start address of LBA.\r |
b95eb5e0 | 610 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
b91d5eca | 611 | \r |
d658727b FT |
612 | @retval EFI_SUCCESS Command is executed successfully.\r |
613 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
614 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
615 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r | |
616 | SCSI Command Packets already queued.\r | |
617 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
618 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
619 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
620 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
621 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
fc30687f | 622 | \r |
bf231ea6 | 623 | **/\r |
fb3df220 | 624 | EFI_STATUS\r |
373b5cf9 | 625 | EFIAPI\r |
d35be2a4 | 626 | ScsiRead10Command (\r |
d5954c61 | 627 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
628 | IN UINT64 Timeout,\r | |
629 | IN OUT VOID *SenseData, OPTIONAL\r | |
630 | IN OUT UINT8 *SenseDataLength,\r | |
631 | OUT UINT8 *HostAdapterStatus,\r | |
632 | OUT UINT8 *TargetStatus,\r | |
633 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
634 | IN OUT UINT32 *DataLength,\r | |
635 | IN UINT32 StartLba,\r | |
636 | IN UINT32 SectorSize\r | |
bf231ea6 A |
637 | );\r |
638 | \r | |
639 | \r | |
fc30687f | 640 | /**\r |
d5954c61 | 641 | Execute Write(10) SCSI command on a specific SCSI target.\r |
642 | \r | |
643 | Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r | |
644 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
645 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
646 | Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r | |
647 | the CDB for this SCSI command.\r | |
648 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 649 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 650 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 651 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 652 | If DataLength is NULL, then ASSERT().\r |
653 | \r | |
d658727b FT |
654 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
655 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
656 | gets returned.\r | |
657 | \r | |
658 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r | |
659 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
660 | gets returned.\r | |
661 | \r | |
d5954c61 | 662 | @param[in] ScsiIo SCSI IO Protocol to use\r |
663 | @param[in] Timeout The length of timeout period.\r | |
664 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 665 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 666 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
667 | @param[out] TargetStatus The status of the target.\r | |
668 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 669 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 670 | @param[in] StartLba The start address of LBA.\r |
b95eb5e0 | 671 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
b91d5eca | 672 | \r |
d658727b FT |
673 | @retval EFI_SUCCESS Command is executed successfully.\r |
674 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
675 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
676 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r | |
677 | SCSI Command Packets already queued.\r | |
678 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
679 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
680 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
681 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
682 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
fc30687f | 683 | \r |
bf231ea6 | 684 | **/\r |
fb3df220 | 685 | EFI_STATUS\r |
373b5cf9 | 686 | EFIAPI\r |
d35be2a4 | 687 | ScsiWrite10Command (\r |
d5954c61 | 688 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
689 | IN UINT64 Timeout,\r | |
690 | IN OUT VOID *SenseData, OPTIONAL\r | |
691 | IN OUT UINT8 *SenseDataLength,\r | |
692 | OUT UINT8 *HostAdapterStatus,\r | |
693 | OUT UINT8 *TargetStatus,\r | |
694 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
695 | IN OUT UINT32 *DataLength,\r | |
696 | IN UINT32 StartLba,\r | |
697 | IN UINT32 SectorSize\r | |
bf231ea6 | 698 | );\r |
fb3df220 | 699 | \r |
a24faca3 | 700 | /**\r |
701 | Execute Read(16) SCSI command on a specific SCSI target.\r | |
702 | \r | |
703 | Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.\r | |
704 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
705 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
706 | after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r | |
707 | construct the CDB for this SCSI command.\r | |
708 | If ScsiIo is NULL, then ASSERT().\r | |
709 | If SenseDataLength is NULL, then ASSERT().\r | |
710 | If HostAdapterStatus is NULL, then ASSERT().\r | |
711 | If TargetStatus is NULL, then ASSERT().\r | |
712 | If DataLength is NULL, then ASSERT().\r | |
713 | \r | |
d658727b FT |
714 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
715 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
716 | gets returned.\r | |
717 | \r | |
718 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r | |
719 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
720 | gets returned.\r | |
a24faca3 | 721 | \r |
722 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
723 | @param[in] Timeout The length of timeout period.\r | |
724 | @param[in, out] SenseData A pointer to output sense data.\r | |
725 | @param[in, out] SenseDataLength The length of output sense data.\r | |
726 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
727 | @param[out] TargetStatus The status of the target.\r | |
728 | @param[in, out] DataBuffer Read 16 command data.\r | |
729 | @param[in, out] DataLength The length of data buffer.\r | |
730 | @param[in] StartLba The start address of LBA.\r | |
b95eb5e0 | 731 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
a24faca3 | 732 | \r |
d658727b FT |
733 | @retval EFI_SUCCESS Command is executed successfully.\r |
734 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
735 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
736 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r | |
737 | SCSI Command Packets already queued.\r | |
738 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
739 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
740 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
741 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
742 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
a24faca3 | 743 | \r |
744 | **/\r | |
745 | EFI_STATUS\r | |
746 | EFIAPI\r | |
747 | ScsiRead16Command (\r | |
748 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
749 | IN UINT64 Timeout,\r | |
750 | IN OUT VOID *SenseData, OPTIONAL\r | |
751 | IN OUT UINT8 *SenseDataLength,\r | |
752 | OUT UINT8 *HostAdapterStatus,\r | |
753 | OUT UINT8 *TargetStatus,\r | |
754 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
755 | IN OUT UINT32 *DataLength,\r | |
756 | IN UINT64 StartLba,\r | |
757 | IN UINT32 SectorSize\r | |
758 | );\r | |
759 | \r | |
760 | \r | |
761 | /**\r | |
762 | Execute Write(16) SCSI command on a specific SCSI target.\r | |
763 | \r | |
764 | Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.\r | |
765 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
766 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
767 | Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r | |
768 | the CDB for this SCSI command.\r | |
769 | If ScsiIo is NULL, then ASSERT().\r | |
770 | If SenseDataLength is NULL, then ASSERT().\r | |
771 | If HostAdapterStatus is NULL, then ASSERT().\r | |
772 | If TargetStatus is NULL, then ASSERT().\r | |
773 | If DataLength is NULL, then ASSERT().\r | |
774 | \r | |
d658727b FT |
775 | If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r |
776 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
777 | gets returned.\r | |
778 | \r | |
779 | If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r | |
780 | alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r | |
781 | gets returned.\r | |
782 | \r | |
a24faca3 | 783 | @param[in] ScsiIo SCSI IO Protocol to use\r |
784 | @param[in] Timeout The length of timeout period.\r | |
785 | @param[in, out] SenseData A pointer to output sense data.\r | |
786 | @param[in, out] SenseDataLength The length of output sense data.\r | |
787 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
788 | @param[out] TargetStatus The status of the target.\r | |
789 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
790 | @param[in, out] DataLength The length of data buffer.\r | |
791 | @param[in] StartLba The start address of LBA.\r | |
b95eb5e0 | 792 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
a24faca3 | 793 | \r |
d658727b FT |
794 | @retval EFI_SUCCESS Command is executed successfully.\r |
795 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
796 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
797 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many\r | |
798 | SCSI Command Packets already queued.\r | |
799 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
800 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
801 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
802 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
803 | @retval EFI_INVALID_PARAMETER The contents of the SCSI Request Packet are invalid.\r | |
a24faca3 | 804 | \r |
805 | **/\r | |
806 | EFI_STATUS\r | |
807 | EFIAPI\r | |
808 | ScsiWrite16Command (\r | |
809 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
810 | IN UINT64 Timeout,\r | |
811 | IN OUT VOID *SenseData, OPTIONAL\r | |
812 | IN OUT UINT8 *SenseDataLength,\r | |
813 | OUT UINT8 *HostAdapterStatus,\r | |
814 | OUT UINT8 *TargetStatus,\r | |
815 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
816 | IN OUT UINT32 *DataLength,\r | |
817 | IN UINT64 StartLba,\r | |
818 | IN UINT32 SectorSize\r | |
819 | );\r | |
fb3df220 | 820 | \r |
821 | #endif\r |