]>
Commit | Line | Data |
---|---|---|
aca84419 | 1 | /** @file |
2 | Header file for ATA/ATAPI PASS THRU driver. | |
3 | ||
4 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> | |
5 | This program and the accompanying materials | |
6 | are licensed and made available under the terms and conditions of the BSD License | |
7 | which accompanies this distribution. The full text of the license may be found at | |
8 | http://opensource.org/licenses/bsd-license.php | |
9 | ||
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
12 | ||
13 | **/ | |
14 | #ifndef __ATA_ATAPI_PASS_THRU_H__ | |
15 | #define __ATA_ATAPI_PASS_THRU_H__ | |
16 | ||
17 | #include <Uefi.h> | |
18 | ||
19 | #include <IndustryStandard/Pci.h> | |
20 | #include <IndustryStandard/Atapi.h> | |
21 | #include <IndustryStandard/Scsi.h> | |
22 | ||
23 | #include <Protocol/PciIo.h> | |
24 | #include <Protocol/IdeControllerInit.h> | |
25 | #include <Protocol/AtaPassThru.h> | |
26 | #include <Protocol/ScsiPassThruExt.h> | |
27 | ||
28 | #include <Library/DebugLib.h> | |
29 | #include <Library/BaseLib.h> | |
30 | #include <Library/BaseMemoryLib.h> | |
31 | #include <Library/UefiDriverEntryPoint.h> | |
32 | #include <Library/UefiBootServicesTableLib.h> | |
33 | #include <Library/UefiLib.h> | |
34 | #include <Library/PciLib.h> | |
35 | #include <Library/PcdLib.h> | |
36 | #include <Library/TimerLib.h> | |
37 | #include <Library/MemoryAllocationLib.h> | |
38 | #include <Library/ReportStatusCodeLib.h> | |
39 | #include <Library/DevicePathLib.h> | |
40 | ||
41 | #include "IdeMode.h" | |
42 | #include "AhciMode.h" | |
43 | ||
44 | extern EFI_DRIVER_BINDING_PROTOCOL gAtaAtapiPassThruDriverBinding; | |
45 | extern EFI_COMPONENT_NAME_PROTOCOL gAtaAtapiPassThruComponentName; | |
46 | extern EFI_COMPONENT_NAME2_PROTOCOL gAtaAtapiPassThruComponentName2; | |
47 | ||
48 | #define ATA_ATAPI_PASS_THRU_SIGNATURE SIGNATURE_32 ('a', 'a', 'p', 't') | |
49 | #define ATA_ATAPI_DEVICE_SIGNATURE SIGNATURE_32 ('a', 'd', 'e', 'v') | |
50 | ||
51 | typedef enum { | |
52 | EfiAtaIdeMode, | |
53 | EfiAtaAhciMode, | |
54 | EfiAtaRaidMode, | |
55 | EfiAtaUnknownMode | |
56 | } EFI_ATA_HC_WORK_MODE; | |
57 | ||
58 | typedef enum { | |
59 | EfiIdeCdrom, /* ATAPI CDROM */ | |
60 | EfiIdeHarddisk, /* Hard Disk */ | |
61 | EfiPortMultiplier, /* Port Multiplier */ | |
62 | EfiIdeUnknown | |
63 | } EFI_ATA_DEVICE_TYPE; | |
64 | ||
65 | // | |
66 | // Ahci mode device info | |
67 | // | |
68 | typedef struct { | |
69 | UINT32 Signature; | |
70 | LIST_ENTRY Link; | |
71 | ||
72 | UINT16 Port; | |
73 | UINT16 PortMultiplier; | |
74 | EFI_ATA_DEVICE_TYPE Type; | |
75 | ||
76 | EFI_IDENTIFY_DATA *IdentifyData; | |
77 | } EFI_ATA_DEVICE_INFO; | |
78 | ||
79 | typedef struct { | |
80 | UINT32 Signature; | |
81 | ||
82 | EFI_HANDLE ControllerHandle; | |
83 | EFI_PCI_IO_PROTOCOL *PciIo; | |
84 | EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInit; | |
85 | ||
86 | EFI_ATA_PASS_THRU_MODE AtaPassThruMode; | |
87 | EFI_ATA_PASS_THRU_PROTOCOL AtaPassThru; | |
88 | EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode; | |
89 | EFI_EXT_SCSI_PASS_THRU_PROTOCOL ExtScsiPassThru; | |
90 | ||
91 | EFI_ATA_HC_WORK_MODE Mode; | |
92 | ||
93 | EFI_IDE_REGISTERS IdeRegisters[EfiIdeMaxChannel]; | |
94 | EFI_AHCI_REGISTERS AhciRegisters; | |
95 | ||
96 | // | |
97 | // The attached device list | |
98 | // | |
99 | LIST_ENTRY DeviceList; | |
100 | UINT64 OriginalPciAttributes; | |
101 | \r | |
102 | // | |
103 | // For AtaPassThru protocol, using the following bytes to record the previous call in | |
104 | // GetNextPort()/GetNextDevice(). | |
105 | // | |
106 | UINT16 PreviousPort; | |
107 | UINT16 PreviousPortMultiplier; | |
108 | // | |
109 | // For ExtScsiPassThru protocol, using the following bytes to record the previous call in | |
110 | // GetNextTarget()/GetNextTargetLun(). | |
111 | // | |
112 | UINT16 PreviousTargetId; | |
113 | UINT64 PreviousLun; | |
114 | ||
115 | } ATA_ATAPI_PASS_THRU_INSTANCE; | |
116 | ||
117 | // | |
118 | // Timeout value which uses 100ns as a unit. | |
119 | // It means 3 second span. | |
120 | // | |
121 | #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3) | |
122 | ||
123 | #define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0) | |
124 | ||
125 | #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \ | |
126 | CR (a, \ | |
127 | ATA_ATAPI_PASS_THRU_INSTANCE, \ | |
128 | AtaPassThru, \ | |
129 | ATA_ATAPI_PASS_THRU_SIGNATURE \ | |
130 | ) | |
131 | ||
132 | #define EXT_SCSI_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \ | |
133 | CR (a, \ | |
134 | ATA_ATAPI_PASS_THRU_INSTANCE, \ | |
135 | ExtScsiPassThru, \ | |
136 | ATA_ATAPI_PASS_THRU_SIGNATURE \ | |
137 | ) | |
138 | ||
139 | #define ATA_ATAPI_DEVICE_INFO_FROM_THIS(a) \ | |
140 | CR (a, \ | |
141 | EFI_ATA_DEVICE_INFO, \ | |
142 | Link, \ | |
143 | ATA_ATAPI_DEVICE_SIGNATURE \ | |
144 | ); | |
145 | /** | |
146 | Retrieves a Unicode string that is the user readable name of the driver. | |
147 | ||
148 | This function retrieves the user readable name of a driver in the form of a | |
149 | Unicode string. If the driver specified by This has a user readable name in | |
150 | the language specified by Language, then a pointer to the driver name is | |
151 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified | |
152 | by This does not support the language specified by Language, | |
153 | then EFI_UNSUPPORTED is returned. | |
154 | ||
155 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | |
156 | EFI_COMPONENT_NAME_PROTOCOL instance. | |
157 | ||
158 | @param Language[in] A pointer to a Null-terminated ASCII string | |
159 | array indicating the language. This is the | |
160 | language of the driver name that the caller is | |
161 | requesting, and it must match one of the | |
162 | languages specified in SupportedLanguages. The | |
163 | number of languages supported by a driver is up | |
164 | to the driver writer. Language is specified | |
165 | in RFC 4646 or ISO 639-2 language code format. | |
166 | ||
167 | @param DriverName[out] A pointer to the Unicode string to return. | |
168 | This Unicode string is the name of the | |
169 | driver specified by This in the language | |
170 | specified by Language. | |
171 | ||
172 | @retval EFI_SUCCESS The Unicode string for the Driver specified by | |
173 | This and the language specified by Language was | |
174 | returned in DriverName. | |
175 | ||
176 | @retval EFI_INVALID_PARAMETER Language is NULL. | |
177 | ||
178 | @retval EFI_INVALID_PARAMETER DriverName is NULL. | |
179 | ||
180 | @retval EFI_UNSUPPORTED The driver specified by This does not support | |
181 | the language specified by Language. | |
182 | ||
183 | **/ | |
184 | EFI_STATUS | |
185 | EFIAPI | |
186 | AtaAtapiPassThruComponentNameGetDriverName ( | |
187 | IN EFI_COMPONENT_NAME_PROTOCOL *This, | |
188 | IN CHAR8 *Language, | |
189 | OUT CHAR16 **DriverName | |
190 | ); | |
191 | ||
192 | /** | |
193 | Retrieves a Unicode string that is the user readable name of the controller | |
194 | that is being managed by a driver. | |
195 | ||
196 | This function retrieves the user readable name of the controller specified by | |
197 | ControllerHandle and ChildHandle in the form of a Unicode string. If the | |
198 | driver specified by This has a user readable name in the language specified by | |
199 | Language, then a pointer to the controller name is returned in ControllerName, | |
200 | and EFI_SUCCESS is returned. If the driver specified by This is not currently | |
201 | managing the controller specified by ControllerHandle and ChildHandle, | |
202 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not | |
203 | support the language specified by Language, then EFI_UNSUPPORTED is returned. | |
204 | ||
205 | @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or | |
206 | EFI_COMPONENT_NAME_PROTOCOL instance. | |
207 | ||
208 | @param ControllerHandle[in] The handle of a controller that the driver | |
209 | specified by This is managing. This handle | |
210 | specifies the controller whose name is to be | |
211 | returned. | |
212 | ||
213 | @param ChildHandle[in] The handle of the child controller to retrieve | |
214 | the name of. This is an optional parameter that | |
215 | may be NULL. It will be NULL for device | |
216 | drivers. It will also be NULL for a bus drivers | |
217 | that wish to retrieve the name of the bus | |
218 | controller. It will not be NULL for a bus | |
219 | driver that wishes to retrieve the name of a | |
220 | child controller. | |
221 | ||
222 | @param Language[in] A pointer to a Null-terminated ASCII string | |
223 | array indicating the language. This is the | |
224 | language of the driver name that the caller is | |
225 | requesting, and it must match one of the | |
226 | languages specified in SupportedLanguages. The | |
227 | number of languages supported by a driver is up | |
228 | to the driver writer. Language is specified in | |
229 | RFC 4646 or ISO 639-2 language code format. | |
230 | ||
231 | @param ControllerName[out] A pointer to the Unicode string to return. | |
232 | This Unicode string is the name of the | |
233 | controller specified by ControllerHandle and | |
234 | ChildHandle in the language specified by | |
235 | Language from the point of view of the driver | |
236 | specified by This. | |
237 | ||
238 | @retval EFI_SUCCESS The Unicode string for the user readable name in | |
239 | the language specified by Language for the | |
240 | driver specified by This was returned in | |
241 | DriverName. | |
242 | ||
243 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. | |
244 | ||
245 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid | |
246 | EFI_HANDLE. | |
247 | ||
248 | @retval EFI_INVALID_PARAMETER Language is NULL. | |
249 | ||
250 | @retval EFI_INVALID_PARAMETER ControllerName is NULL. | |
251 | ||
252 | @retval EFI_UNSUPPORTED The driver specified by This is not currently | |
253 | managing the controller specified by | |
254 | ControllerHandle and ChildHandle. | |
255 | ||
256 | @retval EFI_UNSUPPORTED The driver specified by This does not support | |
257 | the language specified by Language. | |
258 | ||
259 | **/ | |
260 | EFI_STATUS | |
261 | EFIAPI | |
262 | AtaAtapiPassThruComponentNameGetControllerName ( | |
263 | IN EFI_COMPONENT_NAME_PROTOCOL *This, | |
264 | IN EFI_HANDLE ControllerHandle, | |
265 | IN EFI_HANDLE ChildHandle OPTIONAL, | |
266 | IN CHAR8 *Language, | |
267 | OUT CHAR16 **ControllerName | |
268 | ); | |
269 | ||
270 | /** | |
271 | Tests to see if this driver supports a given controller. If a child device is provided, | |
272 | it further tests to see if this driver supports creating a handle for the specified child device. | |
273 | ||
274 | This function checks to see if the driver specified by This supports the device specified by | |
275 | ControllerHandle. Drivers will typically use the device path attached to | |
276 | ControllerHandle and/or the services from the bus I/O abstraction attached to | |
277 | ControllerHandle to determine if the driver supports ControllerHandle. This function | |
278 | may be called many times during platform initialization. In order to reduce boot times, the tests | |
279 | performed by this function must be very small, and take as little time as possible to execute. This | |
280 | function must not change the state of any hardware devices, and this function must be aware that the | |
281 | device specified by ControllerHandle may already be managed by the same driver or a | |
282 | different driver. This function must match its calls to AllocatePages() with FreePages(), | |
283 | AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). | |
284 | Because ControllerHandle may have been previously started by the same driver, if a protocol is | |
285 | already in the opened state, then it must not be closed with CloseProtocol(). This is required | |
286 | to guarantee the state of ControllerHandle is not modified by this function. | |
287 | ||
288 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. | |
289 | @param[in] ControllerHandle The handle of the controller to test. This handle | |
290 | must support a protocol interface that supplies | |
291 | an I/O abstraction to the driver. | |
292 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This | |
293 | parameter is ignored by device drivers, and is optional for bus | |
294 | drivers. For bus drivers, if this parameter is not NULL, then | |
295 | the bus driver must determine if the bus controller specified | |
296 | by ControllerHandle and the child controller specified | |
297 | by RemainingDevicePath are both supported by this | |
298 | bus driver. | |
299 | ||
300 | @retval EFI_SUCCESS The device specified by ControllerHandle and | |
301 | RemainingDevicePath is supported by the driver specified by This. | |
302 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and | |
303 | RemainingDevicePath is already being managed by the driver | |
304 | specified by This. | |
305 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and | |
306 | RemainingDevicePath is already being managed by a different | |
307 | driver or an application that requires exclusive access. | |
308 | Currently not implemented. | |
309 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and | |
310 | RemainingDevicePath is not supported by the driver specified by This. | |
311 | **/ | |
312 | EFI_STATUS | |
313 | EFIAPI | |
314 | AtaAtapiPassThruSupported ( | |
315 | IN EFI_DRIVER_BINDING_PROTOCOL *This, | |
316 | IN EFI_HANDLE Controller, | |
317 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | |
318 | ); | |
319 | ||
320 | /** | |
321 | Starts a device controller or a bus controller. | |
322 | ||
323 | The Start() function is designed to be invoked from the EFI boot service ConnectController(). | |
324 | As a result, much of the error checking on the parameters to Start() has been moved into this | |
325 | common boot service. It is legal to call Start() from other locations, | |
326 | but the following calling restrictions must be followed, or the system behavior will not be deterministic. | |
327 | 1. ControllerHandle must be a valid EFI_HANDLE. | |
328 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned | |
329 | EFI_DEVICE_PATH_PROTOCOL. | |
330 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must | |
331 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. | |
332 | ||
333 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. | |
334 | @param[in] ControllerHandle The handle of the controller to start. This handle | |
335 | must support a protocol interface that supplies | |
336 | an I/O abstraction to the driver. | |
337 | @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This | |
338 | parameter is ignored by device drivers, and is optional for bus | |
339 | drivers. For a bus driver, if this parameter is NULL, then handles | |
340 | for all the children of Controller are created by this driver. | |
341 | If this parameter is not NULL and the first Device Path Node is | |
342 | not the End of Device Path Node, then only the handle for the | |
343 | child device specified by the first Device Path Node of | |
344 | RemainingDevicePath is created by this driver. | |
345 | If the first Device Path Node of RemainingDevicePath is | |
346 | the End of Device Path Node, no child handle is created by this | |
347 | driver. | |
348 | ||
349 | @retval EFI_SUCCESS The device was started. | |
350 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented. | |
351 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. | |
352 | @retval Others The driver failded to start the device. | |
353 | ||
354 | **/ | |
355 | EFI_STATUS | |
356 | EFIAPI | |
357 | AtaAtapiPassThruStart ( | |
358 | IN EFI_DRIVER_BINDING_PROTOCOL *This, | |
359 | IN EFI_HANDLE Controller, | |
360 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | |
361 | ); | |
362 | ||
363 | /** | |
364 | Stops a device controller or a bus controller. | |
365 | ||
366 | The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). | |
367 | As a result, much of the error checking on the parameters to Stop() has been moved | |
368 | into this common boot service. It is legal to call Stop() from other locations, | |
369 | but the following calling restrictions must be followed, or the system behavior will not be deterministic. | |
370 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this | |
371 | same driver's Start() function. | |
372 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid | |
373 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's | |
374 | Start() function, and the Start() function must have called OpenProtocol() on | |
375 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER. | |
376 | ||
377 | @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. | |
378 | @param[in] ControllerHandle A handle to the device being stopped. The handle must | |
379 | support a bus specific I/O protocol for the driver | |
380 | to use to stop the device. | |
381 | @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer. | |
382 | @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL | |
383 | if NumberOfChildren is 0. | |
384 | ||
385 | @retval EFI_SUCCESS The device was stopped. | |
386 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error. | |
387 | ||
388 | **/ | |
389 | EFI_STATUS | |
390 | EFIAPI | |
391 | AtaAtapiPassThruStop ( | |
392 | IN EFI_DRIVER_BINDING_PROTOCOL *This, | |
393 | IN EFI_HANDLE Controller, | |
394 | IN UINTN NumberOfChildren, | |
395 | IN EFI_HANDLE *ChildHandleBuffer | |
396 | ); | |
397 | ||
398 | /** | |
399 | Traverse the attached ATA devices list to find out the device to access. | |
400 | ||
401 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. | |
402 | @param[in] Port The port number of the ATA device to send the command. | |
403 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command. | |
404 | If there is no port multiplier, then specify 0. | |
405 | @param[in] DeviceType The device type of the ATA device. | |
406 | ||
407 | @retval The pointer to the data structure of the device info to access. | |
408 | ||
409 | **/ | |
410 | LIST_ENTRY * | |
411 | EFIAPI | |
412 | SearchDeviceInfoList ( | |
413 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance, | |
414 | IN UINT16 Port, | |
415 | IN UINT16 PortMultiplier, | |
416 | IN EFI_ATA_DEVICE_TYPE DeviceType | |
417 | ); | |
418 | ||
419 | /** | |
420 | Allocate device info data structure to contain device info. | |
421 | And insert the data structure to the tail of device list for tracing. | |
422 | ||
423 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. | |
424 | @param[in] Port The port number of the ATA device to send the command. | |
425 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command. | |
426 | If there is no port multiplier, then specify 0. | |
427 | @param[in] DeviceType The device type of the ATA device. | |
428 | @param[in] IdentifyData The data buffer to store the output of the IDENTIFY cmd. | |
429 | ||
430 | @retval EFI_SUCCESS Successfully insert the ata device to the tail of device list. | |
431 | @retval EFI_OUT_OF_RESOURCES Can not allocate enough resource for use. | |
432 | ||
433 | **/ | |
434 | EFI_STATUS | |
435 | EFIAPI | |
436 | CreateNewDeviceInfo ( | |
437 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance, | |
438 | IN UINT16 Port, | |
439 | IN UINT16 PortMultiplier, | |
440 | IN EFI_ATA_DEVICE_TYPE DeviceType, | |
441 | IN EFI_IDENTIFY_DATA *IdentifyData | |
442 | ); | |
443 | ||
444 | /** | |
445 | Destroy all attached ATA devices info. | |
446 | ||
447 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. | |
448 | ||
449 | **/ | |
450 | VOID | |
451 | EFIAPI | |
452 | DestroyDeviceInfoList ( | |
453 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance | |
454 | ); | |
455 | ||
456 | /** | |
457 | Enumerate all attached ATA devices at IDE mode or AHCI mode separately. | |
458 | ||
459 | The function is designed to enumerate all attached ATA devices. | |
460 | ||
461 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. | |
462 | ||
463 | @retval EFI_SUCCESS Successfully enumerate attached ATA devices. | |
464 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error. | |
465 | ||
466 | **/ | |
467 | EFI_STATUS | |
468 | EFIAPI | |
469 | EnumerateAttachedDevice ( | |
470 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance | |
471 | ); | |
472 | ||
473 | /** | |
474 | Sends an ATA command to an ATA device that is attached to the ATA controller. This function | |
475 | supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required, | |
476 | and the non-blocking I/O functionality is optional. | |
477 | ||
478 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. | |
479 | @param[in] Port The port number of the ATA device to send the command. | |
480 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command. | |
481 | If there is no port multiplier, then specify 0. | |
482 | @param[in, out] Packet A pointer to the ATA command to send to the ATA device specified by Port | |
483 | and PortMultiplierPort. | |
484 | @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking | |
485 | I/O is performed. If Event is NULL, then blocking I/O is performed. If | |
486 | Event is not NULL and non blocking I/O is supported, then non-blocking | |
487 | I/O is performed, and Event will be signaled when the ATA command completes. | |
488 | ||
489 | @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands, | |
490 | InTransferLength bytes were transferred from InDataBuffer. For write and | |
491 | bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer. | |
492 | @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred | |
493 | is returned in InTransferLength. For write and bi-directional commands, | |
494 | OutTransferLength bytes were transferred by OutDataBuffer. | |
495 | @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands | |
496 | already queued. The caller may retry again later. | |
497 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command. | |
498 | @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA | |
499 | command was not sent, so no additional status information is available. | |
500 | ||
501 | **/ | |
502 | EFI_STATUS | |
503 | EFIAPI | |
504 | AtaPassThruPassThru ( | |
505 | IN EFI_ATA_PASS_THRU_PROTOCOL *This, | |
506 | IN UINT16 Port, | |
507 | IN UINT16 PortMultiplierPort, | |
508 | IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet, | |
509 | IN EFI_EVENT Event OPTIONAL | |
510 | ); | |
511 | ||
512 | /** | |
513 | Used to retrieve the list of legal port numbers for ATA devices on an ATA controller. | |
514 | These can either be the list of ports where ATA devices are actually present or the | |
515 | list of legal port numbers for the ATA controller. Regardless, the caller of this | |
516 | function must probe the port number returned to see if an ATA device is actually | |
517 | present at that location on the ATA controller. | |
518 | ||
519 | The GetNextPort() function retrieves the port number on an ATA controller. If on input | |
520 | Port is 0xFFFF, then the port number of the first port on the ATA controller is returned | |
521 | in Port and EFI_SUCCESS is returned. | |
522 | ||
523 | If Port is a port number that was returned on a previous call to GetNextPort(), then the | |
524 | port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS | |
525 | is returned. If Port is not 0xFFFF and Port was not returned on a previous call to | |
526 | GetNextPort(), then EFI_INVALID_PARAMETER is returned. | |
527 | ||
528 | If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is | |
529 | returned. | |
530 | ||
531 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. | |
532 | @param[in, out] Port On input, a pointer to the port number on the ATA controller. | |
533 | On output, a pointer to the next port number on the ATA | |
534 | controller. An input value of 0xFFFF retrieves the first port | |
535 | number on the ATA controller. | |
536 | ||
537 | @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port. | |
538 | @retval EFI_NOT_FOUND There are no more ports on this ATA controller. | |
539 | @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call | |
540 | to GetNextPort(). | |
541 | ||
542 | **/ | |
543 | EFI_STATUS | |
544 | EFIAPI | |
545 | AtaPassThruGetNextPort ( | |
546 | IN EFI_ATA_PASS_THRU_PROTOCOL *This, | |
547 | IN OUT UINT16 *Port | |
548 | ); | |
549 | ||
550 | /** | |
551 | Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA | |
552 | controller. These can either be the list of port multiplier ports where ATA devices are actually | |
553 | present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this | |
554 | function must probe the port number and port multiplier port number returned to see if an ATA | |
555 | device is actually present. | |
556 | ||
557 | The GetNextDevice() function retrieves the port multiplier port number of an ATA device | |
558 | present on a port of an ATA controller. | |
559 | ||
560 | If PortMultiplierPort points to a port multiplier port number value that was returned on a | |
561 | previous call to GetNextDevice(), then the port multiplier port number of the next ATA device | |
562 | on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is | |
563 | returned. | |
564 | ||
565 | If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first | |
566 | ATA device on port of the ATA controller is returned in PortMultiplierPort and | |
567 | EFI_SUCCESS is returned. | |
568 | ||
569 | If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort | |
570 | was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER | |
571 | is returned. | |
572 | ||
573 | If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of | |
574 | the ATA controller, then EFI_NOT_FOUND is returned. | |
575 | ||
576 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. | |
577 | @param[in] Port The port number present on the ATA controller. | |
578 | @param[in, out] PortMultiplierPort On input, a pointer to the port multiplier port number of an | |
579 | ATA device present on the ATA controller. | |
580 | If on input a PortMultiplierPort of 0xFFFF is specified, | |
581 | then the port multiplier port number of the first ATA device | |
582 | is returned. On output, a pointer to the port multiplier port | |
583 | number of the next ATA device present on an ATA controller. | |
584 | ||
585 | @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port | |
586 | of the ATA controller was returned in PortMultiplierPort. | |
587 | @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller. | |
588 | @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not | |
589 | returned on a previous call to GetNextDevice(). | |
590 | ||
591 | **/ | |
592 | EFI_STATUS | |
593 | EFIAPI | |
594 | AtaPassThruGetNextDevice ( | |
595 | IN EFI_ATA_PASS_THRU_PROTOCOL *This, | |
596 | IN UINT16 Port, | |
597 | IN OUT UINT16 *PortMultiplierPort | |
598 | ); | |
599 | ||
600 | /** | |
601 | Used to allocate and build a device path node for an ATA device on an ATA controller. | |
602 | ||
603 | The BuildDevicePath() function allocates and builds a single device node for the ATA | |
604 | device specified by Port and PortMultiplierPort. If the ATA device specified by Port and | |
605 | PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned. | |
606 | If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough | |
607 | resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned. | |
608 | ||
609 | Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of | |
610 | DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort, | |
611 | and EFI_SUCCESS is returned. | |
612 | ||
613 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. | |
614 | @param[in] Port Port specifies the port number of the ATA device for which a | |
615 | device path node is to be allocated and built. | |
616 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a | |
617 | device path node is to be allocated and built. If there is no | |
618 | port multiplier, then specify 0. | |
619 | @param[in, out] DevicePath A pointer to a single device path node that describes the ATA | |
620 | device specified by Port and PortMultiplierPort. This function | |
621 | is responsible for allocating the buffer DevicePath with the | |
622 | boot service AllocatePool(). It is the caller's responsibility | |
623 | to free DevicePath when the caller is finished with DevicePath. | |
624 | @retval EFI_SUCCESS The device path node that describes the ATA device specified by | |
625 | Port and PortMultiplierPort was allocated and returned in DevicePath. | |
626 | @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not | |
627 | exist on the ATA controller. | |
628 | @retval EFI_INVALID_PARAMETER DevicePath is NULL. | |
629 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath. | |
630 | ||
631 | **/ | |
632 | EFI_STATUS | |
633 | EFIAPI | |
634 | AtaPassThruBuildDevicePath ( | |
635 | IN EFI_ATA_PASS_THRU_PROTOCOL *This, | |
636 | IN UINT16 Port, | |
637 | IN UINT16 PortMultiplierPort, | |
638 | IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath | |
639 | ); | |
640 | ||
641 | /** | |
642 | Used to translate a device path node to a port number and port multiplier port number. | |
643 | ||
644 | The GetDevice() function determines the port and port multiplier port number associated with | |
645 | the ATA device described by DevicePath. If DevicePath is a device path node type that the | |
646 | ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents | |
647 | DevicePath into a port number and port multiplier port number. | |
648 | ||
649 | If this translation is successful, then that port number and port multiplier port number are returned | |
650 | in Port and PortMultiplierPort, and EFI_SUCCESS is returned. | |
651 | ||
652 | If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned. | |
653 | ||
654 | If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then | |
655 | EFI_UNSUPPORTED is returned. | |
656 | ||
657 | If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not | |
658 | a valid translation from DevicePath to a port number and port multiplier port number, then | |
659 | EFI_NOT_FOUND is returned. | |
660 | ||
661 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. | |
662 | @param[in] DevicePath A pointer to the device path node that describes an ATA device on the | |
663 | ATA controller. | |
664 | @param[out] Port On return, points to the port number of an ATA device on the ATA controller. | |
665 | @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device | |
666 | on the ATA controller. | |
667 | ||
668 | @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier | |
669 | port number, and they were returned in Port and PortMultiplierPort. | |
670 | @retval EFI_INVALID_PARAMETER DevicePath is NULL. | |
671 | @retval EFI_INVALID_PARAMETER Port is NULL. | |
672 | @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL. | |
673 | @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath. | |
674 | @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier | |
675 | port number does not exist. | |
676 | **/ | |
677 | EFI_STATUS | |
678 | EFIAPI | |
679 | AtaPassThruGetDevice ( | |
680 | IN EFI_ATA_PASS_THRU_PROTOCOL *This, | |
681 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, | |
682 | OUT UINT16 *Port, | |
683 | OUT UINT16 *PortMultiplierPort | |
684 | ); | |
685 | ||
686 | /** | |
687 | Resets a specific port on the ATA controller. This operation also resets all the ATA devices | |
688 | connected to the port. | |
689 | ||
690 | The ResetChannel() function resets an a specific port on an ATA controller. This operation | |
691 | resets all the ATA devices connected to that port. If this ATA controller does not support | |
692 | a reset port operation, then EFI_UNSUPPORTED is returned. | |
693 | ||
694 | If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is | |
695 | returned. | |
696 | ||
697 | If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned. | |
698 | ||
699 | If the port reset operation is completed, then EFI_SUCCESS is returned. | |
700 | ||
701 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. | |
702 | @param[in] Port The port number on the ATA controller. | |
703 | ||
704 | @retval EFI_SUCCESS The ATA controller port was reset. | |
705 | @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation. | |
706 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port. | |
707 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port. | |
708 | ||
709 | **/ | |
710 | EFI_STATUS | |
711 | EFIAPI | |
712 | AtaPassThruResetPort ( | |
713 | IN EFI_ATA_PASS_THRU_PROTOCOL *This, | |
714 | IN UINT16 Port | |
715 | ); | |
716 | ||
717 | /** | |
718 | Resets an ATA device that is connected to an ATA controller. | |
719 | ||
720 | The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort. | |
721 | If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is | |
722 | returned. | |
723 | ||
724 | If Port or PortMultiplierPort are not in a valid range for this ATA controller, then | |
725 | EFI_INVALID_PARAMETER is returned. | |
726 | ||
727 | If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR | |
728 | is returned. | |
729 | ||
730 | If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is | |
731 | returned. | |
732 | ||
733 | If the device reset operation is completed, then EFI_SUCCESS is returned. | |
734 | ||
735 | @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. | |
736 | @param[in] Port Port represents the port number of the ATA device to be reset. | |
737 | @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset. | |
738 | If there is no port multiplier, then specify 0. | |
739 | @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset. | |
740 | @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation. | |
741 | @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid. | |
742 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device | |
743 | specified by Port and PortMultiplierPort. | |
744 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device | |
745 | specified by Port and PortMultiplierPort. | |
746 | ||
747 | **/ | |
748 | EFI_STATUS | |
749 | EFIAPI | |
750 | AtaPassThruResetDevice ( | |
751 | IN EFI_ATA_PASS_THRU_PROTOCOL *This, | |
752 | IN UINT16 Port, | |
753 | IN UINT16 PortMultiplierPort | |
754 | ); | |
755 | ||
756 | /** | |
757 | Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function | |
758 | supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the | |
759 | nonblocking I/O functionality is optional. | |
760 | ||
761 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance. | |
762 | @param Target The Target is an array of size TARGET_MAX_BYTES and it represents | |
763 | the id of the SCSI device to send the SCSI Request Packet. Each | |
764 | transport driver may choose to utilize a subset of this size to suit the needs | |
765 | of transport target representation. For example, a Fibre Channel driver | |
766 | may use only 8 bytes (WWN) to represent an FC target. | |
767 | @param Lun The LUN of the SCSI device to send the SCSI Request Packet. | |
768 | @param Packet A pointer to the SCSI Request Packet to send to the SCSI device | |
769 | specified by Target and Lun. | |
770 | @param Event If nonblocking I/O is not supported then Event is ignored, and blocking | |
771 | I/O is performed. If Event is NULL, then blocking I/O is performed. If | |
772 | Event is not NULL and non blocking I/O is supported, then | |
773 | nonblocking I/O is performed, and Event will be signaled when the | |
774 | SCSI Request Packet completes. | |
775 | ||
776 | @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional | |
777 | commands, InTransferLength bytes were transferred from | |
778 | InDataBuffer. For write and bi-directional commands, | |
779 | OutTransferLength bytes were transferred by | |
780 | OutDataBuffer. | |
781 | @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that | |
782 | could be transferred is returned in InTransferLength. For write | |
783 | and bi-directional commands, OutTransferLength bytes were | |
784 | transferred by OutDataBuffer. | |
785 | @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many | |
786 | SCSI Request Packets already queued. The caller may retry again later. | |
787 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request | |
788 | Packet. | |
789 | @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid. | |
790 | @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported | |
791 | by the host adapter. This includes the case of Bi-directional SCSI | |
792 | commands not supported by the implementation. The SCSI Request | |
793 | Packet was not sent, so no additional status information is available. | |
794 | @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. | |
795 | ||
796 | **/ | |
797 | EFI_STATUS | |
798 | EFIAPI | |
799 | ExtScsiPassThruPassThru ( | |
800 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, | |
801 | IN UINT8 *Target, | |
802 | IN UINT64 Lun, | |
803 | IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet, | |
804 | IN EFI_EVENT Event OPTIONAL | |
805 | ); | |
806 | ||
807 | /** | |
808 | Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These | |
809 | can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal | |
810 | Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the | |
811 | Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI | |
812 | channel. | |
813 | ||
814 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance. | |
815 | @param Target On input, a pointer to the Target ID (an array of size | |
816 | TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel. | |
817 | On output, a pointer to the Target ID (an array of | |
818 | TARGET_MAX_BYTES) of the next SCSI device present on a SCSI | |
819 | channel. An input value of 0xF(all bytes in the array are 0xF) in the | |
820 | Target array retrieves the Target ID of the first SCSI device present on a | |
821 | SCSI channel. | |
822 | @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI | |
823 | channel. On output, a pointer to the LUN of the next SCSI device present | |
824 | on a SCSI channel. | |
825 | ||
826 | @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI | |
827 | channel was returned in Target and Lun. | |
828 | @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were | |
829 | not returned on a previous call to GetNextTargetLun(). | |
830 | @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel. | |
831 | ||
832 | **/ | |
833 | EFI_STATUS | |
834 | EFIAPI | |
835 | ExtScsiPassThruGetNextTargetLun ( | |
836 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, | |
837 | IN OUT UINT8 **Target, | |
838 | IN OUT UINT64 *Lun | |
839 | ); | |
840 | ||
841 | /** | |
842 | Used to allocate and build a device path node for a SCSI device on a SCSI channel. | |
843 | ||
844 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance. | |
845 | @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the | |
846 | Target ID of the SCSI device for which a device path node is to be | |
847 | allocated and built. Transport drivers may chose to utilize a subset of | |
848 | this size to suit the representation of targets. For example, a Fibre | |
849 | Channel driver may use only 8 bytes (WWN) in the array to represent a | |
850 | FC target. | |
851 | @param Lun The LUN of the SCSI device for which a device path node is to be | |
852 | allocated and built. | |
853 | @param DevicePath A pointer to a single device path node that describes the SCSI device | |
854 | specified by Target and Lun. This function is responsible for | |
855 | allocating the buffer DevicePath with the boot service | |
856 | AllocatePool(). It is the caller's responsibility to free | |
857 | DevicePath when the caller is finished with DevicePath. | |
858 | ||
859 | @retval EFI_SUCCESS The device path node that describes the SCSI device specified by | |
860 | Target and Lun was allocated and returned in | |
861 | DevicePath. | |
862 | @retval EFI_INVALID_PARAMETER DevicePath is NULL. | |
863 | @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist | |
864 | on the SCSI channel. | |
865 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath. | |
866 | ||
867 | **/ | |
868 | EFI_STATUS | |
869 | EFIAPI | |
870 | ExtScsiPassThruBuildDevicePath ( | |
871 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, | |
872 | IN UINT8 *Target, | |
873 | IN UINT64 Lun, | |
874 | IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath | |
875 | ); | |
876 | ||
877 | /** | |
878 | Used to translate a device path node to a Target ID and LUN. | |
879 | ||
880 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance. | |
881 | @param DevicePath A pointer to a single device path node that describes the SCSI device | |
882 | on the SCSI channel. | |
883 | @param Target A pointer to the Target Array which represents the ID of a SCSI device | |
884 | on the SCSI channel. | |
885 | @param Lun A pointer to the LUN of a SCSI device on the SCSI channel. | |
886 | ||
887 | @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and | |
888 | LUN, and they were returned in Target and Lun. | |
889 | @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL. | |
890 | @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN | |
891 | does not exist. | |
892 | @retval EFI_UNSUPPORTED This driver does not support the device path node type in | |
893 | DevicePath. | |
894 | ||
895 | **/ | |
896 | EFI_STATUS | |
897 | EFIAPI | |
898 | ExtScsiPassThruGetTargetLun ( | |
899 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, | |
900 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, | |
901 | OUT UINT8 **Target, | |
902 | OUT UINT64 *Lun | |
903 | ); | |
904 | ||
905 | /** | |
906 | Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel. | |
907 | ||
908 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance. | |
909 | ||
910 | @retval EFI_SUCCESS The SCSI channel was reset. | |
911 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel. | |
912 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel. | |
913 | @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation. | |
914 | ||
915 | **/ | |
916 | EFI_STATUS | |
917 | EFIAPI | |
918 | ExtScsiPassThruResetChannel ( | |
919 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This | |
920 | ); | |
921 | ||
922 | /** | |
923 | Resets a SCSI logical unit that is connected to a SCSI channel. | |
924 | ||
925 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance. | |
926 | @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the | |
927 | target port ID of the SCSI device containing the SCSI logical unit to | |
928 | reset. Transport drivers may chose to utilize a subset of this array to suit | |
929 | the representation of their targets. | |
930 | @param Lun The LUN of the SCSI device to reset. | |
931 | ||
932 | @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset. | |
933 | @retval EFI_INVALID_PARAMETER Target or Lun is NULL. | |
934 | @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device | |
935 | specified by Target and Lun. | |
936 | @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation. | |
937 | @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device | |
938 | specified by Target and Lun. | |
939 | ||
940 | **/ | |
941 | EFI_STATUS | |
942 | EFIAPI | |
943 | ExtScsiPassThruResetTargetLun ( | |
944 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, | |
945 | IN UINT8 *Target, | |
946 | IN UINT64 Lun | |
947 | ); | |
948 | ||
949 | /** | |
950 | Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either | |
951 | be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs | |
952 | for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to | |
953 | see if a SCSI device is actually present at that location on the SCSI channel. | |
954 | ||
955 | @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance. | |
956 | @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel. | |
957 | On output, a pointer to the Target ID (an array of | |
958 | TARGET_MAX_BYTES) of the next SCSI device present on a SCSI | |
959 | channel. An input value of 0xF(all bytes in the array are 0xF) in the | |
960 | Target array retrieves the Target ID of the first SCSI device present on a | |
961 | SCSI channel. | |
962 | ||
963 | @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI | |
964 | channel was returned in Target. | |
965 | @retval EFI_INVALID_PARAMETER Target or Lun is NULL. | |
966 | @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not | |
967 | returned on a previous call to GetNextTarget(). | |
968 | @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel. | |
969 | ||
970 | **/ | |
971 | EFI_STATUS | |
972 | EFIAPI | |
973 | ExtScsiPassThruGetNextTarget ( | |
974 | IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This, | |
975 | IN OUT UINT8 **Target | |
976 | ); | |
977 | ||
978 | /** | |
979 | Initialize ATA host controller at IDE mode. | |
980 | ||
981 | The function is designed to initialize ATA host controller. | |
982 | ||
983 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. | |
984 | ||
985 | **/ | |
986 | EFI_STATUS | |
987 | EFIAPI | |
988 | IdeModeInitialization ( | |
989 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance | |
990 | ); | |
991 | ||
992 | /** | |
993 | Initialize ATA host controller at AHCI mode. | |
994 | ||
995 | The function is designed to initialize ATA host controller. | |
996 | ||
997 | @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance. | |
998 | ||
999 | **/ | |
1000 | EFI_STATUS | |
1001 | EFIAPI | |
1002 | AhciModeInitialization ( | |
1003 | IN ATA_ATAPI_PASS_THRU_INSTANCE *Instance | |
1004 | ); | |
1005 | ||
1006 | #endif | |
1007 |