]>
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 | |
d5954c61 | 8 | Copyright (c) 2006 - 2008, Intel Corporation<BR>\r |
50a64e5b | 9 | All rights reserved. This program and the accompanying materials \r |
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 | |
fc30687f | 192 | /**\r |
d5954c61 | 193 | Execute Mode Sense(10) SCSI command on a specific SCSI target.\r |
194 | \r | |
195 | Executes the SCSI Mode Sense(10) 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\r | |
198 | after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters\r | |
199 | are used to construct the CDB for this SCSI command.\r | |
200 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 201 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 202 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 203 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 204 | If DataLength is NULL, then ASSERT().\r |
205 | \r | |
d5954c61 | 206 | \r |
207 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
208 | for the specific SCSI target.\r | |
209 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
210 | execution of this SCSI Request Packet. A Timeout\r | |
211 | value of zero means that this function will wait\r | |
212 | indefinitely for the SCSI Request Packet to execute.\r | |
213 | If Timeout is greater than zero, then this function\r | |
214 | will return EFI_TIMEOUT if the time required to\r | |
215 | execute the SCSI Request Packet is greater than Timeout.\r | |
adde977a | 216 | @param[in, out] SenseData A pointer to sense data that was generated\r |
d5954c61 | 217 | by the execution of the SCSI Request Packet.\r |
218 | This buffer must be allocated by the caller.\r | |
219 | If SenseDataLength is 0, then this parameter\r | |
220 | is optional and may be NULL.\r | |
adde977a | 221 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r |
d5954c61 | 222 | On output, the number of bytes written to the SenseData buffer. \r |
223 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
224 | produces the SCSI bus containing the SCSI target\r | |
225 | specified by ScsiIo when the SCSI Request Packet\r | |
226 | was executed. See the EFI SCSI I/O Protocol in the\r | |
227 | UEFI Specification for details on the possible\r | |
228 | return values.\r | |
229 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
9638ba6d | 230 | by ScsiIo when the SCSI Request Packet was executed\r |
d5954c61 | 231 | on the SCSI Host Controller. See the EFI SCSI\r |
232 | I/O Protocol in the UEFI Specification for details\r | |
233 | on the possible return values.\r | |
adde977a | 234 | @param[in, out] DataBuffer A pointer to data that was generated by the\r |
d5954c61 | 235 | execution of the SCSI Request Packet. This\r |
236 | buffer must be allocated by the caller. If\r | |
237 | DataLength is 0, then this parameter is optional\r | |
238 | and may be NULL. \r | |
adde977a | 239 | @param[in, out] DataLength On input, a pointer to the length in bytes of\r |
d5954c61 | 240 | the DataBuffer buffer. On output, a pointer\r |
241 | to the number of bytes written to the DataBuffer\r | |
242 | buffer. \r | |
243 | @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r | |
244 | @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. \r | |
245 | @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. \r | |
246 | \r | |
247 | @retval EFI_SUCCESS The command was executed successfully.\r | |
248 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
249 | and SenseData in that order for additional status information.\r | |
250 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the\r | |
251 | entire DataBuffer could not be transferred.\r | |
bf231ea6 | 252 | The actual number of bytes transferred is returned\r |
d5954c61 | 253 | in DataLength.\r |
254 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
255 | there 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\r | |
258 | again later.\r | |
259 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
260 | SCSI Request Packet. See HostAdapterStatus, TargetStatus,\r | |
261 | SenseDataLength, and SenseData in that order for\r | |
262 | additional status information.\r | |
bf231ea6 | 263 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r |
d5954c61 | 264 | is not supported by the SCSI initiator(i.e., SCSI\r |
265 | Host Controller). The SCSI Request Packet was not\r | |
266 | sent, so no additional status information is available.\r | |
267 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r | |
268 | Request Packet to execute. See HostAdapterStatus,\r | |
269 | TargetStatus, SenseDataLength, and SenseData in that\r | |
270 | order for additional status information.\r | |
fc30687f | 271 | \r |
bf231ea6 | 272 | **/\r |
fb3df220 | 273 | EFI_STATUS\r |
373b5cf9 | 274 | EFIAPI\r |
d35be2a4 | 275 | ScsiModeSense10Command (\r |
d5954c61 | 276 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
277 | IN UINT64 Timeout,\r | |
278 | IN OUT VOID *SenseData, OPTIONAL\r | |
279 | IN OUT UINT8 *SenseDataLength,\r | |
280 | OUT UINT8 *HostAdapterStatus,\r | |
281 | OUT UINT8 *TargetStatus,\r | |
282 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
283 | IN OUT UINT32 *DataLength,\r | |
284 | IN UINT8 DBDField, OPTIONAL\r | |
285 | IN UINT8 PageControl,\r | |
286 | IN UINT8 PageCode\r | |
bf231ea6 A |
287 | );\r |
288 | \r | |
289 | \r | |
290 | \r | |
fc30687f | 291 | /**\r |
d5954c61 | 292 | Execute Request Sense SCSI command on a specific SCSI target.\r |
b91d5eca | 293 | \r |
d5954c61 | 294 | Executes the Request Sense command on the SCSI target specified by ScsiIo.\r |
295 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
296 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
297 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 298 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 299 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 300 | If TargetStatus is NULL, then ASSERT().\r |
301 | \r | |
302 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
303 | @param[in] Timeout The length of timeout period.\r | |
d5954c61 | 304 | @param[in, out] SenseData A pointer to output sense data.\r |
305 | @param[in, out] SenseDataLength The length of output sense data.\r | |
b91d5eca | 306 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
307 | @param[out] TargetStatus The status of the target.\r | |
308 | \r | |
309 | @retval EFI_SUCCESS Command is executed successfully.\r | |
310 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are\r | |
311 | too many SCSI Command Packets already queued.\r | |
312 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
313 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
314 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
315 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 316 | \r |
bf231ea6 | 317 | **/\r |
fb3df220 | 318 | EFI_STATUS\r |
373b5cf9 | 319 | EFIAPI\r |
d35be2a4 | 320 | ScsiRequestSenseCommand (\r |
d5954c61 | 321 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
322 | IN UINT64 Timeout,\r | |
323 | IN OUT VOID *SenseData, OPTIONAL\r | |
324 | IN OUT UINT8 *SenseDataLength,\r | |
325 | OUT UINT8 *HostAdapterStatus,\r | |
326 | OUT UINT8 *TargetStatus\r | |
bf231ea6 A |
327 | );\r |
328 | \r | |
329 | \r | |
fc30687f | 330 | /**\r |
d5954c61 | 331 | Execute Read Capacity SCSI command on a specific SCSI target.\r |
b91d5eca | 332 | \r |
d5954c61 | 333 | Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r |
334 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
335 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
51969ecb | 336 | Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r |
d5954c61 | 337 | If ScsiIo is NULL, then ASSERT().\r |
b91d5eca | 338 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 339 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 340 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 341 | If DataLength is NULL, then ASSERT().\r |
342 | \r | |
d5954c61 | 343 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r |
344 | @param[in] Timeout The length of timeout period.\r | |
345 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 346 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 347 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
348 | @param[out] TargetStatus The status of the target.\r | |
349 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 350 | @param[in, out] DataLength The length of data buffer.\r |
51969ecb | 351 | @param[in] Pmi Partial medium indicator.\r |
b91d5eca | 352 | \r |
940a892b | 353 | @retval EFI_SUCCESS Command is executed successfully.\r |
354 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
355 | DataBuffer could not be transferred. The actual\r | |
356 | number of bytes transferred is returned in DataLength.\r | |
357 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
358 | there are too many SCSI Command Packets already queued.\r | |
359 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
360 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
361 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
362 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 363 | \r |
bf231ea6 | 364 | **/\r |
fb3df220 | 365 | EFI_STATUS\r |
9199040c | 366 | EFIAPI\r |
d35be2a4 | 367 | ScsiReadCapacityCommand (\r |
d5954c61 | 368 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
369 | IN UINT64 Timeout,\r | |
370 | IN OUT VOID *SenseData, OPTIONAL\r | |
371 | IN OUT UINT8 *SenseDataLength,\r | |
372 | OUT UINT8 *HostAdapterStatus,\r | |
373 | OUT UINT8 *TargetStatus,\r | |
374 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
375 | IN OUT UINT32 *DataLength,\r | |
51969ecb | 376 | IN BOOLEAN Pmi\r |
bf231ea6 A |
377 | );\r |
378 | \r | |
379 | \r | |
ccb491c8 | 380 | /**\r |
5e11e7c6 | 381 | Execute Read Capacity SCSI 16 command on a specific SCSI target.\r |
382 | \r | |
383 | Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.\r | |
384 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
385 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
386 | Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command.\r | |
387 | If ScsiIo is NULL, then ASSERT().\r | |
388 | If SenseDataLength is NULL, then ASSERT().\r | |
389 | If HostAdapterStatus is NULL, then ASSERT().\r | |
390 | If TargetStatus is NULL, then ASSERT().\r | |
391 | If DataLength is NULL, then ASSERT().\r | |
392 | \r | |
393 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
394 | @param[in] Timeout The length of timeout period.\r | |
395 | @param[in, out] SenseData A pointer to output sense data.\r | |
396 | @param[in, out] SenseDataLength The length of output sense data.\r | |
397 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
398 | @param[out] TargetStatus The status of the target.\r | |
399 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
400 | @param[in, out] DataLength The length of data buffer.\r | |
401 | @param[in] Pmi Partial medium indicator.\r | |
402 | \r | |
403 | @retval EFI_SUCCESS Command is executed successfully.\r | |
404 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
405 | DataBuffer could not be transferred. The actual\r | |
406 | number of bytes transferred is returned in DataLength.\r | |
407 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
408 | there are too many SCSI Command Packets already queued.\r | |
409 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
410 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
411 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
412 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
ccb491c8 | 413 | \r |
414 | **/\r | |
ccb491c8 | 415 | EFI_STATUS\r |
416 | EFIAPI\r | |
417 | ScsiReadCapacity16Command (\r | |
f158ee67 | 418 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
419 | IN UINT64 Timeout,\r | |
420 | IN OUT VOID *SenseData, OPTIONAL\r | |
421 | IN OUT UINT8 *SenseDataLength,\r | |
422 | OUT UINT8 *HostAdapterStatus,\r | |
423 | OUT UINT8 *TargetStatus,\r | |
424 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
425 | IN OUT UINT32 *DataLength,\r | |
426 | IN BOOLEAN Pmi\r | |
ccb491c8 | 427 | );\r |
428 | \r | |
429 | \r | |
fc30687f | 430 | /**\r |
d5954c61 | 431 | Execute Read(10) SCSI command on a specific SCSI target.\r |
432 | \r | |
433 | Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r | |
434 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
435 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
436 | after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r | |
437 | construct the CDB for this SCSI command.\r | |
438 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 439 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 440 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 441 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 442 | If DataLength is NULL, then ASSERT().\r |
443 | \r | |
d5954c61 | 444 | \r |
445 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
446 | @param[in] Timeout The length of timeout period.\r | |
447 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 448 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 449 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
450 | @param[out] TargetStatus The status of the target.\r | |
451 | @param[in, out] DataBuffer Read 10 command data.\r | |
6053411e | 452 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 453 | @param[in] StartLba The start address of LBA.\r |
454 | @param[in] SectorSize The sector size.\r | |
b91d5eca | 455 | \r |
940a892b | 456 | @retval EFI_SUCCESS Command is executed successfully.\r |
457 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
458 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
459 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
460 | SCSI Command Packets already queued.\r | |
461 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
462 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
463 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
464 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 465 | \r |
bf231ea6 | 466 | **/\r |
fb3df220 | 467 | EFI_STATUS\r |
373b5cf9 | 468 | EFIAPI\r |
d35be2a4 | 469 | ScsiRead10Command (\r |
d5954c61 | 470 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
471 | IN UINT64 Timeout,\r | |
472 | IN OUT VOID *SenseData, OPTIONAL\r | |
473 | IN OUT UINT8 *SenseDataLength,\r | |
474 | OUT UINT8 *HostAdapterStatus,\r | |
475 | OUT UINT8 *TargetStatus,\r | |
476 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
477 | IN OUT UINT32 *DataLength,\r | |
478 | IN UINT32 StartLba,\r | |
479 | IN UINT32 SectorSize\r | |
bf231ea6 A |
480 | );\r |
481 | \r | |
482 | \r | |
fc30687f | 483 | /**\r |
d5954c61 | 484 | Execute Write(10) SCSI command on a specific SCSI target.\r |
485 | \r | |
486 | Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r | |
487 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
488 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
489 | Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r | |
490 | the CDB for this SCSI command.\r | |
491 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 492 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 493 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 494 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 495 | If DataLength is NULL, then ASSERT().\r |
496 | \r | |
d5954c61 | 497 | @param[in] ScsiIo SCSI IO Protocol to use\r |
498 | @param[in] Timeout The length of timeout period.\r | |
499 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 500 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 501 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
502 | @param[out] TargetStatus The status of the target.\r | |
503 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 504 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 505 | @param[in] StartLba The start address of LBA.\r |
506 | @param[in] SectorSize The sector size.\r | |
b91d5eca | 507 | \r |
940a892b | 508 | @retval EFI_SUCCESS Command is executed successfully.\r |
509 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
510 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
511 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
512 | SCSI Command Packets already queued.\r | |
513 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
514 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
515 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
516 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 517 | \r |
bf231ea6 | 518 | **/\r |
fb3df220 | 519 | EFI_STATUS\r |
373b5cf9 | 520 | EFIAPI\r |
d35be2a4 | 521 | ScsiWrite10Command (\r |
d5954c61 | 522 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
523 | IN UINT64 Timeout,\r | |
524 | IN OUT VOID *SenseData, OPTIONAL\r | |
525 | IN OUT UINT8 *SenseDataLength,\r | |
526 | OUT UINT8 *HostAdapterStatus,\r | |
527 | OUT UINT8 *TargetStatus,\r | |
528 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
529 | IN OUT UINT32 *DataLength,\r | |
530 | IN UINT32 StartLba,\r | |
531 | IN UINT32 SectorSize\r | |
bf231ea6 | 532 | );\r |
fb3df220 | 533 | \r |
fb3df220 | 534 | \r |
535 | #endif\r |