]> 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 7b15a3cd37af6159429957fe87cca7c15426088b..a84e256b90fc476fa141a86e9a02b8bf4743177f 100644 (file)
-/*++\r
+/** @file\r
+  PCI Hot Plug support functions declaration for PCI Bus module.\r
 \r
-Copyright (c) 2006 - 2007, 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
-  PciHotPlugSupport.h\r
-  \r
-Abstract:\r
-\r
-  \r
-\r
-Revision History\r
-\r
---*/\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
+  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
 PciHPCInitialized (\r
   IN EFI_EVENT    Event,\r
   IN VOID         *Context\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
+  );\r
 \r
-Arguments:\r
+/**\r
+  Compare two device pathes to check if they are exactly same.\r
 \r
-  Event   - TODO: add argument description\r
-  Context - TODO: add argument description\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
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  @retval TRUE    They are same.\r
+  @retval FALSE   They are not same.\r
 \r
+**/\r
 BOOLEAN\r
 EfiCompareDevicePath (\r
   IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,\r
   IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Check hot plug support and initialize root hot plug private data.\r
 \r
-Arguments:\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
-  DevicePath1 - TODO: add argument description\r
-  DevicePath2 - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\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
   VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Test whether PCI device is hot plug bus.\r
 \r
-Arguments:\r
+  @param PciIoDevice  PCI device instance.\r
 \r
-  None\r
+  @retval TRUE    PCI device is a hot plug bus.\r
+  @retval FALSE   PCI device is not a hot plug bus.\r
 \r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
+**/\r
+BOOLEAN\r
 IsPciHotPlugBus (\r
   PCI_IO_DEVICE                       *PciIoDevice\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
+  );\r
 \r
-  PciIoDevice - TODO: add argument description\r
+/**\r
+  Test whether device path is for root pci hot plug bus.\r
 \r
-Returns:\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
-  TODO: add return values\r
-\r
---*/\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
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  IN  EFI_DEVICE_PATH_PROTOCOL        *HpbDevicePath,\r
+  OUT UINTN                           *HpIndex    OPTIONAL\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Test whether device path is for root pci hot plug controller.\r
 \r
-Arguments:\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
-  HpbDevicePath - TODO: add argument description\r
-  HpIndex       - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\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
   IN EFI_DEVICE_PATH_PROTOCOL         *HpcDevicePath,\r
   OUT UINTN                           *HpIndex\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Creating event object for PCI Hot Plug controller.\r
 \r
-Arguments:\r
+  @param  HpIndex   Index of hot plug device in global array.\r
+  @param  Event     The retuned event that invoke this function.\r
 \r
-  HpcDevicePath - TODO: add argument description\r
-  HpIndex       - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\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
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Wait for all root PCI Hot Plug controller finished initializing.\r
 \r
-Arguments:\r
+  @param TimeoutInMicroSeconds  Microseconds to wait for all root HPCs' initialization.\r
 \r
-  HpIndex - TODO: add argument description\r
-  Event   - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\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
   IN  UINTN           TimeoutInMicroSeconds\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+  );\r
 \r
-  TODO: Add function description\r
+/**\r
+  Check whether PCI-PCI bridge has PCI Hot Plug capability register block.\r
 \r
-Arguments:\r
-  TimeoutInMicroSeconds - microseconds to wait for all root hpc's initialization\r
+  @param PciIoDevice    A Pointer to the PCI-PCI bridge.\r
 \r
-Returns:\r
-  EFI_SUCCESS - All root hpc's initialization is finished before the timeout\r
-  EFI_TIMEOUT - Time out\r
+  @retval TRUE    PCI device is HPC.\r
+  @retval FALSE   PCI device is not HPC.\r
 \r
---*/\r
-;\r
-\r
-EFI_STATUS\r
+**/\r
+BOOLEAN\r
 IsSHPC (\r
-  PCI_IO_DEVICE                       *PciIoDevice\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
+  IN PCI_IO_DEVICE                      *PciIoDevice\r
+  );\r
 \r
-  PciIoDevice - TODO: add argument description\r
+/**\r
+  Get resource padding if the specified PCI bridge is a hot plug bus.\r
 \r
-Returns:\r
+  @param PciIoDevice    PCI bridge instance.\r
 \r
-  TODO: add return values\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
+**/\r
+VOID\r
 GetResourcePaddingForHpb (\r
-  IN PCI_IO_DEVICE *PciIoDevice\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  PciIoDevice - TODO: add argument description\r
-\r
-Returns:\r
-\r
-  TODO: add return values\r
-\r
---*/\r
-;\r
+  IN PCI_IO_DEVICE      *PciIoDevice\r
+  );\r
 \r
 #endif\r