]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.h
Clean up ECC.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciHotPlugSupport.h
index 50836657ea9c663ec447f8cf0a6112ce40ebb19d..a84e256b90fc476fa141a86e9a02b8bf4743177f 100644 (file)
@@ -1,42 +1,47 @@
-/**@ file\r
+/** @file\r
+  PCI Hot Plug support functions 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
-\r
-**/\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
+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
-#ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H\r
-#define _EFI_PCI_HOT_PLUG_SUPPORT_H\r
+**/\r
 \r
+#ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H_\r
+#define _EFI_PCI_HOT_PLUG_SUPPORT_H_\r
 \r
 //\r
-// stall 1 second\r
+// stall 1 second, its unit is 100ns\r
 //\r
-#define STALL_1_SECOND        1000000 \r
+#define STALL_1_SECOND        1000000\r
 \r
+//\r
+// PCI Hot Plug controller private data\r
+//\r
 typedef struct {\r
   EFI_EVENT Event;\r
   BOOLEAN   Initialized;\r
   VOID      *Padding;\r
 } ROOT_HPC_DATA;\r
 \r
+//\r
+// Reference of some global variabes\r
+//\r
 extern EFI_PCI_HOT_PLUG_INIT_PROTOCOL *gPciHotPlugInit;\r
 extern EFI_HPC_LOCATION               *gPciRootHpcPool;\r
