]>
Commit | Line | Data |
---|---|---|
842f5579 | 1 | /** @file\r |
50a64e5b | 2 | Provides the functions to submit Scsi commands defined in SCSI-2 specification for scsi device.\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 | |
51 | the SenseData buffer. On output, a poiinter to\r | |
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 | |
59 | by ScsiIo when the SCSI Request Packat was executed\r | |
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 | |
85 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, \r | |
86 | but the entire DataBuffer could not be transferred.\r | |
87 | The actual number of bytes transferred is returned\r | |
88 | in InTransferLength.\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 | |
d5954c61 | 115 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r |
116 | for the specific SCSI target.\r | |
117 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
118 | execution of this SCSI Request Packet. A Timeout\r | |
119 | value of zero means that this function will wait\r | |
120 | indefinitely for the SCSI Request Packet to execute.\r | |
121 | If Timeout is greater than zero, then this function\r | |
122 | will return EFI_TIMEOUT if the time required to\r | |
123 | execute the SCSI Request Packet is greater than Timeout.\r | |
124 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
125 | by the execution of the SCSI Request Packet.\r | |
126 | This buffer must be allocated by the caller.\r | |
127 | If SenseDataLength is 0, then this parameter\r | |
128 | is optional and may be NULL.\r | |
129 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
130 | On output, the number of bytes written to the SenseData buffer. \r | |
131 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
132 | produces the SCSI bus containing the SCSI\r | |
133 | target specified by ScsiIo when the SCSI\r | |
134 | Request Packet was executed. See the EFI\r | |
135 | SCSI I/O Protocol in the UEFI Specification\r | |
136 | for details on the possible return values.\r | |
137 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
138 | by ScsiIo when the SCSI Request Packat was\r | |
139 | executed on the SCSI Host Controller.\r | |
140 | See the EFI SCSI I/O Protocol in the UEFI\r | |
141 | Specification for details on the possible\r | |
142 | return values. \r | |
143 | @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r | |
144 | by the execution of the SCSI Request Packet.\r | |
145 | This buffer must be allocated by the caller.\r | |
146 | If InquiryDataLength is 0, then this parameter\r | |
147 | is optional and may be NULL. \r | |
148 | @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r | |
149 | of the InquiryDataBuffer buffer.\r | |
150 | On output, a pointer to the number of bytes\r | |
151 | written to the InquiryDataBuffer buffer.\r | |
152 | @param[in] EnableVitalProductData If TRUE, then the supported vital product\r | |
153 | data is returned in InquiryDataBuffer.\r | |
154 | If FALSE, then the standard inquiry data is\r | |
155 | returned in InquiryDataBuffer. \r | |
156 | \r | |
157 | @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,\r | |
158 | TargetStatus, SenseDataLength, and SenseData in that order\r | |
159 | for additional status information.\r | |
160 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
161 | InquiryDataBuffer could not be transferred. The actual\r | |
162 | number of bytes transferred is returned in InquiryDataLength.\r | |
163 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r | |
164 | are too many SCSI Command Packets already queued.\r | |
165 | The SCSI Request Packet was not sent, so no additional\r | |
166 | status information is available. The caller may retry again later.\r | |
167 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r | |
168 | Request Packet. See HostAdapterStatus, TargetStatus,\r | |
169 | SenseDataLength, and SenseData in that order for additional\r | |
170 | status information.\r | |
171 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r | |
172 | supported by the SCSI initiator(i.e., SCSI Host Controller).\r | |
173 | The SCSI Request Packet was not sent, so no additional\r | |
174 | status information is available.\r | |
175 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
176 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
177 | SenseDataLength, and SenseData in that order for\r | |
178 | additional status information.\r | |
fc30687f | 179 | \r |
bf231ea6 | 180 | **/\r |
fb3df220 | 181 | EFI_STATUS\r |
373b5cf9 | 182 | EFIAPI\r |
d35be2a4 | 183 | ScsiInquiryCommand (\r |
d5954c61 | 184 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
185 | IN UINT64 Timeout,\r | |
186 | IN OUT VOID *SenseData, OPTIONAL\r | |
187 | IN OUT UINT8 *SenseDataLength,\r | |
188 | OUT UINT8 *HostAdapterStatus,\r | |
189 | OUT UINT8 *TargetStatus,\r | |
190 | IN OUT VOID *InquiryDataBuffer, OPTIONAL\r | |
191 | IN OUT UINT32 *InquiryDataLength,\r | |
192 | IN BOOLEAN EnableVitalProductData\r | |
bf231ea6 A |
193 | );\r |
194 | \r | |
195 | \r | |
fc30687f | 196 | /**\r |
d5954c61 | 197 | Execute Mode Sense(10) SCSI command on a specific SCSI target.\r |
198 | \r | |
199 | Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.\r | |
200 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
201 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
202 | after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters\r | |
203 | are used to construct the CDB for this SCSI command.\r | |
204 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 205 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 206 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 207 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 208 | If DataLength is NULL, then ASSERT().\r |
209 | \r | |
d5954c61 | 210 | \r |
211 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
212 | for the specific SCSI target.\r | |
213 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
214 | execution of this SCSI Request Packet. A Timeout\r | |
215 | value of zero means that this function will wait\r | |
216 | indefinitely for the SCSI Request Packet to execute.\r | |
217 | If Timeout is greater than zero, then this function\r | |
218 | will return EFI_TIMEOUT if the time required to\r | |
219 | execute the SCSI Request Packet is greater than Timeout.\r | |
adde977a | 220 | @param[in, out] SenseData A pointer to sense data that was generated\r |
d5954c61 | 221 | by the execution of the SCSI Request Packet.\r |
222 | This buffer must be allocated by the caller.\r | |
223 | If SenseDataLength is 0, then this parameter\r | |
224 | is optional and may be NULL.\r | |
adde977a | 225 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r |
d5954c61 | 226 | On output, the number of bytes written to the SenseData buffer. \r |
227 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
228 | produces the SCSI bus containing the SCSI target\r | |
229 | specified by ScsiIo when the SCSI Request Packet\r | |
230 | was executed. See the EFI SCSI I/O Protocol in the\r | |
231 | UEFI Specification for details on the possible\r | |
232 | return values.\r | |
233 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
234 | by ScsiIo when the SCSI Request Packat was executed\r | |
235 | on the SCSI Host Controller. See the EFI SCSI\r | |
236 | I/O Protocol in the UEFI Specification for details\r | |
237 | on the possible return values.\r | |
adde977a | 238 | @param[in, out] DataBuffer A pointer to data that was generated by the\r |
d5954c61 | 239 | execution of the SCSI Request Packet. This\r |
240 | buffer must be allocated by the caller. If\r | |
241 | DataLength is 0, then this parameter is optional\r | |
242 | and may be NULL. \r | |
adde977a | 243 | @param[in, out] DataLength On input, a pointer to the length in bytes of\r |
d5954c61 | 244 | the DataBuffer buffer. On output, a pointer\r |
245 | to the number of bytes written to the DataBuffer\r | |
246 | buffer. \r | |
247 | @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r | |
248 | @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. \r | |
249 | @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. \r | |
250 | \r | |
251 | @retval EFI_SUCCESS The command was executed successfully.\r | |
252 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
253 | and SenseData in that order for additional status information.\r | |
254 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the\r | |
255 | entire DataBuffer could not be transferred.\r | |
bf231ea6 | 256 | The actual number of bytes transferred is returned\r |
d5954c61 | 257 | in DataLength.\r |
258 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
259 | there are too many SCSI Command Packets already queued.\r | |
260 | The SCSI Request Packet was not sent, so no additional\r | |
261 | status information is available. The caller may retry\r | |
262 | again later.\r | |
263 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
264 | SCSI Request Packet. See HostAdapterStatus, TargetStatus,\r | |
265 | SenseDataLength, and SenseData in that order for\r | |
266 | additional status information.\r | |
bf231ea6 | 267 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r |
d5954c61 | 268 | is not supported by the SCSI initiator(i.e., SCSI\r |
269 | Host Controller). The SCSI Request Packet was not\r | |
270 | sent, so no additional status information is available.\r | |
271 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r | |
272 | Request Packet to execute. See HostAdapterStatus,\r | |
273 | TargetStatus, SenseDataLength, and SenseData in that\r | |
274 | order for additional status information.\r | |
fc30687f | 275 | \r |
bf231ea6 | 276 | **/\r |
fb3df220 | 277 | EFI_STATUS\r |
373b5cf9 | 278 | EFIAPI\r |
d35be2a4 | 279 | ScsiModeSense10Command (\r |
d5954c61 | 280 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
281 | IN UINT64 Timeout,\r | |
282 | IN OUT VOID *SenseData, OPTIONAL\r | |
283 | IN OUT UINT8 *SenseDataLength,\r | |
284 | OUT UINT8 *HostAdapterStatus,\r | |
285 | OUT UINT8 *TargetStatus,\r | |
286 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
287 | IN OUT UINT32 *DataLength,\r | |
288 | IN UINT8 DBDField, OPTIONAL\r | |
289 | IN UINT8 PageControl,\r | |
290 | IN UINT8 PageCode\r | |
bf231ea6 A |
291 | );\r |
292 | \r | |
293 | \r | |
294 | \r | |
fc30687f | 295 | /**\r |
d5954c61 | 296 | Execute Request Sense SCSI command on a specific SCSI target.\r |
b91d5eca | 297 | \r |
d5954c61 | 298 | Executes the Request Sense command on the SCSI target specified by ScsiIo.\r |
299 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
300 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
301 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 302 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 303 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 304 | If TargetStatus is NULL, then ASSERT().\r |
305 | \r | |
306 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
307 | @param[in] Timeout The length of timeout period.\r | |
d5954c61 | 308 | @param[in, out] SenseData A pointer to output sense data.\r |
309 | @param[in, out] SenseDataLength The length of output sense data.\r | |
b91d5eca | 310 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
311 | @param[out] TargetStatus The status of the target.\r | |
312 | \r | |
313 | @retval EFI_SUCCESS Command is executed successfully.\r | |
314 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are\r | |
315 | too many SCSI Command Packets already queued.\r | |
316 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
317 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
318 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
319 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 320 | \r |
bf231ea6 | 321 | **/\r |
fb3df220 | 322 | EFI_STATUS\r |
373b5cf9 | 323 | EFIAPI\r |
d35be2a4 | 324 | ScsiRequestSenseCommand (\r |
d5954c61 | 325 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
326 | IN UINT64 Timeout,\r | |
327 | IN OUT VOID *SenseData, OPTIONAL\r | |
328 | IN OUT UINT8 *SenseDataLength,\r | |
329 | OUT UINT8 *HostAdapterStatus,\r | |
330 | OUT UINT8 *TargetStatus\r | |
bf231ea6 A |
331 | );\r |
332 | \r | |
333 | \r | |
fc30687f | 334 | /**\r |
d5954c61 | 335 | Execute Read Capacity SCSI command on a specific SCSI target.\r |
b91d5eca | 336 | \r |
d5954c61 | 337 | Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r |
338 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
339 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
340 | Timeout 100 ns units. The PMI parameter is used to construct the CDB for this SCSI command.\r | |
341 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 342 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 343 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 344 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 345 | If DataLength is NULL, then ASSERT().\r |
346 | \r | |
d5954c61 | 347 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r |
348 | @param[in] Timeout The length of timeout period.\r | |
349 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 350 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 351 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
352 | @param[out] TargetStatus The status of the target.\r | |
353 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 354 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 355 | @param[in] PMI Partial medium indicator.\r |
b91d5eca | 356 | \r |
940a892b | 357 | @retval EFI_SUCCESS Command is executed successfully.\r |
358 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
359 | DataBuffer could not be transferred. The actual\r | |
360 | number of bytes transferred is returned in DataLength.\r | |
361 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
362 | there are too many SCSI Command Packets already queued.\r | |
363 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
364 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
365 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
366 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 367 | \r |
bf231ea6 | 368 | **/\r |
fb3df220 | 369 | EFI_STATUS\r |
9199040c | 370 | EFIAPI\r |
d35be2a4 | 371 | ScsiReadCapacityCommand (\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 BOOLEAN PMI\r | |
bf231ea6 A |
381 | );\r |
382 | \r | |
383 | \r | |
fc30687f | 384 | /**\r |
d5954c61 | 385 | Execute Read(10) SCSI command on a specific SCSI target.\r |
386 | \r | |
387 | Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r | |
388 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
389 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
390 | after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r | |
391 | construct the CDB for this SCSI command.\r | |
392 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 393 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 394 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 395 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 396 | If DataLength is NULL, then ASSERT().\r |
397 | \r | |
d5954c61 | 398 | \r |
399 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
400 | @param[in] Timeout The length of timeout period.\r | |
401 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 402 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 403 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
404 | @param[out] TargetStatus The status of the target.\r | |
405 | @param[in, out] DataBuffer Read 10 command data.\r | |
6053411e | 406 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 407 | @param[in] StartLba The start address of LBA.\r |
408 | @param[in] SectorSize The sector size.\r | |
b91d5eca | 409 | \r |
940a892b | 410 | @retval EFI_SUCCESS Command is executed successfully.\r |
411 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
412 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
413 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
414 | SCSI Command Packets already queued.\r | |
415 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
416 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
417 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
418 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 419 | \r |
bf231ea6 | 420 | **/\r |
fb3df220 | 421 | EFI_STATUS\r |
373b5cf9 | 422 | EFIAPI\r |
d35be2a4 | 423 | ScsiRead10Command (\r |
d5954c61 | 424 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
425 | IN UINT64 Timeout,\r | |
426 | IN OUT VOID *SenseData, OPTIONAL\r | |
427 | IN OUT UINT8 *SenseDataLength,\r | |
428 | OUT UINT8 *HostAdapterStatus,\r | |
429 | OUT UINT8 *TargetStatus,\r | |
430 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
431 | IN OUT UINT32 *DataLength,\r | |
432 | IN UINT32 StartLba,\r | |
433 | IN UINT32 SectorSize\r | |
bf231ea6 A |
434 | );\r |
435 | \r | |
436 | \r | |
fc30687f | 437 | /**\r |
d5954c61 | 438 | Execute Write(10) SCSI command on a specific SCSI target.\r |
439 | \r | |
440 | Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r | |
441 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
442 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
443 | Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r | |
444 | the CDB for this SCSI command.\r | |
445 | If ScsiIo is NULL, then ASSERT().\r | |
b91d5eca | 446 | If SenseDataLength is NULL, then ASSERT().\r |
b91d5eca | 447 | If HostAdapterStatus is NULL, then ASSERT().\r |
b91d5eca | 448 | If TargetStatus is NULL, then ASSERT().\r |
b91d5eca | 449 | If DataLength is NULL, then ASSERT().\r |
450 | \r | |
d5954c61 | 451 | @param[in] ScsiIo SCSI IO Protocol to use\r |
452 | @param[in] Timeout The length of timeout period.\r | |
453 | @param[in, out] SenseData A pointer to output sense data.\r | |
6053411e | 454 | @param[in, out] SenseDataLength The length of output sense data.\r |
d5954c61 | 455 | @param[out] HostAdapterStatus The status of Host Adapter.\r |
456 | @param[out] TargetStatus The status of the target.\r | |
457 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
6053411e | 458 | @param[in, out] DataLength The length of data buffer.\r |
d5954c61 | 459 | @param[in] StartLba The start address of LBA.\r |
460 | @param[in] SectorSize The sector size.\r | |
b91d5eca | 461 | \r |
940a892b | 462 | @retval EFI_SUCCESS Command is executed successfully.\r |
463 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
464 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
465 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
466 | SCSI Command Packets already queued.\r | |
467 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
468 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
469 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
470 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
fc30687f | 471 | \r |
bf231ea6 | 472 | **/\r |
fb3df220 | 473 | EFI_STATUS\r |
373b5cf9 | 474 | EFIAPI\r |
d35be2a4 | 475 | ScsiWrite10Command (\r |
d5954c61 | 476 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r |
477 | IN UINT64 Timeout,\r | |
478 | IN OUT VOID *SenseData, OPTIONAL\r | |
479 | IN OUT UINT8 *SenseDataLength,\r | |
480 | OUT UINT8 *HostAdapterStatus,\r | |
481 | OUT UINT8 *TargetStatus,\r | |
482 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
483 | IN OUT UINT32 *DataLength,\r | |
484 | IN UINT32 StartLba,\r | |
485 | IN UINT32 SectorSize\r | |
bf231ea6 | 486 | );\r |
fb3df220 | 487 | \r |
fb3df220 | 488 | \r |
489 | #endif\r |