]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.h
clean up non-English characters.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciEnumerator.h
index e7667d5c49ab20bd843fae59a22fe1183c1f54e0..3c0ca2fbfdbfe7508e187764900a7c1ef2afc401 100644 (file)
-/*++\r
+/** @file\r
+  PCI bus enumeration logic function declaration for PCI bus module.\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2009, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
 \r
-Module Name:\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-  PciEnumerator.h\r
-  \r
-Abstract:\r
+**/\r
 \r
-  PCI Bus Driver\r
+#ifndef _EFI_PCI_ENUMERATOR_H_\r
+#define _EFI_PCI_ENUMERATOR_H_\r
 \r
-Revision History\r
+#include "PciResourceSupport.h"\r
 \r
---*/\r
+/**\r
+  This routine is used to enumerate entire pci bus system\r
+  in a given platform.\r
 \r
-#ifndef _EFI_PCI_ENUMERATOR_H\r
-#define _EFI_PCI_ENUMERATOR_H\r
+  @param Controller  Parent controller handle.\r
 \r
-#include "PciResourceSupport.h"\r
+  @retval EFI_SUCCESS    PCI enumeration finished successfully.\r
+  @retval other          Some error occurred when enumerating the pci bus system.\r
 \r
+**/\r
 EFI_STATUS\r
 PciEnumerator (\r
   IN EFI_HANDLE                    Controller\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
+  );\r
 \r
-Arguments:\r
+/**\r
+  Enumerate PCI root bridge.\r
 \r
-  Controller  - TODO: add argument description\r
+  @param PciResAlloc   Pointer to protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.\r
+  @param RootBridgeDev Instance of root bridge device.\r
 \r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_SUCCESS  Successfully enumerated root bridge.\r
+  @retval other        Failed to enumerate root bridge.\r
 \r
+**/\r
 EFI_STATUS\r
 PciRootBridgeEnumerator (\r
   IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL  *PciResAlloc,\r
   IN PCI_IO_DEVICE                                     *RootBridgeDev\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
+  );\r
 \r
-Arguments:\r
+/**\r
+  This routine is used to process all PCI devices' Option Rom\r
+  on a certain root bridge.\r
 \r
-  PciResAlloc   - TODO: add argument description\r
-  RootBridgeDev - TODO: add argument description\r
+  @param Bridge     Given parent's root bridge.\r
+  @param RomBase    Base address of ROM driver loaded from.\r
+  @param MaxLength  Maximum rom size.\r
 \r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
+**/\r
+VOID\r
 ProcessOptionRom (\r
   IN PCI_IO_DEVICE *Bridge,\r
   IN UINT64        RomBase,\r
   IN UINT64        MaxLength\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Bridge    - TODO: add argument description\r
-  RomBase   - TODO: add argument description\r
-  MaxLength - TODO: add argument description\r
+  );\r
 \r
-Returns:\r
+/**\r
+  This routine is used to assign bus number to the given PCI bus system\r
 \r
-  TODO: add return values\r
+  @param Bridge             Parent root bridge instance.\r
+  @param StartBusNumber     Number of beginning.\r
+  @param SubBusNumber       The number of sub bus.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS       Successfully assigned bus number.\r
+  @retval EFI_DEVICE_ERROR  Failed to assign bus number.\r
 \r
+**/\r
 EFI_STATUS\r
 PciAssignBusNumber (\r
   IN PCI_IO_DEVICE                      *Bridge,\r
   IN UINT8                              StartBusNumber,\r
   OUT UINT8                             *SubBusNumber\r
-  )\r
-/*++\r
+  );\r
 \r
-Routine Description:\r
+/**\r
+  This routine is used to determine the root bridge attribute by interfacing\r
+  the host bridge resource allocation protocol.\r
 \r
-  TODO: Add function description\r
+  @param PciResAlloc    Protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL\r
+  @param RootBridgeDev  Root bridge instance\r
 \r
-Arguments:\r
-\r
-  Bridge          - TODO: add argument description\r
-  StartBusNumber  - TODO: add argument description\r
-  SubBusNumber    - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_SUCCESS  Successfully got root bridge's attribute.\r
+  @retval other        Failed to get attribute.\r
 \r
+**/\r
 EFI_STATUS\r
 DetermineRootBridgeAttributes (\r
   IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc,\r
   IN PCI_IO_DEVICE                                    *RootBridgeDev\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PciResAlloc   - TODO: add argument description\r
-  RootBridgeDev - TODO: add argument description\r
+  );\r
 \r
