2 PCI Hot Plug support functions declaration for PCI Bus module.
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H_
16 #define _EFI_PCI_HOT_PLUG_SUPPORT_H_
19 // stall 1 second, its unit is 100ns
21 #define STALL_1_SECOND 1000000
24 // PCI Hot Plug controller private data
34 // Reference of some global variabes
36 extern EFI_PCI_HOT_PLUG_INIT_PROTOCOL
*gPciHotPlugInit
;
37 extern EFI_HPC_LOCATION
*gPciRootHpcPool
;
38 extern ROOT_HPC_DATA
*gPciRootHpcData
;
41 Event notification function to set Hot Plug controller status.
43 @param Event The event that invoke this function.
44 @param Context The calling context, pointer to ROOT_HPC_DATA.
55 Compare two device pathes to check if they are exactly same.
57 @param DevicePath1 A pointer to the first device path data structure.
58 @param DevicePath2 A pointer to the second device path data structure.
60 @retval TRUE They are same.
61 @retval FALSE They are not same.
65 EfiCompareDevicePath (
66 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath1
,
67 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath2
71 Check hot plug support and initialize root hot plug private data.
73 If Hot Plug is supported by the platform, call PCI Hot Plug Init protocol
74 to get PCI Hot Plug controller's information and constructor the root hot plug
75 private data structure.
77 @retval EFI_SUCCESS They are same.
78 @retval EFI_UNSUPPORTED No PCI Hot Plug controler on the platform.
79 @retval EFI_OUT_OF_RESOURCES No memory to constructor root hot plug private
84 InitializeHotPlugSupport (
89 Test whether PCI device is hot plug bus.
91 @param PciIoDevice PCI device instance.
93 @retval TRUE PCI device is a hot plug bus.
94 @retval FALSE PCI device is not a hot plug bus.
99 PCI_IO_DEVICE
*PciIoDevice
103 Test whether device path is for root pci hot plug bus.
105 @param HpbDevicePath A pointer to device path data structure to be tested.
106 @param HpIndex If HpIndex is not NULL, return the index of root hot
107 plug in global array when TRUE is retuned.
109 @retval TRUE The device path is for root pci hot plug bus.
110 @retval FALSE The device path is not for root pci hot plug bus.
114 IsRootPciHotPlugBus (
115 IN EFI_DEVICE_PATH_PROTOCOL
*HpbDevicePath
,
116 OUT UINTN
*HpIndex OPTIONAL
120 Test whether device path is for root pci hot plug controller.
122 @param HpcDevicePath A pointer to device path data structure to be tested.
123 @param HpIndex If HpIndex is not NULL, return the index of root hot
124 plug in global array when TRUE is retuned.
126 @retval TRUE The device path is for root pci hot plug controller.
127 @retval FALSE The device path is not for root pci hot plug controller.
131 IsRootPciHotPlugController (
132 IN EFI_DEVICE_PATH_PROTOCOL
*HpcDevicePath
,
137 Creating event object for PCI Hot Plug controller.
139 @param HpIndex Index of hot plug device in global array.
140 @param Event The retuned event that invoke this function.
142 @return Status of create event invoken.
152 Wait for all root PCI Hot Plug controller finished initializing.
154 @param TimeoutInMicroSeconds Microseconds to wait for all root HPCs' initialization.
156 @retval EFI_SUCCESS All HPCs initialization finished.
157 @retval EFI_TIMEOUT Not ALL HPCs initialization finished in Microseconds.
161 AllRootHPCInitialized (
162 IN UINTN TimeoutInMicroSeconds
166 Check whether PCI-PCI bridge has PCI Hot Plug capability register block.
168 @param PciIoDevice A Pointer to the PCI-PCI bridge.
170 @retval TRUE PCI device is HPC.
171 @retval FALSE PCI device is not HPC.
176 IN PCI_IO_DEVICE
*PciIoDevice
180 Get resource padding if the specified PCI bridge is a hot plug bus.
182 @param PciIoDevice PCI bridge instance.
186 GetResourcePaddingForHpb (
187 IN PCI_IO_DEVICE
*PciIoDevice