1a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten/** @file
2a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  Header file for IDE controller driver.
3a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
469cb32fca2d916a9a6a0ff6efec57a9e0aaf18cfniruiyu  Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
53ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  This program and the accompanying materials
63ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  are licensed and made available under the terms and conditions of the BSD License
73ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  which accompanies this distribution.  The full text of the license may be found at
83ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  http://opensource.org/licenses/bsd-license.php
9a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
103ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
113ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
13a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten**/
14a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
1524115e44926b33c763f81026690f20efd913daf2ydong#ifndef _IDE_CONTROLLER_H_
1624115e44926b33c763f81026690f20efd913daf2ydong#define _IDE_CONTROLLER_H_
17a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
18a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Uefi.h>
19a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Protocol/ComponentName.h>
20a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Protocol/DriverBinding.h>
21a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Protocol/PciIo.h>
22a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Protocol/IdeControllerInit.h>
23a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Library/UefiDriverEntryPoint.h>
24a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Library/DebugLib.h>
25a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Library/UefiLib.h>
26a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Library/BaseLib.h>
27a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Library/BaseMemoryLib.h>
28a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Library/MemoryAllocationLib.h>
29a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <Library/UefiBootServicesTableLib.h>
30a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#include <IndustryStandard/Pci.h>
31a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
32a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
33a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten// Global Variables definitions
34a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
35a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenextern EFI_DRIVER_BINDING_PROTOCOL  gIdeControllerDriverBinding;
36a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenextern EFI_COMPONENT_NAME_PROTOCOL  gIdeControllerComponentName;
37a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenextern EFI_COMPONENT_NAME2_PROTOCOL gIdeControllerComponentName2;
38a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
393ea80ba2e4ae19eb564173e203d7bab00055ff56darylm///
403ea80ba2e4ae19eb564173e203d7bab00055ff56darylm/// Supports 2 channel max
413ea80ba2e4ae19eb564173e203d7bab00055ff56darylm///
42a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#define ICH_IDE_MAX_CHANNEL 0x02
433ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
443ea80ba2e4ae19eb564173e203d7bab00055ff56darylm///
453ea80ba2e4ae19eb564173e203d7bab00055ff56darylm/// Supports 2 devices max
463ea80ba2e4ae19eb564173e203d7bab00055ff56darylm///
47a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#define ICH_IDE_MAX_DEVICES 0x02
48a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#define ICH_IDE_ENUMER_ALL  FALSE
49a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
50a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
51a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten// Driver binding functions declaration
52a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
5320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
5420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  Register Driver Binding protocol for this driver.
5520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu
5620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param This                   A pointer points to the Binding Protocol instance
573ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  @param Controller             The handle of controller to be tested.
5820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param RemainingDevicePath    A pointer to the device path. Ignored by device
5920c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                driver but used by bus driver
603ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
613ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  @retval EFI_SUCCESS           Driver loaded.
623ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  @retval !EFI_SUCESS           Driver not loaded.
6320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
64a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
65a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
66a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeControllerSupported (
67a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN EFI_DRIVER_BINDING_PROTOCOL       *This,
68a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN EFI_HANDLE                        Controller,
69a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN EFI_DEVICE_PATH_PROTOCOL          *RemainingDevicePath
70a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
71a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
72a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
7320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
743ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  This routine is called right after the .Supported() called and return
7520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  EFI_SUCCESS. Notes: The supported protocols are checked but the Protocols
763ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  are closed.
7720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu
7820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param This                   A pointer points to the Binding Protocol instance
7920c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param Controller             The handle of controller to be tested. Parameter
8020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                passed by the caller
8120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param RemainingDevicePath    A pointer to the device path. Should be ignored by
8220c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                device driver
833ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
8420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @return EFI_STATUS            Status of InstallMultipleProtocolInterfaces()
8520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
86a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
87a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
88a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeControllerStart (
89a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN EFI_DRIVER_BINDING_PROTOCOL        *This,
90a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN EFI_HANDLE                         Controller,
91a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN EFI_DEVICE_PATH_PROTOCOL           *RemainingDevicePath
92a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
93a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
94a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
9520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
963ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  Stop this driver on Controller Handle.
9720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu
9820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param This               Protocol instance pointer.
993ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  @param Controller         Handle of device to stop driver on
10020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param NumberOfChildren   Not used
10120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param ChildHandleBuffer  Not used
1023ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
1033ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  @retval EFI_SUCESS        This driver is removed DeviceHandle
1043ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  @retval !EFI_SUCCESS      This driver was not removed from this device
10520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
106a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
107a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
108a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeControllerStop (
109a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_DRIVER_BINDING_PROTOCOL       *This,
110a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_HANDLE                        Controller,
111a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINTN                             NumberOfChildren,
112a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_HANDLE                        *ChildHandleBuffer
113a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
114a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
115a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
116a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
117a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten// IDE controller init functions declaration
118a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
11920c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
12095717b94954923b12bda6091278047b7735cb56berictian  Returns the information about the specified IDE channel.
12195717b94954923b12bda6091278047b7735cb56berictian
12295717b94954923b12bda6091278047b7735cb56berictian  This function can be used to obtain information about a particular IDE channel.
12395717b94954923b12bda6091278047b7735cb56berictian  The driver entity uses this information during the enumeration process.
12495717b94954923b12bda6091278047b7735cb56berictian
12595717b94954923b12bda6091278047b7735cb56berictian  If Enabled is set to FALSE, the driver entity will not scan the channel. Note
12695717b94954923b12bda6091278047b7735cb56berictian  that it will not prevent an operating system driver from scanning the channel.
12795717b94954923b12bda6091278047b7735cb56berictian
12895717b94954923b12bda6091278047b7735cb56berictian  For most of today's controllers, MaxDevices will either be 1 or 2. For SATA
12995717b94954923b12bda6091278047b7735cb56berictian  controllers, this value will always be 1. SATA configurations can contain SATA
13095717b94954923b12bda6091278047b7735cb56berictian  port multipliers. SATA port multipliers behave like SATA bridges and can support
13195717b94954923b12bda6091278047b7735cb56berictian  up to 16 devices on the other side. If a SATA port out of the IDE controller
13295717b94954923b12bda6091278047b7735cb56berictian  is connected to a port multiplier, MaxDevices will be set to the number of SATA
13395717b94954923b12bda6091278047b7735cb56berictian  devices that the port multiplier supports. Because today's port multipliers
13495717b94954923b12bda6091278047b7735cb56berictian  support up to fifteen SATA devices, this number can be as large as fifteen. The IDE
13595717b94954923b12bda6091278047b7735cb56berictian  bus driver is required to scan for the presence of port multipliers behind an SATA
13695717b94954923b12bda6091278047b7735cb56berictian  controller and enumerate up to MaxDevices number of devices behind the port
13795717b94954923b12bda6091278047b7735cb56berictian  multiplier.
13895717b94954923b12bda6091278047b7735cb56berictian
13995717b94954923b12bda6091278047b7735cb56berictian  In this context, the devices behind a port multiplier constitute a channel.
14095717b94954923b12bda6091278047b7735cb56berictian
14195717b94954923b12bda6091278047b7735cb56berictian  @param[in]  This         The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
14295717b94954923b12bda6091278047b7735cb56berictian  @param[in]  Channel      Zero-based channel number.
14395717b94954923b12bda6091278047b7735cb56berictian  @param[out] Enabled      TRUE if this channel is enabled.  Disabled channels
14495717b94954923b12bda6091278047b7735cb56berictian                           are not scanned to see if any devices are present.
14595717b94954923b12bda6091278047b7735cb56berictian  @param[out] MaxDevices   The maximum number of IDE devices that the bus driver
14695717b94954923b12bda6091278047b7735cb56berictian                           can expect on this channel.  For the ATA/ATAPI
14795717b94954923b12bda6091278047b7735cb56berictian                           specification, version 6, this number will either be
14895717b94954923b12bda6091278047b7735cb56berictian                           one or two. For Serial ATA (SATA) configurations with a
14995717b94954923b12bda6091278047b7735cb56berictian                           port multiplier, this number can be as large as fifteen.
15095717b94954923b12bda6091278047b7735cb56berictian
15195717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_SUCCESS             Information was returned without any errors.
15295717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Channel is invalid (Channel >= ChannelCount).
15395717b94954923b12bda6091278047b7735cb56berictian
15420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
155a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
156a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
157a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeInitGetChannelInfo (
158a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN   EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
159a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN   UINT8                            Channel,
160a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  OUT  BOOLEAN                          *Enabled,
161a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  OUT  UINT8                            *MaxDevices
162a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
163a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
164a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
16520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
16695717b94954923b12bda6091278047b7735cb56berictian  The notifications from the driver entity that it is about to enter a certain
16795717b94954923b12bda6091278047b7735cb56berictian  phase of the IDE channel enumeration process.
16895717b94954923b12bda6091278047b7735cb56berictian
16995717b94954923b12bda6091278047b7735cb56berictian  This function can be used to notify the IDE controller driver to perform
17095717b94954923b12bda6091278047b7735cb56berictian  specific actions, including any chipset-specific initialization, so that the
17195717b94954923b12bda6091278047b7735cb56berictian  chipset is ready to enter the next phase. Seven notification points are defined
17295717b94954923b12bda6091278047b7735cb56berictian  at this time.
17395717b94954923b12bda6091278047b7735cb56berictian
17495717b94954923b12bda6091278047b7735cb56berictian  More synchronization points may be added as required in the future.
17595717b94954923b12bda6091278047b7735cb56berictian
17695717b94954923b12bda6091278047b7735cb56berictian  @param[in] This      The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
17795717b94954923b12bda6091278047b7735cb56berictian  @param[in] Phase     The phase during enumeration.
17895717b94954923b12bda6091278047b7735cb56berictian  @param[in] Channel   Zero-based channel number.
17995717b94954923b12bda6091278047b7735cb56berictian
18095717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_SUCCESS             The notification was accepted without any errors.
18195717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_UNSUPPORTED         Phase is not supported.
18295717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Channel is invalid (Channel >= ChannelCount).
18395717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_NOT_READY           This phase cannot be entered at this time; for
18495717b94954923b12bda6091278047b7735cb56berictian                                  example, an attempt was made to enter a Phase
18595717b94954923b12bda6091278047b7735cb56berictian                                  without having entered one or more previous
18695717b94954923b12bda6091278047b7735cb56berictian                                  Phase.
1873ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
18820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
189a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
190a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
191a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeInitNotifyPhase (
192a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_IDE_CONTROLLER_INIT_PROTOCOL  *This,
193a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_IDE_CONTROLLER_ENUM_PHASE     Phase,
19424115e44926b33c763f81026690f20efd913daf2ydong  IN  UINT8                             Channel
195a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
196a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
197a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
19820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
19995717b94954923b12bda6091278047b7735cb56berictian  Submits the device information to the IDE controller driver.
20095717b94954923b12bda6091278047b7735cb56berictian
20195717b94954923b12bda6091278047b7735cb56berictian  This function is used by the driver entity to pass detailed information about
20295717b94954923b12bda6091278047b7735cb56berictian  a particular device to the IDE controller driver. The driver entity obtains
20395717b94954923b12bda6091278047b7735cb56berictian  this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. IdentifyData
20495717b94954923b12bda6091278047b7735cb56berictian  is the pointer to the response data buffer. The IdentifyData buffer is owned
20595717b94954923b12bda6091278047b7735cb56berictian  by the driver entity, and the IDE controller driver must make a local copy
20695717b94954923b12bda6091278047b7735cb56berictian  of the entire buffer or parts of the buffer as needed. The original IdentifyData
20795717b94954923b12bda6091278047b7735cb56berictian  buffer pointer may not be valid when
20895717b94954923b12bda6091278047b7735cb56berictian
20995717b94954923b12bda6091278047b7735cb56berictian    - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or
21095717b94954923b12bda6091278047b7735cb56berictian    - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a later point.
21195717b94954923b12bda6091278047b7735cb56berictian
21295717b94954923b12bda6091278047b7735cb56berictian  The IDE controller driver may consult various fields of EFI_IDENTIFY_DATA to
21395717b94954923b12bda6091278047b7735cb56berictian  compute the optimum mode for the device. These fields are not limited to the
21495717b94954923b12bda6091278047b7735cb56berictian  timing information. For example, an implementation of the IDE controller driver
21595717b94954923b12bda6091278047b7735cb56berictian  may examine the vendor and type/mode field to match known bad drives.
21695717b94954923b12bda6091278047b7735cb56berictian
21795717b94954923b12bda6091278047b7735cb56berictian  The driver entity may submit drive information in any order, as long as it
21895717b94954923b12bda6091278047b7735cb56berictian  submits information for all the devices belonging to the enumeration group
21995717b94954923b12bda6091278047b7735cb56berictian  before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for any device
22095717b94954923b12bda6091278047b7735cb56berictian  in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
22195717b94954923b12bda6091278047b7735cb56berictian  should be called with IdentifyData set to NULL.  The IDE controller driver may
22295717b94954923b12bda6091278047b7735cb56berictian  not have any other mechanism to know whether a device is present or not. Therefore,
22395717b94954923b12bda6091278047b7735cb56berictian  setting IdentifyData to NULL does not constitute an error condition.
22495717b94954923b12bda6091278047b7735cb56berictian  EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once for a
22595717b94954923b12bda6091278047b7735cb56berictian  given (Channel, Device) pair.
22695717b94954923b12bda6091278047b7735cb56berictian
22795717b94954923b12bda6091278047b7735cb56berictian  @param[in] This           A pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
22895717b94954923b12bda6091278047b7735cb56berictian  @param[in] Channel        Zero-based channel number.
22995717b94954923b12bda6091278047b7735cb56berictian  @param[in] Device         Zero-based device number on the Channel.
23095717b94954923b12bda6091278047b7735cb56berictian  @param[in] IdentifyData   The device's response to the ATA IDENTIFY_DEVICE command.
23195717b94954923b12bda6091278047b7735cb56berictian
23295717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_SUCCESS             The information was accepted without any errors.
23395717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Channel is invalid (Channel >= ChannelCount).
23495717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Device is invalid.
23520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu
23620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
237a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
238a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
239a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeInitSubmitData (
240a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_IDE_CONTROLLER_INIT_PROTOCOL  *This,
241a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Channel,
242a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Device,
243a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_IDENTIFY_DATA                 *IdentifyData
244a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
245a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
246a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
24720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
24895717b94954923b12bda6091278047b7735cb56berictian  Disqualifies specific modes for an IDE device.
24995717b94954923b12bda6091278047b7735cb56berictian
25095717b94954923b12bda6091278047b7735cb56berictian  This function allows the driver entity or other drivers (such as platform
25195717b94954923b12bda6091278047b7735cb56berictian  drivers) to reject certain timing modes and request the IDE controller driver
25295717b94954923b12bda6091278047b7735cb56berictian  to recalculate modes. This function allows the driver entity and the IDE
25395717b94954923b12bda6091278047b7735cb56berictian  controller driver to negotiate the timings on a per-device basis. This function
25495717b94954923b12bda6091278047b7735cb56berictian  is useful in the case of drives that lie about their capabilities. An example
25595717b94954923b12bda6091278047b7735cb56berictian  is when the IDE device fails to accept the timing modes that are calculated
25695717b94954923b12bda6091278047b7735cb56berictian  by the IDE controller driver based on the response to the Identify Drive command.
25795717b94954923b12bda6091278047b7735cb56berictian
25895717b94954923b12bda6091278047b7735cb56berictian  If the driver entity does not want to limit the ATA timing modes and leave that
25995717b94954923b12bda6091278047b7735cb56berictian  decision to the IDE controller driver, it can either not call this function for
26095717b94954923b12bda6091278047b7735cb56berictian  the given device or call this function and set the Valid flag to FALSE for all
26195717b94954923b12bda6091278047b7735cb56berictian  modes that are listed in EFI_ATA_COLLECTIVE_MODE.
26295717b94954923b12bda6091278047b7735cb56berictian
26395717b94954923b12bda6091278047b7735cb56berictian  The driver entity may disqualify modes for a device in any order and any number
26495717b94954923b12bda6091278047b7735cb56berictian  of times.
26595717b94954923b12bda6091278047b7735cb56berictian
26695717b94954923b12bda6091278047b7735cb56berictian  This function can be called multiple times to invalidate multiple modes of the
26795717b94954923b12bda6091278047b7735cb56berictian  same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the ATA/ATAPI
26895717b94954923b12bda6091278047b7735cb56berictian  specification for more information on PIO modes.
26995717b94954923b12bda6091278047b7735cb56berictian
27095717b94954923b12bda6091278047b7735cb56berictian  For Serial ATA (SATA) controllers, this member function can be used to disqualify
27195717b94954923b12bda6091278047b7735cb56berictian  a higher transfer rate mode on a given channel. For example, a platform driver
27295717b94954923b12bda6091278047b7735cb56berictian  may inform the IDE controller driver to not use second-generation (Gen2) speeds
27395717b94954923b12bda6091278047b7735cb56berictian  for a certain SATA drive.
27495717b94954923b12bda6091278047b7735cb56berictian
27595717b94954923b12bda6091278047b7735cb56berictian  @param[in] This       The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
27695717b94954923b12bda6091278047b7735cb56berictian  @param[in] Channel    The zero-based channel number.
27795717b94954923b12bda6091278047b7735cb56berictian  @param[in] Device     The zero-based device number on the Channel.
27895717b94954923b12bda6091278047b7735cb56berictian  @param[in] BadModes   The modes that the device does not support and that
27995717b94954923b12bda6091278047b7735cb56berictian                        should be disqualified.
28095717b94954923b12bda6091278047b7735cb56berictian
28195717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_SUCCESS             The modes were accepted without any errors.
28295717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Channel is invalid (Channel >= ChannelCount).
28395717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Device is invalid.
28495717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   IdentifyData is NULL.
28595717b94954923b12bda6091278047b7735cb56berictian
28620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
287a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
288a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
289a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeInitDisqualifyMode (
290a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_IDE_CONTROLLER_INIT_PROTOCOL  *This,
291a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Channel,
292a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Device,
293a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_ATA_COLLECTIVE_MODE           *BadModes
294a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
295a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
296a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
29720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
29895717b94954923b12bda6091278047b7735cb56berictian  Returns the information about the optimum modes for the specified IDE device.
29995717b94954923b12bda6091278047b7735cb56berictian
30095717b94954923b12bda6091278047b7735cb56berictian  This function is used by the driver entity to obtain the optimum ATA modes for
30195717b94954923b12bda6091278047b7735cb56berictian  a specific device.  The IDE controller driver takes into account the following
30295717b94954923b12bda6091278047b7735cb56berictian  while calculating the mode:
30395717b94954923b12bda6091278047b7735cb56berictian    - The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
30495717b94954923b12bda6091278047b7735cb56berictian    - The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode()
30595717b94954923b12bda6091278047b7735cb56berictian
30695717b94954923b12bda6091278047b7735cb56berictian  The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
30795717b94954923b12bda6091278047b7735cb56berictian  for all the devices that belong to an enumeration group before calling
30895717b94954923b12bda6091278047b7735cb56berictian  EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the same group.
30995717b94954923b12bda6091278047b7735cb56berictian
31095717b94954923b12bda6091278047b7735cb56berictian  The IDE controller driver will use controller- and possibly platform-specific
31195717b94954923b12bda6091278047b7735cb56berictian  algorithms to arrive at SupportedModes.  The IDE controller may base its
31295717b94954923b12bda6091278047b7735cb56berictian  decision on user preferences and other considerations as well. This function
31395717b94954923b12bda6091278047b7735cb56berictian  may be called multiple times because the driver entity may renegotiate the mode
31495717b94954923b12bda6091278047b7735cb56berictian  with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode().
31595717b94954923b12bda6091278047b7735cb56berictian
31695717b94954923b12bda6091278047b7735cb56berictian  The driver entity may collect timing information for various devices in any
31795717b94954923b12bda6091278047b7735cb56berictian  order. The driver entity is responsible for making sure that all the dependencies
31895717b94954923b12bda6091278047b7735cb56berictian  are satisfied. For example, the SupportedModes information for device A that
31995717b94954923b12bda6091278047b7735cb56berictian  was previously returned may become stale after a call to
32095717b94954923b12bda6091278047b7735cb56berictian  EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B.
32195717b94954923b12bda6091278047b7735cb56berictian
32295717b94954923b12bda6091278047b7735cb56berictian  The buffer SupportedModes is allocated by the callee because the caller does
32395717b94954923b12bda6091278047b7735cb56berictian  not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE_MODE
32495717b94954923b12bda6091278047b7735cb56berictian  is defined in a way that allows for future extensibility and can be of variable
32595717b94954923b12bda6091278047b7735cb56berictian  length. This memory pool should be deallocated by the caller when it is no
32695717b94954923b12bda6091278047b7735cb56berictian  longer necessary.
32795717b94954923b12bda6091278047b7735cb56berictian
32895717b94954923b12bda6091278047b7735cb56berictian  The IDE controller driver for a Serial ATA (SATA) controller can use this
32995717b94954923b12bda6091278047b7735cb56berictian  member function to force a lower speed (first-generation [Gen1] speeds on a
33095717b94954923b12bda6091278047b7735cb56berictian  second-generation [Gen2]-capable hardware).  The IDE controller driver can
33195717b94954923b12bda6091278047b7735cb56berictian  also allow the driver entity to stay with the speed that has been negotiated
33295717b94954923b12bda6091278047b7735cb56berictian  by the physical layer.
33395717b94954923b12bda6091278047b7735cb56berictian
33495717b94954923b12bda6091278047b7735cb56berictian  @param[in]  This             The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
33595717b94954923b12bda6091278047b7735cb56berictian  @param[in]  Channel          A zero-based channel number.
33695717b94954923b12bda6091278047b7735cb56berictian  @param[in]  Device           A zero-based device number on the Channel.
33795717b94954923b12bda6091278047b7735cb56berictian  @param[out] SupportedModes   The optimum modes for the device.
33895717b94954923b12bda6091278047b7735cb56berictian
33995717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_SUCCESS             SupportedModes was returned.
34095717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Channel is invalid (Channel >= ChannelCount).
34195717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Device is invalid.
34295717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   SupportedModes is NULL.
34395717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_NOT_READY           Modes cannot be calculated due to a lack of
34495717b94954923b12bda6091278047b7735cb56berictian                                  data.  This error may happen if
34595717b94954923b12bda6091278047b7735cb56berictian                                  EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData()
34695717b94954923b12bda6091278047b7735cb56berictian                                  and EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyData()
34795717b94954923b12bda6091278047b7735cb56berictian                                  were not called for at least one drive in the
34895717b94954923b12bda6091278047b7735cb56berictian                                  same enumeration group.
3493ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
35020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
351a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
352a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
353a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeInitCalculateMode (
354a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_IDE_CONTROLLER_INIT_PROTOCOL  *This,
355a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Channel,
356a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Device,
35724115e44926b33c763f81026690f20efd913daf2ydong  OUT EFI_ATA_COLLECTIVE_MODE           **SupportedModes
358a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
359a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
360a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
36120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
36295717b94954923b12bda6091278047b7735cb56berictian  Commands the IDE controller driver to program the IDE controller hardware
36395717b94954923b12bda6091278047b7735cb56berictian  so that the specified device can operate at the specified mode.
36495717b94954923b12bda6091278047b7735cb56berictian
36595717b94954923b12bda6091278047b7735cb56berictian  This function is used by the driver entity to instruct the IDE controller
36695717b94954923b12bda6091278047b7735cb56berictian  driver to program the IDE controller hardware to the specified modes. This
36795717b94954923b12bda6091278047b7735cb56berictian  function can be called only once for a particular device. For a Serial ATA
36895717b94954923b12bda6091278047b7735cb56berictian  (SATA) Advanced Host Controller Interface (AHCI) controller, no controller-
36995717b94954923b12bda6091278047b7735cb56berictian  specific programming may be required.
37095717b94954923b12bda6091278047b7735cb56berictian
37195717b94954923b12bda6091278047b7735cb56berictian  @param[in] This      Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
37295717b94954923b12bda6091278047b7735cb56berictian  @param[in] Channel   Zero-based channel number.
37395717b94954923b12bda6091278047b7735cb56berictian  @param[in] Device    Zero-based device number on the Channel.
37495717b94954923b12bda6091278047b7735cb56berictian  @param[in] Modes     The modes to set.
37595717b94954923b12bda6091278047b7735cb56berictian
37695717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_SUCCESS             The command was accepted without any errors.
37795717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Channel is invalid (Channel >= ChannelCount).
37895717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_INVALID_PARAMETER   Device is invalid.
37995717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_NOT_READY           Modes cannot be set at this time due to lack of data.
38095717b94954923b12bda6091278047b7735cb56berictian  @retval EFI_DEVICE_ERROR        Modes cannot be set due to hardware failure.
38195717b94954923b12bda6091278047b7735cb56berictian                                  The driver entity should not use this device.
3823ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
38320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
384a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
385a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
386a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeInitSetTiming (
387a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_IDE_CONTROLLER_INIT_PROTOCOL  *This,
388a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Channel,
389a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  UINT8                             Device,
390a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_ATA_COLLECTIVE_MODE           *Modes
391a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
392a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
393a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
394a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
395a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten// Forward reference declaration
396a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten//
39720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
39820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  Retrieves a Unicode string that is the user readable name of the EFI Driver.
39920c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu
40020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param This           A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
40120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param Language       A pointer to a three character ISO 639-2 language identifier.
40220c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                        This is the language of the driver name that that the caller
40320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                        is requesting, and it must match one of the languages specified
40420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                        in SupportedLanguages.  The number of languages supported by a
40520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                        driver is up to the driver writer.
40620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param DriverName     A pointer to the Unicode string to return.  This Unicode string
40720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                        is the name of the driver specified by This in the language
40820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                        specified by Language.
4093ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
41020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_SUCCESS           The Unicode string for the Driver specified by This
41120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                and the language specified by Language was returned
41220c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                in DriverName.
41320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_INVALID_PARAMETER Language is NULL.
41420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_INVALID_PARAMETER DriverName is NULL.
41520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_UNSUPPORTED       The driver specified by This does not support the
41620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                language specified by Language.
41720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
418a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
419a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
420a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeControllerComponentNameGetDriverName (
421a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
422a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  CHAR8                        *Language,
423a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  OUT CHAR16                       **DriverName
424a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
425a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
426a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
42720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu/**
42820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  Retrieves a Unicode string that is the user readable name of the controller
4293ea80ba2e4ae19eb564173e203d7bab00055ff56darylm  that is being managed by an EFI Driver.
43020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu
43120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param This                   A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
43220c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param ControllerHandle       The handle of a controller that the driver specified by
43320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                This is managing.  This handle specifies the controller
43420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                whose name is to be returned.
43524115e44926b33c763f81026690f20efd913daf2ydong  @param OPTIONAL   ChildHandle The handle of the child controller to retrieve the name
43620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                of.  This is an optional parameter that may be NULL.  It
43720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                will be NULL for device drivers.  It will also be NULL
43820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                for a bus drivers that wish to retrieve the name of the
43920c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                bus controller.  It will not be NULL for a bus driver
44020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                that wishes to retrieve the name of a child controller.
44120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param Language               A pointer to a three character ISO 639-2 language
44220c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                identifier.  This is the language of the controller name
44320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                that that the caller is requesting, and it must match one
44420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                of the languages specified in SupportedLanguages.  The
44520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                number of languages supported by a driver is up to the
44620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                driver writer.
44720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @param ControllerName         A pointer to the Unicode string to return.  This Unicode
44820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                string is the name of the controller specified by
44920c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                ControllerHandle and ChildHandle in the language
45020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                specified by Language from the point of view of the
45120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                driver specified by This.
4523ea80ba2e4ae19eb564173e203d7bab00055ff56darylm
45320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_SUCCESS           The Unicode string for the user readable name in the
45420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                language specified by Language for the driver
45520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                specified by This was returned in DriverName.
45669cb32fca2d916a9a6a0ff6efec57a9e0aaf18cfniruiyu  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
45720c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
45820c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                EFI_HANDLE.
45920c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_INVALID_PARAMETER Language is NULL.
46020c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_INVALID_PARAMETER ControllerName is NULL.
46120c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_UNSUPPORTED       The driver specified by This is not currently
46220c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                managing the controller specified by
46320c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                ControllerHandle and ChildHandle.
46420c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu  @retval EFI_UNSUPPORTED       The driver specified by This does not support the
46520c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu                                language specified by Language.
46620c1e33fe47a2179c1a016cac6b7d03bc4f5e125klu**/
467a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFI_STATUS
468a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenEFIAPI
469a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljustenIdeControllerComponentNameGetControllerName (
470a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,
471a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_HANDLE                                      ControllerHandle,
472a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
473a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  IN  CHAR8                                           *Language,
474a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  OUT CHAR16                                          **ControllerName
475a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten  )
476a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten;
477a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten
478a1f11f7547b43a6b86f6925cb8ab3f836b2d5daejljusten#endif
479