]>
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 | |
b95eb5e0 | 8 | Copyright (c) 2006 - 2014, 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 | |
d5954c61 | 35 | \r |
36 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
37 | for the specific SCSI target.\r | |
38 | @param[in] Timeout The timeout in 100 ns units to use for the execution\r | |
39 | of this SCSI Request Packet. A Timeout value of\r | |
40 | zero means that this function will wait indefinitely\r | |
41 | for the SCSI Request Packet to execute. If Timeout\r | |
42 | is greater than zero, then this function will return\r | |
43 | EFI_TIMEOUT if the time required to execute the SCSI\r | |
44 | Request Packet is greater than Timeout.\r | |
45 | @param[in, out] SenseData A pointer to sense data that was generated by\r | |
46 | the execution of the SCSI Request Packet. This\r | |
47 | buffer must be allocated by the caller.\r | |
48 | If SenseDataLength is 0, then this parameter is\r | |
49 | optional and may be NULL.\r | |
50 | @param[in, out] SenseDataLength On input, a pointer to the length in bytes of\r | |
9638ba6d | 51 | the SenseData buffer. On output, a pointer to\r |
d5954c61 | 52 | the number of bytes written to the SenseData buffer. \r |
53 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces\r | |
54 | the SCSI bus containing the SCSI target specified by\r | |
55 | ScsiIo when the SCSI Request Packet was executed.\r | |
56 | See the EFI SCSI I/O Protocol in the UEFI Specification\r | |
57 | for details on the possible return values.\r | |
58 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
9638ba6d | 59 | by ScsiIo when the SCSI Request Packet was executed\r |
d5954c61 | 60 | on the SCSI Host Controller. See the EFI SCSI I/O\r |
61 | Protocol in the UEFI Specification for details on\r | |
62 | the possible return values. \r | |
63 | \r | |
64 | @retval EFI_SUCCESS The command was executed successfully.\r | |
65 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
66 | and SenseData in that order for additional status\r | |
67 | information.\r | |
68 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
69 | there are too many SCSI Command Packets already\r | |
70 | queued. The SCSI Request Packet was not sent, so\r | |
71 | no additional status information is available.\r | |
72 | The caller may retry again later.\r | |
73 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
74 | SCSI Request Packet. See HostAdapterStatus,\r | |
75 | TargetStatus, SenseDataLength, and SenseData in that\r | |
76 | order for additional status information.\r | |
77 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
78 | is not supported by the SCSI initiator(i.e., SCSI\r | |
79 | Host Controller). The SCSI Request Packet was not\r | |
80 | sent, so no additional status information is available.\r | |
81 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
82 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
83 | SenseDataLength, and SenseData in that order for\r | |
84 | additional status information.\r | |
fc30687f | 85 | \r |
bf231ea6 | 86 | **/\r |
fb3df220 | 87 | EFI_STATUS\r |
373b5cf9 | 88 | EFIAPI\r |
d35be2a4 | 89 | ScsiTestUnitReadyCommand (\r |
d5954c61 | 90 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
91 | IN UINT64 Timeout,\r | |
92 | IN OUT VOID *SenseData, OPTIONAL\r | |
93 | IN OUT UINT8 *SenseDataLength,\r | |
94 | OUT UINT8 *HostAdapterStatus,\r | |
95 | OUT UINT8 *TargetStatus\r | |
bf231ea6 A |
96 | );\r |
97 | \r | |
98 | \r | |
fc30687f | 99 | /**\r |
d5954c61 | 100 | Execute Inquiry SCSI command on a specific SCSI target.\r |
b91d5eca | 101 | \r |
d5954c61 | 102 | Executes the Inquiry command on the SCSI target specified by ScsiIo.\r |
103 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
104 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
105 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 106 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 107 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 108 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 109 | If InquiryDataLength is NULL, then ASSERT().\r |
110 | \r | |
d5954c61 | 111 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r |
112 | for the specific SCSI target.\r | |
113 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
114 | execution of this SCSI Request Packet. A Timeout\r | |
115 | value of zero means that this function will wait\r | |
116 | indefinitely for the SCSI Request Packet to execute.\r | |
117 | If Timeout is greater than zero, then this function\r | |
118 | will return EFI_TIMEOUT if the time required to\r | |
119 | execute the SCSI Request Packet is greater than Timeout.\r | |
120 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
121 | by the execution of the SCSI Request Packet.\r | |
122 | This buffer must be allocated by the caller.\r | |
123 | If SenseDataLength is 0, then this parameter\r | |
124 | is optional and may be NULL.\r | |
125 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
126 | On output, the number of bytes written to the SenseData buffer. \r | |
127 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
128 | produces the SCSI bus containing the SCSI\r | |
129 | target specified by ScsiIo when the SCSI\r | |
130 | Request Packet was executed. See the EFI\r | |
131 | SCSI I/O Protocol in the UEFI Specification\r | |
132 | for details on the possible return values.\r | |
133 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
9638ba6d | 134 | by ScsiIo when the SCSI Request Packet was\r |
d5954c61 | 135 | executed on the SCSI Host Controller.\r |
136 | See the EFI SCSI I/O Protocol in the UEFI\r | |
137 | Specification for details on the possible\r | |
138 | return values. \r | |
139 | @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r | |
140 | by the execution of the SCSI Request Packet.\r | |
141 | This buffer must be allocated by the caller.\r | |
142 | If InquiryDataLength is 0, then this parameter\r | |
143 | is optional and may be NULL. \r | |
144 | @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r | |
145 | of the InquiryDataBuffer buffer.\r | |
146 | On output, a pointer to the number of bytes\r | |
147 | written to the InquiryDataBuffer buffer.\r | |
148 | @param[in] EnableVitalProductData If TRUE, then the supported vital product\r | |
149 | data is returned in InquiryDataBuffer.\r | |
150 | If FALSE, then the standard inquiry data is\r | |
151 | returned in InquiryDataBuffer. \r | |
152 | \r | |
153 | @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,\r | |
154 | TargetStatus, SenseDataLength, and SenseData in that order\r | |
155 | for additional status information.\r | |
156 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
157 | InquiryDataBuffer could not be transferred. The actual\r | |
158 | number of bytes transferred is returned in InquiryDataLength.\r | |
159 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r | |
160 | are too many SCSI Command Packets already queued.\r | |
161 | The SCSI Request Packet was not sent, so no additional\r | |
162 | status information is available. The caller may retry again later.\r | |
163 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r | |
164 | Request Packet. See HostAdapterStatus, TargetStatus,\r | |
165 | SenseDataLength, and SenseData in that order for additional\r | |
166 | status information.\r | |
167 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r | |
168 | supported by the SCSI initiator(i.e., SCSI Host Controller).\r | |
169 | The SCSI Request Packet was not sent, so no additional\r | |
170 | status information is available.\r | |
171 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
172 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
173 | SenseDataLength, and SenseData in that order for\r | |
174 | additional status information.\r | |
fc30687f | 175 | \r |
bf231ea6 | 176 | **/\r |
fb3df220 | 177 | EFI_STATUS\r |
373b5cf9 | 178 | EFIAPI\r |
d35be2a4 | 179 | ScsiInquiryCommand (\r |
d5954c61 | 180 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
181 | IN UINT64 Timeout,\r | |
182 | IN OUT VOID *SenseData, OPTIONAL\r | |
183 | IN OUT UINT8 *SenseDataLength,\r | |
184 | OUT UINT8 *HostAdapterStatus,\r | |
185 | OUT UINT8 *TargetStatus,\r | |
186 | IN OUT VOID *InquiryDataBuffer, OPTIONAL\r | |
187 | IN OUT UINT32 *InquiryDataLength,\r | |
188 | IN BOOLEAN EnableVitalProductData\r | |
bf231ea6 A |
189 | );\r |
190 | \r | |
191 | \r | |
b8a62661 RN |
192 | /**\r |
193 | Execute Inquiry SCSI command on a specific SCSI target.\r | |
194 | \r | |
195 | Executes the Inquiry command on the SCSI target specified by ScsiIo.\r | |
196 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
197 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
198 | If ScsiIo is NULL, then ASSERT().\r | |
199 | If SenseDataLength is NULL, then ASSERT().\r | |
200 | If HostAdapterStatus is NULL, then ASSERT().\r | |
201 | If TargetStatus is NULL, then ASSERT().\r | |
202 | If InquiryDataLength is NULL, then ASSERT().\r | |
203 | \r | |
204 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
205 | for the specific SCSI target.\r | |
206 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
207 | execution of this SCSI Request Packet. A Timeout\r | |
208 | value of zero means that this function will wait\r | |
209 | indefinitely for the SCSI Request Packet to execute.\r | |
210 | If Timeout is greater than zero, then this function\r | |
211 | will return EFI_TIMEOUT if the time required to\r | |
212 | execute the SCSI Request Packet is greater than Timeout.\r | |
213 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
214 | by the execution of the SCSI Request Packet.\r | |
215 | This buffer must be allocated by the caller.\r | |
216 | If SenseDataLength is 0, then this parameter\r | |
217 | is optional and may be NULL.\r | |
218 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
219 | On output, the number of bytes written to the SenseData buffer. \r | |
220 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
221 | produces the SCSI bus containing the SCSI\r | |
222 | target specified by ScsiIo when the SCSI\r | |
223 | Request Packet was executed. See the EFI\r | |
224 | SCSI I/O Protocol in the UEFI Specification\r | |
225 | for details on the possible return values.\r | |
226 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
227 | by ScsiIo when the SCSI Request Packet was\r | |
228 | executed on the SCSI Host Controller.\r | |
229 | See the EFI SCSI I/O Protocol in the UEFI\r | |
230 | Specification for details on the possible\r | |
231 | return values. \r | |
232 | @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r | |
233 | by the execution of the SCSI Request Packet.\r | |
234 | This buffer must be allocated by the caller.\r | |
235 | If InquiryDataLength is 0, then this parameter\r | |
236 | is optional and may be NULL. \r | |
237 | @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r | |
238 | of the InquiryDataBuffer buffer.\r | |
239 | On output, a pointer to the number of bytes\r | |
240 | written to the InquiryDataBuffer buffer.\r | |
241 | @param[in] EnableVitalProductData If TRUE, then the supported vital product\r | |
242 | data for the PageCode is returned in InquiryDataBuffer.\r | |
243 | If FALSE, then the standard inquiry data is\r | |
244 | returned in InquiryDataBuffer and PageCode is ignored.\r | |
245 | @param[in] PageCode The page code of the vital product data.\r | |
246 | It's ignored if EnableVitalProductData is FALSE.\r | |
247 | \r | |
248 | @retval EFI_SUCCESS The command executed successfully. See HostAdapterStatus,\r | |
249 | TargetStatus, SenseDataLength, and SenseData in that order\r | |
250 | for additional status information.\r | |
251 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
252 | InquiryDataBuffer could not be transferred. The actual\r | |
253 | number of bytes transferred is returned in InquiryDataLength.\r | |
254 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r | |
255 | are too many SCSI Command Packets already queued.\r | |
256 | The SCSI Request Packet was not sent, so no additional\r | |
257 | status information is available. The caller may retry again later.\r | |
258 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r | |
259 | Request Packet. See HostAdapterStatus, TargetStatus,\r | |
260 | SenseDataLength, and SenseData in that order for additional\r | |
261 | status information.\r | |
262 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r | |
263 | supported by the SCSI initiator(i.e., SCSI Host Controller).\r | |
264 | The SCSI Request Packet was not sent, so no additional\r | |
265 | status information is available.\r | |
266 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
267 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
268 | SenseDataLength, and SenseData in that order for\r | |
269 | additional status information.\r | |
270 | \r | |
271 | **/\r | |
272 | EFI_STATUS\r | |
273 | EFIAPI\r | |
274 | ScsiInquiryCommandEx (\r | |
275 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
276 | IN UINT64 Timeout,\r | |
277 | IN OUT VOID *SenseData, OPTIONAL\r | |
278 | IN OUT UINT8 *SenseDataLength,\r | |
279 | OUT UINT8 *HostAdapterStatus,\r | |
280 | OUT UINT8 *TargetStatus,\r | |
281 | IN OUT VOID *InquiryDataBuffer, OPTIONAL\r | |
282 | IN OUT UINT32 *InquiryDataLength,\r | |
283 | IN BOOLEAN EnableVitalProductData,\r | |
284 | IN UINT8 PageCode\r | |
285 | );\r | |
286 | \r | |
287 | \r | |
fc30687f | 288 | /**\r |
d5954c61 | 289 | Execute Mode Sense(10) SCSI command on a specific SCSI target.\r |
290 | \r | |
291 | Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.\r | |
292 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
293 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
294 | after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters\r | |
295 | are used to construct the CDB for this SCSI command.\r | |
296 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 297 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 298 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 299 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 300 | If DataLength is NULL, then ASSERT().\r |
301 | \r | |
d5954c61 | 302 | \r |
303 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
304 | for the specific SCSI target.\r | |
305 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
306 | execution of this SCSI Request Packet. A Timeout\r | |
307 | value of zero means that this function will wait\r | |
308 | indefinitely for the SCSI Request Packet to execute.\r | |
309 | If Timeout is greater than zero, then this function\r | |
310 | will return EFI_TIMEOUT if the time required to\r | |
311 | execute the SCSI Request Packet is greater than Timeout.\r | |
adde977a | 312 | @param[in, out] SenseData A pointer to sense data that was generated\r |
d5954c61 | 313 | by the execution of the SCSI Request Packet.\r |
314 | This buffer must be allocated by the caller.\r | |
315 | If SenseDataLength is 0, then this parameter\r | |
316 | is optional and may be NULL.\r | |
adde977a | 317 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r |
d5954c61 | 318 | On output, the number of bytes written to the SenseData buffer. \r |
319 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
320 | produces the SCSI bus containing the SCSI target\r | |
321 | specified by ScsiIo when the SCSI Request Packet\r | |
322 | was executed. See the EFI SCSI I/O Protocol in the\r | |
323 | UEFI Specification for details on the possible\r | |
324 | return values.\r | |
325 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
9638ba6d | 326 | by ScsiIo when the SCSI Request Packet was executed\r |
d5954c61 | 327 | on the SCSI Host Controller. See the EFI SCSI\r |
328 | I/O Protocol in the UEFI Specification for details\r | |
329 | on the possible return values.\r | |
adde977a | 330 | @param[in, out] DataBuffer A pointer to data that was generated by the\r |
d5954c61 | 331 | execution of the SCSI Request Packet. This\r |
332 | buffer must be allocated by the caller. If\r | |
333 | DataLength is 0, then this parameter is optional\r | |
334 | and may be NULL. \r | |
adde977a | 335 | @param[in, out] DataLength On input, a pointer to the length in bytes of\r |
d5954c61 | 336 | the DataBuffer buffer. On output, a pointer\r |
337 | to the number of bytes written to the DataBuffer\r | |
338 | buffer. \r | |
339 | @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r | |
340 | @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. \r | |
341 | @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. \r | |
342 | \r | |
343 | @retval EFI_SUCCESS The command was executed successfully.\r | |
344 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
345 | and SenseData in that order for additional status information.\r | |
346 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the\r | |
347 | entire DataBuffer could not be transferred.\r | |
bf231ea6 | 348 | The actual number of bytes transferred is returned\r |
d5954c61 | 349 | in DataLength.\r |
350 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
351 | there are too many SCSI Command Packets already queued.\r | |
352 | The SCSI Request Packet was not sent, so no additional\r | |
353 | status information is available. The caller may retry\r | |
354 | again later.\r | |
355 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
356 | SCSI Request Packet. See HostAdapterStatus, TargetStatus,\r | |
357 | SenseDataLength, and SenseData in that order for\r | |
358 | additional status information.\r | |
bf231ea6 | 359 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r |
d5954c61 | 360 | is not supported by the SCSI initiator(i.e., SCSI\r |
361 | Host Controller). The SCSI Request Packet was not\r | |
362 | sent, so no additional status information is available.\r | |
363 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r | |
364 | Request Packet to execute. See HostAdapterStatus,\r | |
365 | TargetStatus, SenseDataLength, and SenseData in that\r | |
366 | order for additional status information.\r | |
fc30687f | 367 | \r |
bf231ea6 | 368 | **/\r |
fb3df220 | 369 | EFI_STATUS\r |
373b5cf9 | 370 | EFIAPI\r |
d35be2a4 | 371 | ScsiModeSense10Command (\r |
d5954c61 | 372 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
373 | IN UINT64 Timeout,\r | |
374 | IN OUT VOID *SenseData, OPTIONAL\r | |
375 | IN OUT UINT8 *SenseDataLength,\r | |
376 | OUT UINT8 *HostAdapterStatus,\r | |
377 | OUT UINT8 *TargetStatus,\r | |
378 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
379 | IN OUT UINT32 *DataLength,\r | |
380 | IN UINT8 DBDField, OPTIONAL\r | |
381 | IN UINT8 PageControl,\r | |
382 | IN UINT8 PageCode\r | |
bf231ea6 A |
383 | );\r |
384 | \r | |
385 | \r | |
386 | \r | |
fc30687f | 387 | /**\r |
d5954c61 | 388 | Execute Request Sense SCSI command on a specific SCSI target.\r |
b91d5eca | 389 | \r |
d5954c61 | 390 | Executes the Request Sense command on the SCSI target specified by ScsiIo.\r |
391 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
392 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
393 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 394 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 395 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 396 | If TargetStatus is NULL, then ASSERT().\r |
397 | \r | |
398 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
399 | @param[in] Timeout The length of timeout period.\r | |
d5954c61 | 400 | @param[in, out] SenseData A pointer to output sense data.\r |
401 | @param[in, out] SenseDataLength The length of output sense data.\r | |
b91d5eca | 402 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
403 | @param[out] TargetStatus The status of the target.\r | |
404 | \r | |
405 | @retval EFI_SUCCESS Command is executed successfully.\r | |
406 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are\r | |
407 | too many SCSI Command Packets already queued.\r | |
408 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
409 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
410 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
411 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 412 | \r |
bf231ea6 | 413 | **/\r |
fb3df220 | 414 | EFI_STATUS\r |
373b5cf9 | 415 | EFIAPI\r |
d35be2a4 | 416 | ScsiRequestSenseCommand (\r |
d5954c61 | 417 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
418 | IN UINT64 Timeout,\r | |
419 | IN OUT VOID *SenseData, OPTIONAL\r | |
420 | IN OUT UINT8 *SenseDataLength,\r | |
421 | OUT UINT8 *HostAdapterStatus,\r | |
422 | OUT UINT8 *TargetStatus\r | |
bf231ea6 A |
423 | );\r |
424 | \r | |
425 | \r | |
fc30687f | 426 | /**\r |
d5954c61 | 427 | Execute Read Capacity SCSI command on a specific SCSI target.\r |
b91d5eca | 428 | \r |
d5954c61 | 429 | Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r |
430 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
431 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
51969ecb | 432 | Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r |
d5954c61 | 433 | If ScsiIo is NULL, then ASSERT().\r |
b91d5eca | 434 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 435 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 436 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 437 | If DataLength is NULL, then ASSERT().\r |
438 | \r | |
d5954c61 | 439 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r |
440 | @param[in] Timeout The length of timeout period.\r | |
441 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 442 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 443 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
444 | @param[out] TargetStatus The status of the target.\r | |
445 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 446 | @param[in, out] DataLength The length of data buffer.\r |
51969ecb | 447 | @param[in] Pmi Partial medium indicator.\r |
b91d5eca | 448 | \r |
940a892b | 449 | @retval EFI_SUCCESS Command is executed successfully.\r |
450 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
451 | DataBuffer could not be transferred. The actual\r | |
452 | number of bytes transferred is returned in DataLength.\r | |
453 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
454 | there are too many SCSI Command Packets already queued.\r | |
455 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
456 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
457 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
458 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 459 | \r |
bf231ea6 | 460 | **/\r |
fb3df220 | 461 | EFI_STATUS\r |
9199040c | 462 | EFIAPI\r |
d35be2a4 | 463 | ScsiReadCapacityCommand (\r |
d5954c61 | 464 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
465 | IN UINT64 Timeout,\r | |
466 | IN OUT VOID *SenseData, OPTIONAL\r | |
467 | IN OUT UINT8 *SenseDataLength,\r | |
468 | OUT UINT8 *HostAdapterStatus,\r | |
469 | OUT UINT8 *TargetStatus,\r | |
470 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
471 | IN OUT UINT32 *DataLength,\r | |
51969ecb | 472 | IN BOOLEAN Pmi\r |
bf231ea6 A |
473 | );\r |
474 | \r | |
475 | \r | |
ccb491c8 | 476 | /**\r |
5e11e7c6 | 477 | Execute Read Capacity SCSI 16 command on a specific SCSI target.\r |
478 | \r | |
479 | Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.\r | |
480 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
481 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
482 | Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r | |
483 | If ScsiIo is NULL, then ASSERT().\r | |
484 | If SenseDataLength is NULL, then ASSERT().\r | |
485 | If HostAdapterStatus is NULL, then ASSERT().\r | |
486 | If TargetStatus is NULL, then ASSERT().\r | |
487 | If DataLength is NULL, then ASSERT().\r | |
488 | \r | |
489 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
490 | @param[in] Timeout The length of timeout period.\r | |
491 | @param[in, out] SenseData A pointer to output sense data.\r | |
492 | @param[in, out] SenseDataLength The length of output sense data.\r | |
493 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
494 | @param[out] TargetStatus The status of the target.\r | |
495 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
496 | @param[in, out] DataLength The length of data buffer.\r | |
497 | @param[in] Pmi Partial medium indicator.\r | |
498 | \r | |
499 | @retval EFI_SUCCESS Command is executed successfully.\r | |
500 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
501 | DataBuffer could not be transferred. The actual\r | |
502 | number of bytes transferred is returned in DataLength.\r | |
503 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
504 | there are too many SCSI Command Packets already queued.\r | |
505 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
506 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
507 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
508 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
ccb491c8 | 509 | \r |
510 | **/\r | |
ccb491c8 | 511 | EFI_STATUS\r |
512 | EFIAPI\r | |
513 | ScsiReadCapacity16Command (\r | |
f158ee67 | 514 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
515 | IN UINT64 Timeout,\r | |
516 | IN OUT VOID *SenseData, OPTIONAL\r | |
517 | IN OUT UINT8 *SenseDataLength,\r | |
518 | OUT UINT8 *HostAdapterStatus,\r | |
519 | OUT UINT8 *TargetStatus,\r | |
520 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
521 | IN OUT UINT32 *DataLength,\r | |
522 | IN BOOLEAN Pmi\r | |
ccb491c8 | 523 | );\r |
524 | \r | |
525 | \r | |
fc30687f | 526 | /**\r |
d5954c61 | 527 | Execute Read(10) SCSI command on a specific SCSI target.\r |
528 | \r | |
529 | Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r | |
530 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
531 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
532 | after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r | |
533 | construct the CDB for this SCSI command.\r | |
534 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 535 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 536 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 537 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 538 | If DataLength is NULL, then ASSERT().\r |
539 | \r | |
d5954c61 | 540 | \r |
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 | |
6053411e | 544 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 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 Read 10 command data.\r | |
6053411e | 548 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 549 | @param[in] StartLba The start address of LBA.\r |
b95eb5e0 | 550 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
b91d5eca | 551 | \r |
940a892b | 552 | @retval EFI_SUCCESS Command is executed successfully.\r |
553 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
554 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
555 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
556 | 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 is not supported by \r | |
559 | 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 | |
fc30687f | 561 | \r |
bf231ea6 | 562 | **/\r |
fb3df220 | 563 | EFI_STATUS\r |
373b5cf9 | 564 | EFIAPI\r |
d35be2a4 | 565 | ScsiRead10Command (\r |
d5954c61 | 566 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
567 | IN UINT64 Timeout,\r | |
568 | IN OUT VOID *SenseData, OPTIONAL\r | |
569 | IN OUT UINT8 *SenseDataLength,\r | |
570 | OUT UINT8 *HostAdapterStatus,\r | |
571 | OUT UINT8 *TargetStatus,\r | |
572 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
573 | IN OUT UINT32 *DataLength,\r | |
574 | IN UINT32 StartLba,\r | |
575 | IN UINT32 SectorSize\r | |
bf231ea6 A |
576 | );\r |
577 | \r | |
578 | \r | |
fc30687f | 579 | /**\r |
d5954c61 | 580 | Execute Write(10) SCSI command on a specific SCSI target.\r |
581 | \r | |
582 | Executes the SCSI Write(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 after\r | |
585 | Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r | |
586 | 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 | |
d5954c61 | 593 | @param[in] ScsiIo SCSI IO Protocol to use\r |
594 | @param[in] Timeout The length of timeout period.\r | |
595 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 596 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 597 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
598 | @param[out] TargetStatus The status of the target.\r | |
599 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 600 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 601 | @param[in] StartLba The start address of LBA.\r |
b95eb5e0 | 602 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
b91d5eca | 603 | \r |
940a892b | 604 | @retval EFI_SUCCESS Command is executed successfully.\r |
605 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
606 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
607 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
608 | SCSI Command Packets already queued.\r | |
609 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
610 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
611 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
612 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 613 | \r |
bf231ea6 | 614 | **/\r |
fb3df220 | 615 | EFI_STATUS\r |
373b5cf9 | 616 | EFIAPI\r |
d35be2a4 | 617 | ScsiWrite10Command (\r |
d5954c61 | 618 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
619 | IN UINT64 Timeout,\r | |
620 | IN OUT VOID *SenseData, OPTIONAL\r | |
621 | IN OUT UINT8 *SenseDataLength,\r | |
622 | OUT UINT8 *HostAdapterStatus,\r | |
623 | OUT UINT8 *TargetStatus,\r | |
624 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
625 | IN OUT UINT32 *DataLength,\r | |
626 | IN UINT32 StartLba,\r | |
627 | IN UINT32 SectorSize\r | |
bf231ea6 | 628 | );\r |
fb3df220 | 629 | \r |
a24faca3 | 630 | /**\r |
631 | Execute Read(16) SCSI command on a specific SCSI target.\r | |
632 | \r | |
633 | Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.\r | |
634 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
635 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
636 | after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r | |
637 | construct the CDB for this SCSI command.\r | |
638 | If ScsiIo is NULL, then ASSERT().\r | |
639 | If SenseDataLength is NULL, then ASSERT().\r | |
640 | If HostAdapterStatus is NULL, then ASSERT().\r | |
641 | If TargetStatus is NULL, then ASSERT().\r | |
642 | If DataLength is NULL, then ASSERT().\r | |
643 | \r | |
644 | \r | |
645 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
646 | @param[in] Timeout The length of timeout period.\r | |
647 | @param[in, out] SenseData A pointer to output sense data.\r | |
648 | @param[in, out] SenseDataLength The length of output sense data.\r | |
649 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
650 | @param[out] TargetStatus The status of the target.\r | |
651 | @param[in, out] DataBuffer Read 16 command data.\r | |
652 | @param[in, out] DataLength The length of data buffer.\r | |
653 | @param[in] StartLba The start address of LBA.\r | |
b95eb5e0 | 654 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
a24faca3 | 655 | \r |
656 | @retval EFI_SUCCESS Command is executed successfully.\r | |
657 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
658 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
659 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
660 | SCSI Command Packets already queued.\r | |
661 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
662 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
663 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
664 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
665 | \r | |
666 | **/\r | |
667 | EFI_STATUS\r | |
668 | EFIAPI\r | |
669 | ScsiRead16Command (\r | |
670 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
671 | IN UINT64 Timeout,\r | |
672 | IN OUT VOID *SenseData, OPTIONAL\r | |
673 | IN OUT UINT8 *SenseDataLength,\r | |
674 | OUT UINT8 *HostAdapterStatus,\r | |
675 | OUT UINT8 *TargetStatus,\r | |
676 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
677 | IN OUT UINT32 *DataLength,\r | |
678 | IN UINT64 StartLba,\r | |
679 | IN UINT32 SectorSize\r | |
680 | );\r | |
681 | \r | |
682 | \r | |
683 | /**\r | |
684 | Execute Write(16) SCSI command on a specific SCSI target.\r | |
685 | \r | |
686 | Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.\r | |
687 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
688 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
689 | Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r | |
690 | the CDB for this SCSI command.\r | |
691 | If ScsiIo is NULL, then ASSERT().\r | |
692 | If SenseDataLength is NULL, then ASSERT().\r | |
693 | If HostAdapterStatus is NULL, then ASSERT().\r | |
694 | If TargetStatus is NULL, then ASSERT().\r | |
695 | If DataLength is NULL, then ASSERT().\r | |
696 | \r | |
697 | @param[in] ScsiIo SCSI IO Protocol to use\r | |
698 | @param[in] Timeout The length of timeout period.\r | |
699 | @param[in, out] SenseData A pointer to output sense data.\r | |
700 | @param[in, out] SenseDataLength The length of output sense data.\r | |
701 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
702 | @param[out] TargetStatus The status of the target.\r | |
703 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
704 | @param[in, out] DataLength The length of data buffer.\r | |
705 | @param[in] StartLba The start address of LBA.\r | |
b95eb5e0 | 706 | @param[in] SectorSize The number of contiguous logical blocks of data that shall be transferred.\r |
a24faca3 | 707 | \r |
708 | @retval EFI_SUCCESS Command is executed successfully.\r | |
709 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
710 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
711 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
712 | SCSI Command Packets already queued.\r | |
713 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
714 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
715 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
716 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
717 | \r | |
718 | **/\r | |
719 | EFI_STATUS\r | |
720 | EFIAPI\r | |
721 | ScsiWrite16Command (\r | |
722 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
723 | IN UINT64 Timeout,\r | |
724 | IN OUT VOID *SenseData, OPTIONAL\r | |
725 | IN OUT UINT8 *SenseDataLength,\r | |
726 | OUT UINT8 *HostAdapterStatus,\r | |
727 | OUT UINT8 *TargetStatus,\r | |
728 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
729 | IN OUT UINT32 *DataLength,\r | |
730 | IN UINT64 StartLba,\r | |
731 | IN UINT32 SectorSize\r | |
732 | );\r | |
fb3df220 | 733 | \r |
734 | #endif\r |