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