]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | \r | |
3 | Provides the functions to submit Scsi commands defined in SCSI-2 specification for scsi device.\r | |
4 | \r | |
5 | Copyright (c) 2006 - 2008, Intel Corporation<BR>\r | |
6 | All rights reserved. This program and the accompanying materials \r | |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __SCSI_LIB_H__\r | |
17 | #define __SCSI_LIB_H__\r | |
18 | \r | |
19 | #include <Protocol/ScsiIo.h>\r | |
20 | \r | |
21 | /**\r | |
22 | Execute Test Unit Ready SCSI command on a specific SCSI target.\r | |
23 | \r | |
24 | Executes the Test Unit Ready command on the SCSI target specified by ScsiIo.\r | |
25 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
26 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
27 | If ScsiIo is NULL, then ASSERT().\r | |
28 | If SenseDataLength is NULL, then ASSERT().\r | |
29 | If HostAdapterStatus is NULL, then ASSERT().\r | |
30 | If TargetStatus is NULL, then ASSERT().\r | |
31 | \r | |
32 | \r | |
33 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
34 | for the specific SCSI target.\r | |
35 | @param[in] Timeout The timeout in 100 ns units to use for the execution\r | |
36 | of this SCSI Request Packet. A Timeout value of\r | |
37 | zero means that this function will wait indefinitely\r | |
38 | for the SCSI Request Packet to execute. If Timeout\r | |
39 | is greater than zero, then this function will return\r | |
40 | EFI_TIMEOUT if the time required to execute the SCSI\r | |
41 | Request Packet is greater than Timeout.\r | |
42 | @param[in, out] SenseData A pointer to sense data that was generated by\r | |
43 | the execution of the SCSI Request Packet. This\r | |
44 | buffer must be allocated by the caller.\r | |
45 | If SenseDataLength is 0, then this parameter is\r | |
46 | optional and may be NULL.\r | |
47 | @param[in, out] SenseDataLength On input, a pointer to the length in bytes of\r | |
48 | the SenseData buffer. On output, a poiinter to\r | |
49 | the number of bytes written to the SenseData buffer. \r | |
50 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces\r | |
51 | the SCSI bus containing the SCSI target specified by\r | |
52 | ScsiIo when the SCSI Request Packet was executed.\r | |
53 | See the EFI SCSI I/O Protocol in the UEFI Specification\r | |
54 | for details on the possible return values.\r | |
55 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
56 | by ScsiIo when the SCSI Request Packat was executed\r | |
57 | on the SCSI Host Controller. See the EFI SCSI I/O\r | |
58 | Protocol in the UEFI Specification for details on\r | |
59 | the possible return values. \r | |
60 | \r | |
61 | @retval EFI_SUCCESS The command was executed successfully.\r | |
62 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
63 | and SenseData in that order for additional status\r | |
64 | information.\r | |
65 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
66 | there are too many SCSI Command Packets already\r | |
67 | queued. The SCSI Request Packet was not sent, so\r | |
68 | no additional status information is available.\r | |
69 | The caller may retry again later.\r | |
70 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
71 | SCSI Request Packet. See HostAdapterStatus,\r | |
72 | TargetStatus, SenseDataLength, and SenseData in that\r | |
73 | order for additional status information.\r | |
74 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
75 | is not supported by the SCSI initiator(i.e., SCSI\r | |
76 | Host Controller). The SCSI Request Packet was not\r | |
77 | sent, so no additional status information is available.\r | |
78 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
79 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
80 | SenseDataLength, and SenseData in that order for\r | |
81 | additional status information.\r | |
82 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, \r | |
83 | but the entire DataBuffer could not be transferred.\r | |
84 | The actual number of bytes transferred is returned\r | |
85 | in InTransferLength.\r | |
86 | \r | |
87 | **/\r | |
88 | EFI_STATUS\r | |
89 | EFIAPI\r | |
90 | ScsiTestUnitReadyCommand (\r | |
91 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
92 | IN UINT64 Timeout,\r | |
93 | IN OUT VOID *SenseData, OPTIONAL\r | |
94 | IN OUT UINT8 *SenseDataLength,\r | |
95 | OUT UINT8 *HostAdapterStatus,\r | |
96 | OUT UINT8 *TargetStatus\r | |
97 | );\r | |
98 | \r | |
99 | \r | |
100 | /**\r | |
101 | Execute Inquiry SCSI command on a specific SCSI target.\r | |
102 | \r | |
103 | Executes the Inquiry command on the SCSI target specified by ScsiIo.\r | |
104 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
105 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
106 | If ScsiIo is NULL, then ASSERT().\r | |
107 | If SenseDataLength is NULL, then ASSERT().\r | |
108 | If HostAdapterStatus is NULL, then ASSERT().\r | |
109 | If TargetStatus is NULL, then ASSERT().\r | |
110 | If InquiryDataLength is NULL, then ASSERT().\r | |
111 | \r | |
112 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
113 | for the specific SCSI target.\r | |
114 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
115 | execution of this SCSI Request Packet. A Timeout\r | |
116 | value of zero means that this function will wait\r | |
117 | indefinitely for the SCSI Request Packet to execute.\r | |
118 | If Timeout is greater than zero, then this function\r | |
119 | will return EFI_TIMEOUT if the time required to\r | |
120 | execute the SCSI Request Packet is greater than Timeout.\r | |
121 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
122 | by the execution of the SCSI Request Packet.\r | |
123 | This buffer must be allocated by the caller.\r | |
124 | If SenseDataLength is 0, then this parameter\r | |
125 | is optional and may be NULL.\r | |
126 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
127 | On output, the number of bytes written to the SenseData buffer. \r | |
128 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
129 | produces the SCSI bus containing the SCSI\r | |
130 | target specified by ScsiIo when the SCSI\r | |
131 | Request Packet was executed. See the EFI\r | |
132 | SCSI I/O Protocol in the UEFI Specification\r | |
133 | for details on the possible return values.\r | |
134 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
135 | by ScsiIo when the SCSI Request Packat was\r | |
136 | executed on the SCSI Host Controller.\r | |
137 | See the EFI SCSI I/O Protocol in the UEFI\r | |
138 | Specification for details on the possible\r | |
139 | return values. \r | |
140 | @param[in, out] InquiryDataBuffer A pointer to inquiry data that was generated\r | |
141 | by the execution of the SCSI Request Packet.\r | |
142 | This buffer must be allocated by the caller.\r | |
143 | If InquiryDataLength is 0, then this parameter\r | |
144 | is optional and may be NULL. \r | |
145 | @param[in, out] InquiryDataLength On input, a pointer to the length in bytes\r | |
146 | of the InquiryDataBuffer buffer.\r | |
147 | On output, a pointer to the number of bytes\r | |
148 | written to the InquiryDataBuffer buffer.\r | |
149 | @param[in] EnableVitalProductData If TRUE, then the supported vital product\r | |
150 | data is returned in InquiryDataBuffer.\r | |
151 | If FALSE, then the standard inquiry data is\r | |
152 | returned in InquiryDataBuffer. \r | |
153 | \r | |
154 | @retval EFI_SUCCESS The command was executed successfully. See HostAdapterStatus,\r | |
155 | TargetStatus, SenseDataLength, and SenseData in that order\r | |
156 | for additional status information.\r | |
157 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
158 | InquiryDataBuffer could not be transferred. The actual\r | |
159 | number of bytes transferred is returned in InquiryDataLength.\r | |
160 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there\r | |
161 | are too many SCSI Command Packets already queued.\r | |
162 | The SCSI Request Packet was not sent, so no additional\r | |
163 | status information is available. The caller may retry again later.\r | |
164 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI\r | |
165 | Request Packet. See HostAdapterStatus, TargetStatus,\r | |
166 | SenseDataLength, and SenseData in that order for additional\r | |
167 | status information.\r | |
168 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not\r | |
169 | supported by the SCSI initiator(i.e., SCSI Host Controller).\r | |
170 | The SCSI Request Packet was not sent, so no additional\r | |
171 | status information is available.\r | |
172 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request\r | |
173 | Packet to execute. See HostAdapterStatus, TargetStatus,\r | |
174 | SenseDataLength, and SenseData in that order for\r | |
175 | additional status information.\r | |
176 | \r | |
177 | **/\r | |
178 | EFI_STATUS\r | |
179 | EFIAPI\r | |
180 | ScsiInquiryCommand (\r | |
181 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
182 | IN UINT64 Timeout,\r | |
183 | IN OUT VOID *SenseData, OPTIONAL\r | |
184 | IN OUT UINT8 *SenseDataLength,\r | |
185 | OUT UINT8 *HostAdapterStatus,\r | |
186 | OUT UINT8 *TargetStatus,\r | |
187 | IN OUT VOID *InquiryDataBuffer, OPTIONAL\r | |
188 | IN OUT UINT32 *InquiryDataLength,\r | |
189 | IN BOOLEAN EnableVitalProductData\r | |
190 | );\r | |
191 | \r | |
192 | \r | |
193 | /**\r | |
194 | Execute Mode Sense(10) SCSI command on a specific SCSI target.\r | |
195 | \r | |
196 | Executes the SCSI Mode Sense(10) command on the SCSI target specified by ScsiIo.\r | |
197 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
198 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
199 | after Timeout 100 ns units. The DBDField, PageControl, and PageCode parameters\r | |
200 | are used to construct the CDB for this SCSI command.\r | |
201 | If ScsiIo is NULL, then ASSERT().\r | |
202 | If SenseDataLength is NULL, then ASSERT().\r | |
203 | If HostAdapterStatus is NULL, then ASSERT().\r | |
204 | If TargetStatus is NULL, then ASSERT().\r | |
205 | If DataLength is NULL, then ASSERT().\r | |
206 | \r | |
207 | \r | |
208 | @param[in] ScsiIo A pointer to the SCSI I/O Protocol instance\r | |
209 | for the specific SCSI target.\r | |
210 | @param[in] Timeout The timeout in 100 ns units to use for the\r | |
211 | execution of this SCSI Request Packet. A Timeout\r | |
212 | value of zero means that this function will wait\r | |
213 | indefinitely for the SCSI Request Packet to execute.\r | |
214 | If Timeout is greater than zero, then this function\r | |
215 | will return EFI_TIMEOUT if the time required to\r | |
216 | execute the SCSI Request Packet is greater than Timeout.\r | |
217 | @param[in, out] SenseData A pointer to sense data that was generated\r | |
218 | by the execution of the SCSI Request Packet.\r | |
219 | This buffer must be allocated by the caller.\r | |
220 | If SenseDataLength is 0, then this parameter\r | |
221 | is optional and may be NULL.\r | |
222 | @param[in, out] SenseDataLength On input, the length in bytes of the SenseData buffer.\r | |
223 | On output, the number of bytes written to the SenseData buffer. \r | |
224 | @param[out] HostAdapterStatus The status of the SCSI Host Controller that\r | |
225 | produces the SCSI bus containing the SCSI target\r | |
226 | specified by ScsiIo when the SCSI Request Packet\r | |
227 | was executed. See the EFI SCSI I/O Protocol in the\r | |
228 | UEFI Specification for details on the possible\r | |
229 | return values.\r | |
230 | @param[out] TargetStatus The status returned by the SCSI target specified\r | |
231 | by ScsiIo when the SCSI Request Packat was executed\r | |
232 | on the SCSI Host Controller. See the EFI SCSI\r | |
233 | I/O Protocol in the UEFI Specification for details\r | |
234 | on the possible return values.\r | |
235 | @param[in, out] DataBuffer A pointer to data that was generated by the\r | |
236 | execution of the SCSI Request Packet. This\r | |
237 | buffer must be allocated by the caller. If\r | |
238 | DataLength is 0, then this parameter is optional\r | |
239 | and may be NULL. \r | |
240 | @param[in, out] DataLength On input, a pointer to the length in bytes of\r | |
241 | the DataBuffer buffer. On output, a pointer\r | |
242 | to the number of bytes written to the DataBuffer\r | |
243 | buffer. \r | |
244 | @param[in] DBDField Specifies the DBD field of the CDB for this SCSI Command.\r | |
245 | @param[in] PageControl Specifies the PC field of the CDB for this SCSI Command. \r | |
246 | @param[in] PageCode Specifies the Page Control field of the CDB for this SCSI Command. \r | |
247 | \r | |
248 | @retval EFI_SUCCESS The command was executed successfully.\r | |
249 | See HostAdapterStatus, TargetStatus, SenseDataLength,\r | |
250 | and SenseData in that order for additional status information.\r | |
251 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the\r | |
252 | entire DataBuffer could not be transferred.\r | |
253 | The actual number of bytes transferred is returned\r | |
254 | in DataLength.\r | |
255 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
256 | there are too many SCSI Command Packets already queued.\r | |
257 | The SCSI Request Packet was not sent, so no additional\r | |
258 | status information is available. The caller may retry\r | |
259 | again later.\r | |
260 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send\r | |
261 | SCSI Request Packet. See HostAdapterStatus, TargetStatus,\r | |
262 | SenseDataLength, and SenseData in that order for\r | |
263 | additional status information.\r | |
264 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
265 | is not supported by the SCSI initiator(i.e., SCSI\r | |
266 | Host Controller). The SCSI Request Packet was not\r | |
267 | sent, so no additional status information is available.\r | |
268 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI\r | |
269 | Request Packet to execute. See HostAdapterStatus,\r | |
270 | TargetStatus, SenseDataLength, and SenseData in that\r | |
271 | order for additional status information.\r | |
272 | \r | |
273 | **/\r | |
274 | EFI_STATUS\r | |
275 | EFIAPI\r | |
276 | ScsiModeSense10Command (\r | |
277 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
278 | IN UINT64 Timeout,\r | |
279 | IN OUT VOID *SenseData, OPTIONAL\r | |
280 | IN OUT UINT8 *SenseDataLength,\r | |
281 | OUT UINT8 *HostAdapterStatus,\r | |
282 | OUT UINT8 *TargetStatus,\r | |
283 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
284 | IN OUT UINT32 *DataLength,\r | |
285 | IN UINT8 DBDField, OPTIONAL\r | |
286 | IN UINT8 PageControl,\r | |
287 | IN UINT8 PageCode\r | |
288 | );\r | |
289 | \r | |
290 | \r | |
291 | \r | |
292 | /**\r | |
293 | Execute Request Sense SCSI command on a specific SCSI target.\r | |
294 | \r | |
295 | Executes the Request Sense command on the SCSI target specified by ScsiIo.\r | |
296 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
297 | If Timeout is greater than zero, then the command is executed and will timeout after Timeout 100 ns units.\r | |
298 | If ScsiIo is NULL, then ASSERT().\r | |
299 | If SenseDataLength is NULL, then ASSERT().\r | |
300 | If HostAdapterStatus is NULL, then ASSERT().\r | |
301 | If TargetStatus is NULL, then ASSERT().\r | |
302 | \r | |
303 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
304 | @param[in] Timeout The length of timeout period.\r | |
305 | @param[in, out] SenseData A pointer to output sense data.\r | |
306 | @param[in, out] SenseDataLength The length of output sense data.\r | |
307 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
308 | @param[out] TargetStatus The status of the target.\r | |
309 | \r | |
310 | @retval EFI_SUCCESS Command is executed successfully.\r | |
311 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are\r | |
312 | too many SCSI Command Packets already queued.\r | |
313 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
314 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by\r | |
315 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
316 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
317 | \r | |
318 | **/\r | |
319 | EFI_STATUS\r | |
320 | EFIAPI\r | |
321 | ScsiRequestSenseCommand (\r | |
322 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
323 | IN UINT64 Timeout,\r | |
324 | IN OUT VOID *SenseData, OPTIONAL\r | |
325 | IN OUT UINT8 *SenseDataLength,\r | |
326 | OUT UINT8 *HostAdapterStatus,\r | |
327 | OUT UINT8 *TargetStatus\r | |
328 | );\r | |
329 | \r | |
330 | \r | |
331 | /**\r | |
332 | Execute Read Capacity SCSI command on a specific SCSI target.\r | |
333 | \r | |
334 | Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r | |
335 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
336 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
337 | Timeout 100 ns units. The PMI parameter is used to construct the CDB for this SCSI command.\r | |
338 | If ScsiIo is NULL, then ASSERT().\r | |
339 | If SenseDataLength is NULL, then ASSERT().\r | |
340 | If HostAdapterStatus is NULL, then ASSERT().\r | |
341 | If TargetStatus is NULL, then ASSERT().\r | |
342 | If DataLength is NULL, then ASSERT().\r | |
343 | \r | |
344 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
345 | @param[in] Timeout The length of timeout period.\r | |
346 | @param[in, out] SenseData A pointer to output sense data.\r | |
347 | @param[in, out] SenseDataLength The length of output sense data.\r | |
348 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
349 | @param[out] TargetStatus The status of the target.\r | |
350 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
351 | @param[in, out] DataLength The length of data buffer.\r | |
352 | @param[in] PMI Partial medium indicator.\r | |
353 | \r | |
354 | @retval EFI_SUCCESS Command is executed successfully.\r | |
355 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire\r | |
356 | DataBuffer could not be transferred. The actual\r | |
357 | number of bytes transferred is returned in DataLength.\r | |
358 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because\r | |
359 | there are too many SCSI Command Packets already queued.\r | |
360 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
361 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet\r | |
362 | is not supported by the SCSI initiator(i.e., SCSI Host Controller)\r | |
363 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
364 | \r | |
365 | **/\r | |
366 | EFI_STATUS\r | |
367 | EFIAPI\r | |
368 | ScsiReadCapacityCommand (\r | |
369 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
370 | IN UINT64 Timeout,\r | |
371 | IN OUT VOID *SenseData, OPTIONAL\r | |
372 | IN OUT UINT8 *SenseDataLength,\r | |
373 | OUT UINT8 *HostAdapterStatus,\r | |
374 | OUT UINT8 *TargetStatus,\r | |
375 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
376 | IN OUT UINT32 *DataLength,\r | |
377 | IN BOOLEAN PMI\r | |
378 | );\r | |
379 | \r | |
380 | \r | |
381 | /**\r | |
382 | Execute Read(10) SCSI command on a specific SCSI target.\r | |
383 | \r | |
384 | Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r | |
385 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
386 | If Timeout is greater than zero, then the command is executed and will timeout\r | |
387 | after Timeout 100 ns units. The StartLba and SectorSize parameters are used to\r | |
388 | construct the CDB for this SCSI command.\r | |
389 | If ScsiIo is NULL, then ASSERT().\r | |
390 | If SenseDataLength is NULL, then ASSERT().\r | |
391 | If HostAdapterStatus is NULL, then ASSERT().\r | |
392 | If TargetStatus is NULL, then ASSERT().\r | |
393 | If DataLength is NULL, then ASSERT().\r | |
394 | \r | |
395 | \r | |
396 | @param[in] ScsiIo A pointer to SCSI IO protocol.\r | |
397 | @param[in] Timeout The length of timeout period.\r | |
398 | @param[in, out] SenseData A pointer to output sense data.\r | |
399 | @param[in, out] SenseDataLength The length of output sense data.\r | |
400 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
401 | @param[out] TargetStatus The status of the target.\r | |
402 | @param[in, out] DataBuffer Read 10 command data.\r | |
403 | @param[in, out] DataLength The length of data buffer.\r | |
404 | @param[in] StartLba The start address of LBA.\r | |
405 | @param[in] SectorSize The sector size.\r | |
406 | \r | |
407 | @retval EFI_SUCCESS Command is executed successfully.\r | |
408 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
409 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
410 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
411 | SCSI Command Packets already queued.\r | |
412 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
413 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
414 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
415 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
416 | \r | |
417 | **/\r | |
418 | EFI_STATUS\r | |
419 | EFIAPI\r | |
420 | ScsiRead10Command (\r | |
421 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
422 | IN UINT64 Timeout,\r | |
423 | IN OUT VOID *SenseData, OPTIONAL\r | |
424 | IN OUT UINT8 *SenseDataLength,\r | |
425 | OUT UINT8 *HostAdapterStatus,\r | |
426 | OUT UINT8 *TargetStatus,\r | |
427 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
428 | IN OUT UINT32 *DataLength,\r | |
429 | IN UINT32 StartLba,\r | |
430 | IN UINT32 SectorSize\r | |
431 | );\r | |
432 | \r | |
433 | \r | |
434 | /**\r | |
435 | Execute Write(10) SCSI command on a specific SCSI target.\r | |
436 | \r | |
437 | Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r | |
438 | If Timeout is zero, then this function waits indefinitely for the command to complete.\r | |
439 | If Timeout is greater than zero, then the command is executed and will timeout after\r | |
440 | Timeout 100 ns units. The StartLba and SectorSize parameters are used to construct\r | |
441 | the CDB for this SCSI command.\r | |
442 | If ScsiIo is NULL, then ASSERT().\r | |
443 | If SenseDataLength is NULL, then ASSERT().\r | |
444 | If HostAdapterStatus is NULL, then ASSERT().\r | |
445 | If TargetStatus is NULL, then ASSERT().\r | |
446 | If DataLength is NULL, then ASSERT().\r | |
447 | \r | |
448 | @param[in] ScsiIo SCSI IO Protocol to use\r | |
449 | @param[in] Timeout The length of timeout period.\r | |
450 | @param[in, out] SenseData A pointer to output sense data.\r | |
451 | @param[in, out] SenseDataLength The length of output sense data.\r | |
452 | @param[out] HostAdapterStatus The status of Host Adapter.\r | |
453 | @param[out] TargetStatus The status of the target.\r | |
454 | @param[in, out] DataBuffer A pointer to a data buffer.\r | |
455 | @param[in, out] DataLength The length of data buffer.\r | |
456 | @param[in] StartLba The start address of LBA.\r | |
457 | @param[in] SectorSize The sector size.\r | |
458 | \r | |
459 | @retval EFI_SUCCESS Command is executed successfully.\r | |
460 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire DataBuffer could\r | |
461 | not be transferred. The actual number of bytes transferred is returned in DataLength.\r | |
462 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many \r | |
463 | SCSI Command Packets already queued.\r | |
464 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet.\r | |
465 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported by \r | |
466 | the SCSI initiator(i.e., SCSI Host Controller)\r | |
467 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.\r | |
468 | \r | |
469 | **/\r | |
470 | EFI_STATUS\r | |
471 | EFIAPI\r | |
472 | ScsiWrite10Command (\r | |
473 | IN EFI_SCSI_IO_PROTOCOL *ScsiIo,\r | |
474 | IN UINT64 Timeout,\r | |
475 | IN OUT VOID *SenseData, OPTIONAL\r | |
476 | IN OUT UINT8 *SenseDataLength,\r | |
477 | OUT UINT8 *HostAdapterStatus,\r | |
478 | OUT UINT8 *TargetStatus,\r | |
479 | IN OUT VOID *DataBuffer, OPTIONAL\r | |
480 | IN OUT UINT32 *DataLength,\r | |
481 | IN UINT32 StartLba,\r | |
482 | IN UINT32 SectorSize\r | |
483 | );\r | |
484 | \r | |
485 | \r | |
486 | #endif\r |