-extern UINTN                          gPciRootHpcCount;\r
 extern ROOT_HPC_DATA                  *gPciRootHpcData;\r
 \r
 /**\r
-  Init HPC private data.\r
-  \r
-  @param  Event     event object\r
-  @param  Context   HPC private data.\r
+  Event notification function to set Hot Plug controller status.\r
+\r
+  @param  Event                    The event that invoke this function.\r
+  @param  Context                  The calling context, pointer to ROOT_HPC_DATA.\r
+\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -46,13 +51,14 @@ PciHPCInitialized (
   );\r
 \r
 /**\r
-  Compare two device path\r
-  \r
-  @param DevicePath1    the first device path want to be compared.\r
-  @param DevicePath2    the first device path want to be compared.\r
-  \r
-  @retval TRUE    equal.\r
-  @retval FALSE   different.\r
+  Compare two device pathes to check if they are exactly same.\r
+\r
+  @param DevicePath1    A pointer to the first device path data structure.\r
+  @param DevicePath2    A pointer to the second device path data structure.\r
+\r
+  @retval TRUE    They are same.\r
+  @retval FALSE   They are not same.\r
+\r
 **/\r
 BOOLEAN\r
 EfiCompareDevicePath (\r
@@ -61,8 +67,17 @@ EfiCompareDevicePath (
   );\r
 \r
 /**\r
-  Init hot plug support and root hot plug private data.\r
-  \r
+  Check hot plug support and initialize root hot plug private data.\r
+\r
+  If Hot Plug is supported by the platform, call PCI Hot Plug Init protocol\r
+  to get PCI Hot Plug controller's information and constructor the root hot plug\r
+  private data structure.\r
+\r
+  @retval EFI_SUCCESS           They are same.\r
+  @retval EFI_UNSUPPORTED       No PCI Hot Plug controler on the platform.\r
+  @retval EFI_OUT_OF_RESOURCES  No memory to constructor root hot plug private\r
+                                data structure.\r
+\r
 **/\r
 EFI_STATUS\r
 InitializeHotPlugSupport (\r
@@ -71,40 +86,45 @@ InitializeHotPlugSupport (
 \r
 /**\r
   Test whether PCI device is hot plug bus.\r
-  \r
+\r
   @param PciIoDevice  PCI device instance.\r
-  \r
-  @retval EFI_SUCCESS   PCI device is hot plug bus.\r
-  @retval EFI_NOT_FOUND PCI device is not hot plug bus.\r
+\r
+  @retval TRUE    PCI device is a hot plug bus.\r
+  @retval FALSE   PCI device is not a hot plug bus.\r
+\r
 **/\r
-EFI_STATUS\r
+BOOLEAN\r
 IsPciHotPlugBus (\r
   PCI_IO_DEVICE                       *PciIoDevice\r
   );\r
 \r
 /**\r
-  Test whether device path is for root pci hot plug bus\r
-  \r
-  @param HpbDevicePath  tested device path\r
-  @param HpIndex        Return the index of root hot plug in global array.\r
-  \r
-  @retval TRUE  device path is for root pci hot plug\r
-  @retval FALSE device path is not for root pci hot plug\r
+  Test whether device path is for root pci hot plug bus.\r
+\r
+  @param HpbDevicePath  A pointer to device path data structure to be tested.\r
+  @param HpIndex        If HpIndex is not NULL, return the index of root hot\r
+                        plug in global array when TRUE is retuned.\r
+\r
+  @retval TRUE          The device path is for root pci hot plug bus.\r
+  @retval FALSE         The device path is not for root pci hot plug bus.\r
+\r
 **/\r
 BOOLEAN\r
 IsRootPciHotPlugBus (\r
-  IN EFI_DEVICE_PATH_PROTOCOL         *HpbDevicePath,\r
-  OUT UINTN                           *HpIndex\r
+  IN  EFI_DEVICE_PATH_PROTOCOL        *HpbDevicePath,\r
+  OUT UINTN                           *HpIndex    OPTIONAL\r
   );\r
 \r
 /**\r
-  Test whether device path is for root pci hot plug controller\r
-  \r
-  @param HpcDevicePath  tested device path.\r
-  @param HpIndex        Return the index of root hot plug in global array.\r
-  \r
-  @retval TRUE  device path is for root pci hot plug controller.\r
-  @retval FALSE device path is not for root pci hot plug controller.\r
+  Test whether device path is for root pci hot plug controller.\r
+\r
+  @param HpcDevicePath  A pointer to device path data structure to be tested.\r
+  @param HpIndex        If HpIndex is not NULL, return the index of root hot\r
+                        plug in global array when TRUE is retuned.\r
+\r
+  @retval TRUE          The device path is for root pci hot plug controller.\r
+  @retval FALSE         The device path is not for root pci hot plug controller.\r
+\r
 **/\r
 BOOLEAN\r
 IsRootPciHotPlugController (\r
@@ -113,23 +133,28 @@ IsRootPciHotPlugController (
   );\r
 \r
 /**\r
-  Wrapper for creating event object for HPC \r
-  \r
-  @param  HpIndex   index of hot plug device in global array.\r
-  @param  Event     event object.\r
-  \r
-  @return status of create event invoken.\r
+  Creating event object for PCI Hot Plug controller.\r
+\r
+  @param  HpIndex   Index of hot plug device in global array.\r
+  @param  Event     The retuned event that invoke this function.\r
+\r
+  @return Status of create event invoken.\r
+\r
 **/\r
 EFI_STATUS\r
 CreateEventForHpc (\r
-  IN UINTN       HpIndex,\r
+  IN  UINTN      HpIndex,\r
   OUT EFI_EVENT  *Event\r
   );\r
 \r
 /**\r
-  Wait for all root HPC initialized.\r
-  \r
-  @param TimeoutInMicroSeconds  microseconds to wait for all root hpc's initialization.\r
+  Wait for all root PCI Hot Plug controller finished initializing.\r
+\r
+  @param TimeoutInMicroSeconds  Microseconds to wait for all root HPCs' initialization.\r
+\r
+  @retval EFI_SUCCESS           All HPCs initialization finished.\r
+  @retval EFI_TIMEOUT           Not ALL HPCs initialization finished in Microseconds.\r
+\r
 **/\r
 EFI_STATUS\r
 AllRootHPCInitialized (\r
@@ -137,29 +162,28 @@ AllRootHPCInitialized (
   );\r
 \r
 /**\r
-  Check HPC capability register block\r
-  \r
-  @param PciIoDevice PCI device instance.\r
-  \r
-  @retval EFI_SUCCESS   PCI device is HPC.\r
-  @retval EFI_NOT_FOUND PCI device is not HPC.\r
+  Check whether PCI-PCI bridge has PCI Hot Plug capability register block.\r
+\r
+  @param PciIoDevice    A Pointer to the PCI-PCI bridge.\r
+\r
+  @retval TRUE    PCI device is HPC.\r
+  @retval FALSE   PCI device is not HPC.\r
+\r
 **/\r
-EFI_STATUS\r
+BOOLEAN\r
 IsSHPC (\r
-  PCI_IO_DEVICE                       *PciIoDevice\r
+  IN PCI_IO_DEVICE                      *PciIoDevice\r
   );\r
 \r
 /**\r
-  Get resource padding for hot plug bus\r
-  \r
-  @param PciIoDevice PCI device instance.\r
-  \r
-  @retval EFI_SUCCESS   success get padding and set it into PCI device instance.\r
-  @retval EFI_NOT_FOUND PCI device is not a hot plug bus.\r
+  Get resource padding if the specified PCI bridge is a hot plug bus.\r
+\r
+  @param PciIoDevice    PCI bridge instance.\r
+\r
 **/\r
-EFI_STATUS\r
+VOID\r
 GetResourcePaddingForHpb (\r
-  IN PCI_IO_DEVICE *PciIoDevice\r
+  IN PCI_IO_DEVICE      *PciIoDevice\r
   );\r
 \r
 #endif\r