3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 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
22 #define STALL_1_SECOND 1000000
30 extern EFI_PCI_HOT_PLUG_INIT_PROTOCOL
*gPciHotPlugInit
;
31 extern EFI_HPC_LOCATION
*gPciRootHpcPool
;
32 extern UINTN gPciRootHpcCount
;
33 extern ROOT_HPC_DATA
*gPciRootHpcData
;
36 Init HPC private data.
38 @param Event event object
39 @param Context HPC private data.
50 Compare two device path
52 @param DevicePath1 the first device path want to be compared
53 @param DevicePath2 the first device path want to be compared
56 @retval FALSE different
59 EfiCompareDevicePath (
60 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath1
,
61 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath2
66 Init hot plug support and root hot plug private data.
70 InitializeHotPlugSupport (
76 Test whether PCI device is hot plug bus.
78 @param PciIoDevice PCI device instance
80 @retval EFI_SUCCESS PCI device is hot plug bus
81 @retval EFI_NOT_FOUND PCI device is not hot plug bus
85 PCI_IO_DEVICE
*PciIoDevice
90 Test whether device path is for root pci hot plug bus
92 @param HpbdevicePath tested device path
93 @param HpIndex Return the index of root hot plug in global array.
95 @retval TRUE device path is for root pci hot plug
96 @retval FALSE device path is not for root pci hot plug
100 IN EFI_DEVICE_PATH_PROTOCOL
*HpbDevicePath
,
106 Test whether device path is for root pci hot plug controller
108 @param HpbdevicePath tested device path
109 @param HpIndex Return the index of root hot plug in global array.
111 @retval TRUE device path is for root pci hot plug controller
112 @retval FALSE device path is not for root pci hot plug controller
115 IsRootPciHotPlugController (
116 IN EFI_DEVICE_PATH_PROTOCOL
*HpcDevicePath
,
122 Wrapper for creating event object for HPC
124 @param HpIndex index of hot plug device in global array
125 @param Event event object
127 @return status of create event invoken
137 Wait for all root HPC initialized.
139 @param TimeoutInMicroSeconds microseconds to wait for all root hpc's initialization
142 AllRootHPCInitialized (
143 IN UINTN TimeoutInMicroSeconds
148 Check HPC capability register block
150 @param PciIoDevice PCI device instance
152 @retval EFI_SUCCESS PCI device is HPC
153 @retval EFI_NOT_FOUND PCI device is not HPC
157 PCI_IO_DEVICE
*PciIoDevice
162 Get resource padding for hot plug bus
164 @param PciIoDevice PCI device instance
166 @retval EFI_SUCCESS success get padding and set it into PCI device instance
167 @retval EFI_NOT_FOUND PCI device is not a hot plug bus.
170 GetResourcePaddingForHpb (
171 IN PCI_IO_DEVICE
*PciIoDevice