-Returns:\r
+/**\r
+  Get Max Option Rom size on specified bridge.\r
 \r
-  TODO: add return values\r
+  @param Bridge    Given bridge device instance.\r
 \r
---*/\r
-;\r
+  @return Max size of option rom needed.\r
 \r
+**/\r
 UINT64\r
 GetMaxOptionRomSize (\r
   IN PCI_IO_DEVICE   *Bridge\r
-  )\r
-/*++\r
+  );\r
 \r
-Routine Description:\r
+/**\r
+  Process attributes of devices on this host bridge\r
 \r
-  TODO: Add function description\r
+  @param PciResAlloc Protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.\r
 \r
-Arguments:\r
-\r
-  Bridge  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_SUCCESS   Successfully process attribute.\r
+  @retval EFI_NOT_FOUND Can not find the specific root bridge device.\r
+  @retval other         Failed to determine the root bridge device's attribute.\r
 \r
+**/\r
 EFI_STATUS\r
 PciHostBridgeDeviceAttribute (\r
   IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
+  );\r
 \r
-  PciResAlloc - TODO: add argument description\r
+/**\r
+  Get resource allocation status from the ACPI resource descriptor.\r
 \r
-Returns:\r
+  @param AcpiConfig       Point to Acpi configuration table.\r
+  @param IoResStatus      Return the status of I/O resource.\r
+  @param Mem32ResStatus   Return the status of 32-bit Memory resource.\r
+  @param PMem32ResStatus  Return the status of 32-bit Prefetchable Memory resource.\r
+  @param Mem64ResStatus   Return the status of 64-bit Memory resource.\r
+  @param PMem64ResStatus  Return the status of 64-bit Prefetchable Memory resource.\r
 \r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
+**/\r
+VOID\r
 GetResourceAllocationStatus (\r
   VOID        *AcpiConfig,\r
   OUT UINT64  *IoResStatus,\r
@@ -193,115 +146,82 @@ GetResourceAllocationStatus (
   OUT UINT64  *PMem32ResStatus,\r
   OUT UINT64  *Mem64ResStatus,\r
   OUT UINT64  *PMem64ResStatus\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Remove a PCI device from device pool and mark its bar.\r
 \r
-Arguments:\r
+  @param PciDevice Instance of Pci device.\r
 \r
-  AcpiConfig      - TODO: add argument description\r
-  IoResStatus     - TODO: add argument description\r
-  Mem32ResStatus  - TODO: add argument description\r
-  PMem32ResStatus - TODO: add argument description\r
-  Mem64ResStatus  - TODO: add argument description\r
-  PMem64ResStatus - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_SUCCESS Successfully remove the PCI device.\r
+  @retval EFI_ABORTED Pci device is a root bridge or a PCI-PCI bridge.\r
 \r
+**/\r
 EFI_STATUS\r
 RejectPciDevice (\r
   IN PCI_IO_DEVICE       *PciDevice\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Determine whethter a PCI device can be rejected.\r
 \r
-Arguments:\r
+  @param  PciResNode Pointer to Pci resource node instance.\r
 \r
-  PciDevice - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval TRUE  The PCI device can be rejected.\r
+  @retval TRUE  The PCI device cannot be rejected.\r
 \r
+**/\r
 BOOLEAN\r
 IsRejectiveDevice (\r
   IN  PCI_RESOURCE_NODE   *PciResNode\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Compare two resource nodes and get the larger resource consumer.\r
 \r
-Arguments:\r
+  @param PciResNode1  resource node 1 want to be compared\r
+  @param PciResNode2  resource node 2 want to be compared\r
 \r
-  PciResNode  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @return Larger resource node.\r
 \r
+**/\r
 PCI_RESOURCE_NODE *\r
 GetLargerConsumerDevice (\r
   IN  PCI_RESOURCE_NODE   *PciResNode1,\r
   IN  PCI_RESOURCE_NODE   *PciResNode2\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Get the max resource consumer in the host resource pool.\r
 \r
-Arguments:\r
+  @param ResPool  Pointer to resource pool node.\r
 \r
-  PciResNode1 - TODO: add argument description\r
-  PciResNode2 - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @return The max resource consumer in the host resource pool.\r
 \r
+**/\r
 PCI_RESOURCE_NODE *\r
 GetMaxResourceConsumerDevice (\r
   IN  PCI_RESOURCE_NODE   *ResPool\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  ResPool - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
+  );\r
+\r
+/**\r
+  Adjust host bridge allocation so as to reduce resource requirement\r
+\r
+  @param IoPool           Pointer to instance of I/O resource Node.\r
+  @param Mem32Pool        Pointer to instance of 32-bit memory resource Node.\r
+  @param PMem32Pool       Pointer to instance of 32-bit Prefetchable memory resource node.\r
+  @param Mem64Pool        Pointer to instance of 64-bit memory resource node.\r
+  @param PMem64Pool       Pointer to instance of 64-bit Prefetchable memory resource node.\r
+  @param IoResStatus      Status of I/O resource Node.\r
+  @param Mem32ResStatus   Status of 32-bit memory resource Node.\r
+  @param PMem32ResStatus  Status of 32-bit Prefetchable memory resource node.\r
+  @param Mem64ResStatus   Status of 64-bit memory resource node.\r
+  @param PMem64ResStatus  Status of 64-bit Prefetchable memory resource node.\r
+\r
+  @retval EFI_SUCCESS     Successfully adjusted resoruce on host bridge.\r
+  @retval EFI_ABORTED     Host bridge hasn't this resource type or no resource be adjusted.\r
+\r
+**/\r
 EFI_STATUS\r
 PciHostBridgeAdjustAllocation (\r
   IN  PCI_RESOURCE_NODE   *IoPool,\r
@@ -314,33 +234,24 @@ PciHostBridgeAdjustAllocation (
   IN  UINT64              PMem32ResStatus,\r
   IN  UINT64              Mem64ResStatus,\r
   IN  UINT64              PMem64ResStatus\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  IoPool          - TODO: add argument description\r
-  Mem32Pool       - TODO: add argument description\r
-  PMem32Pool      - TODO: add argument description\r
-  Mem64Pool       - TODO: add argument description\r
-  PMem64Pool      - TODO: add argument description\r
-  IoResStatus     - TODO: add argument description\r
-  Mem32ResStatus  - TODO: add argument description\r
-  PMem32ResStatus - TODO: add argument description\r
-  Mem64ResStatus  - TODO: add argument description\r
-  PMem64ResStatus - TODO: add argument description\r
+  );\r
 \r
-Returns:\r
+/**\r
+  Summary requests for all resource type, and contruct ACPI resource\r
+  requestor instance.\r
 \r
-  TODO: add return values\r
+  @param Bridge           detecting bridge\r
+  @param IoNode           Pointer to instance of I/O resource Node\r
+  @param Mem32Node        Pointer to instance of 32-bit memory resource Node\r
+  @param PMem32Node       Pointer to instance of 32-bit Pmemory resource node\r
+  @param Mem64Node        Pointer to instance of 64-bit memory resource node\r
+  @param PMem64Node       Pointer to instance of 64-bit Pmemory resource node\r
+  @param Config           Output buffer holding new constructed APCI resource requestor\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS           Successfully constructed ACPI resource.\r
+  @retval EFI_OUT_OF_RESOURCES  No memory availabe.\r
 \r
+**/\r
 EFI_STATUS\r
 ConstructAcpiResourceRequestor (\r
   IN PCI_IO_DEVICE      *Bridge,\r
@@ -349,104 +260,73 @@ ConstructAcpiResourceRequestor (
   IN PCI_RESOURCE_NODE  *PMem32Node,\r
   IN PCI_RESOURCE_NODE  *Mem64Node,\r
   IN PCI_RESOURCE_NODE  *PMem64Node,\r
-  OUT VOID              **pConfig\r
-  )\r
-/*++\r
+  OUT VOID              **Config\r
+  );\r
 \r
-Routine Description:\r
+/**\r
+  Get resource base from an acpi configuration descriptor.\r
 \r
-  TODO: Add function description\r
+  @param Config       An acpi configuration descriptor.\r
+  @param IoBase       Output of I/O resource base address.\r
+  @param Mem32Base    Output of 32-bit memory base address.\r
+  @param PMem32Base   Output of 32-bit prefetchable memory base address.\r
+  @param Mem64Base    Output of 64-bit memory base address.\r
+  @param PMem64Base   Output of 64-bit prefetchable memory base address.\r
 \r
-Arguments:\r
-\r
-  Bridge      - TODO: add argument description\r
-  IoNode      - TODO: add argument description\r
-  Mem32Node   - TODO: add argument description\r
-  PMem32Node  - TODO: add argument description\r
-  Mem64Node   - TODO: add argument description\r
-  PMem64Node  - TODO: add argument description\r
-  pConfig     - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
+**/\r
+VOID\r
 GetResourceBase (\r
-  IN VOID     *pConfig,\r
+  IN VOID     *Config,\r
   OUT UINT64  *IoBase,\r
   OUT UINT64  *Mem32Base,\r
   OUT UINT64  *PMem32Base,\r
   OUT UINT64  *Mem64Base,\r
   OUT UINT64  *PMem64Base\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
+  );\r
 \r
-Arguments:\r
+/**\r
+  Enumerate pci bridge, allocate resource and determine attribute\r
+  for devices on this bridge.\r
 \r
-  pConfig     - TODO: add argument description\r
-  IoBase      - TODO: add argument description\r
-  Mem32Base   - TODO: add argument description\r
-  PMem32Base  - TODO: add argument description\r
-  Mem64Base   - TODO: add argument description\r
-  PMem64Base  - TODO: add argument description\r
+  @param BridgeDev    Pointer to instance of bridge device.\r
 \r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_SUCCESS Successfully enumerated PCI bridge.\r
+  @retval other       Failed to enumerate.\r
 \r
+**/\r
 EFI_STATUS\r
 PciBridgeEnumerator (\r
   IN PCI_IO_DEVICE                                     *BridgeDev\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
+  );\r
 \r
-Arguments:\r
+/**\r
+  Allocate all kinds of resource for PCI bridge.\r
 \r
-  BridgeDev - TODO: add argument description\r
+  @param  Bridge      Pointer to bridge instance.\r
 \r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_SUCCESS Successfully allocated resource for PCI bridge.\r
+  @retval other       Failed to allocate resource for bridge.\r
 \r
+**/\r
 EFI_STATUS\r
 PciBridgeResourceAllocator (\r
   IN PCI_IO_DEVICE  *Bridge\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
+  );\r
 \r
-Arguments:\r
+/**\r
+  Get resource base address for a pci bridge device.\r
 \r
-  Bridge  - TODO: add argument description\r
+  @param Bridge     Given Pci driver instance.\r
+  @param IoBase     Output for base address of I/O type resource.\r
+  @param Mem32Base  Output for base address of 32-bit memory type resource.\r
+  @param PMem32Base Ooutput for base address of 32-bit Pmemory type resource.\r
+  @param Mem64Base  Output for base address of 64-bit memory type resource.\r
+  @param PMem64Base Output for base address of 64-bit Pmemory type resource.\r
 \r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval EFI_SUCCESS           Successfully got resource base address.\r
+  @retval EFI_OUT_OF_RESOURCES  PCI bridge is not available.\r
 \r
+**/\r
 EFI_STATUS\r
 GetResourceBaseFromBridge (\r
   IN  PCI_IO_DEVICE *Bridge,\r
@@ -455,73 +335,115 @@ GetResourceBaseFromBridge (
   OUT UINT64        *PMem32Base,\r
   OUT UINT64        *Mem64Base,\r
   OUT UINT64        *PMem64Base\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
+  );\r
 \r
-Arguments:\r
+/**\r
+  Process Option Rom on this host bridge\r
 \r
-  Bridge      - TODO: add argument description\r
-  IoBase      - TODO: add argument description\r
-  Mem32Base   - TODO: add argument description\r
-  PMem32Base  - TODO: add argument description\r
-  Mem64Base   - TODO: add argument description\r
-  PMem64Base  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @param PciResAlloc Pointer to instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.\r
 \r
+  @retval EFI_NOT_FOUND Can not find the root bridge instance.\r
+  @retval EFI_SUCCESS   Success process.\r
+**/\r
 EFI_STATUS\r
 PciHostBridgeP2CProcess (\r
   IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PciResAlloc - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
+  );\r
+\r
+/**\r
+   These are the notifications from the PCI bus driver that it is about to enter a certain\r
+   phase of the PCI enumeration process.\r
+\r
+   This member function can be used to notify the host bridge driver to perform specific actions,\r
+   including any chipset-specific initialization, so that the chipset is ready to enter the next phase.\r
+   Eight notification points are defined at this time. See belows:\r
+   EfiPciHostBridgeBeginEnumeration       Resets the host bridge PCI apertures and internal data\r
+                                          structures. The PCI enumerator should issue this notification\r
+                                          before starting a fresh enumeration process. Enumeration cannot\r
+                                          be restarted after sending any other notification such as\r
+                                          EfiPciHostBridgeBeginBusAllocation.\r
+   EfiPciHostBridgeBeginBusAllocation     The bus allocation phase is about to begin. No specific action is\r
+                                          required here. This notification can be used to perform any\r
+                                          chipset-specific programming.\r
+   EfiPciHostBridgeEndBusAllocation       The bus allocation and bus programming phase is complete. No\r
+                                          specific action is required here. This notification can be used to\r
+                                          perform any chipset-specific programming.\r
+   EfiPciHostBridgeBeginResourceAllocation\r
+                                          The resource allocation phase is about to begin. No specific\r
+                                          action is required here. This notification can be used to perform\r
+                                          any chipset-specific programming.\r
+   EfiPciHostBridgeAllocateResources      Allocates resources per previously submitted requests for all the PCI\r
+                                          root bridges. These resource settings are returned on the next call to\r
+                                          GetProposedResources(). Before calling NotifyPhase() with a Phase of\r
+                                          EfiPciHostBridgeAllocateResource, the PCI bus enumerator is responsible\r
+                                          for gathering I/O and memory requests for\r
+                                          all the PCI root bridges and submitting these requests using\r
+                                          SubmitResources(). This function pads the resource amount\r
+                                          to suit the root bridge hardware, takes care of dependencies between\r
+                                          the PCI root bridges, and calls the Global Coherency Domain (GCD)\r
+                                          with the allocation request. In the case of padding, the allocated range\r
+                                          could be bigger than what was requested.\r
+   EfiPciHostBridgeSetResources           Programs the host bridge hardware to decode previously allocated\r
+                                          resources (proposed resources) for all the PCI root bridges. After the\r
+                                          hardware is programmed, reassigning resources will not be supported.\r
+                                          The bus settings are not affected.\r
+   EfiPciHostBridgeFreeResources          Deallocates resources that were previously allocated for all the PCI\r
+                                          root bridges and resets the I/O and memory apertures to their initial\r
+                                          state. The bus settings are not affected. If the request to allocate\r
+                                          resources fails, the PCI enumerator can use this notification to\r
+                                          deallocate previous resources, adjust the requests, and retry\r
+                                          allocation.\r
+   EfiPciHostBridgeEndResourceAllocation  The resource allocation phase is completed. No specific action is\r
+                                          required here. This notification can be used to perform any chipsetspecific\r
+                                          programming.\r
+\r
+   @param[in] PciResAlloc         The instance pointer of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL\r
+   @param[in] Phase               The phase during enumeration\r
+\r
+   @retval EFI_NOT_READY          This phase cannot be entered at this time. For example, this error\r
+                                  is valid for a Phase of EfiPciHostBridgeAllocateResources if\r
+                                  SubmitResources() has not been called for one or more\r
+                                  PCI root bridges before this call\r
+   @retval EFI_DEVICE_ERROR       Programming failed due to a hardware error. This error is valid\r
+                                  for a Phase of EfiPciHostBridgeSetResources.\r
+   @retval EFI_INVALID_PARAMETER  Invalid phase parameter\r
+   @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to a lack of resources.\r
+                                  This error is valid for a Phase of EfiPciHostBridgeAllocateResources if the\r
+                                  previously submitted resource requests cannot be fulfilled or\r
+                                  were only partially fulfilled.\r
+   @retval EFI_SUCCESS            The notification was accepted without any errors.\r
+\r
+**/\r
 EFI_STATUS\r
 NotifyPhase (\r
   IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc,\r
   EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE       Phase\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PciResAlloc - TODO: add argument description\r
-  Phase       - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
+  );\r
+\r
+/**\r
+  Provides the hooks from the PCI bus driver to every PCI controller (device/function) at various\r
+  stages of the PCI enumeration process that allow the host bridge driver to preinitialize individual\r
+  PCI controllers before enumeration.\r
+\r
+  This function is called during the PCI enumeration process. No specific action is expected from this\r
+  member function. It allows the host bridge driver to preinitialize individual PCI controllers before\r
+  enumeration.\r
+\r
+  @param Bridge            Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.\r
+  @param Bus               The bus number of the pci device.\r
+  @param Device            The device number of the pci device.\r
+  @param Func              The function number of the pci device.\r
+  @param Phase             The phase of the PCI device enumeration.\r
+\r
+  @retval EFI_SUCCESS              The requested parameters were returned.\r
+  @retval EFI_INVALID_PARAMETER    RootBridgeHandle is not a valid root bridge handle.\r
+  @retval EFI_INVALID_PARAMETER    Phase is not a valid phase that is defined in\r
+                                   EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE.\r
+  @retval EFI_DEVICE_ERROR         Programming failed due to a hardware error. The PCI enumerator should\r
+                                    not enumerate this device, including its child devices if it is a PCI-to-PCI\r
+                                    bridge.\r
+\r
+**/\r
 EFI_STATUS\r
 PreprocessController (\r
   IN PCI_IO_DEVICE                                  *Bridge,\r
@@ -529,28 +451,31 @@ PreprocessController (
   IN UINT8                                          Device,\r
   IN UINT8                                          Func,\r
   IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE   Phase\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Bridge  - TODO: add argument description\r
-  Bus     - TODO: add argument description\r
-  Device  - TODO: add argument description\r
-  Func    - TODO: add argument description\r
-  Phase   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
+  );\r
+\r
+/**\r
+  This function allows the PCI bus driver to be notified to act as requested when a hot-plug event has\r
+  happened on the hot-plug controller. Currently, the operations include add operation and remove operation..\r
+\r
+  @param This                 A pointer to the hot plug request protocol.\r
+  @param Operation            The operation the PCI bus driver is requested to make.\r
+  @param Controller           The handle of the hot-plug controller.\r
+  @param RemainingDevicePath  The remaining device path for the PCI-like hot-plug device.\r
+  @param NumberOfChildren     The number of child handles.\r
+                              For a add operation, it is an output parameter.\r
+                              For a remove operation, it's an input parameter.\r
+  @param ChildHandleBuffer    The buffer which contains the child handles.\r
+\r
+  @retval EFI_INVALID_PARAMETER  Operation is not a legal value.\r
+                                 Controller is NULL or not a valid handle.\r
+                                 NumberOfChildren is NULL.\r
+                                 ChildHandleBuffer is NULL while Operation is add.\r
+  @retval EFI_OUT_OF_RESOURCES   There are no enough resources to start the devices.\r
+  @retval EFI_NOT_FOUND          Can not find bridge according to controller handle.\r
+  @retval EFI_SUCCESS            The handles for the specified device have been created or destroyed\r
+                                 as requested, and for an add operation, the new handles are\r
+                                 returned in ChildHandleBuffer.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PciHotPlugRequestNotify (\r
@@ -560,69 +485,35 @@ PciHotPlugRequestNotify (
   IN EFI_DEVICE_PATH_PROTOCOL         * RemainingDevicePath OPTIONAL,\r
   IN OUT UINT8                        *NumberOfChildren,\r
   IN OUT EFI_HANDLE                   * ChildHandleBuffer\r
-  )\r
-/*++\r
+  );\r
 \r
-Routine Description:\r
+/**\r
+  Search hostbridge according to given handle\r
 \r
-  TODO: Add function description\r
+  @param RootBridgeHandle  Host bridge handle.\r
 \r
-Arguments:\r
-\r
-  This                - TODO: add argument description\r
-  Operation           - TODO: add argument description\r
-  Controller          - TODO: add argument description\r
-  RemainingDevicePath - TODO: add argument description\r
-  NumberOfChildren    - TODO: add argument description\r
-  ChildHandleBuffer   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval TRUE             Found host bridge handle.\r
+  @retval FALSE            Not found hot bridge handle.\r
 \r
+**/\r
 BOOLEAN\r
 SearchHostBridgeHandle (\r
   IN EFI_HANDLE RootBridgeHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  RootBridgeHandle  - TODO: add argument description\r
+  );\r
 \r
-Returns:\r
+/**\r
+  Add host bridge handle to global variable for enumerating.\r
 \r
-  TODO: add return values\r
+  @param HostBridgeHandle   Host bridge handle.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS       Successfully added host bridge.\r
+  @retval EFI_ABORTED       Host bridge is NULL, or given host bridge\r
+                            has been in host bridge list.\r
 \r
+**/\r
 EFI_STATUS\r
 AddHostBridgeEnumerator (\r
   IN EFI_HANDLE HostBridgeHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  HostBridgeHandle  - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  );\r
 \r
 #endif\r