]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.h
4f5037136c5fb7dcba1e38b3fc6e25dfe51490d3
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciHotPlugSupport.h
1 /**@file
2
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
8
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.
11
12 **/
13
14
15 #ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H
16 #define _EFI_PCI_HOT_PLUG_SUPPORT_H
17
18
19 //
20 // stall 1 second
21 //
22 #define STALL_1_SECOND 1000000
23
24 typedef struct {
25 EFI_EVENT Event;
26 BOOLEAN Initialized;
27 VOID *Padding;
28 } ROOT_HPC_DATA;
29
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;
34
35 /**
36 Init HPC private data.
37
38 @param Event event object
39 @param Context HPC private data.
40 **/
41 VOID
42 EFIAPI
43 PciHPCInitialized (
44 IN EFI_EVENT Event,
45 IN VOID *Context
46 )
47 ;
48
49 /**
50 Compare two device path
51
52 @param DevicePath1 the first device path want to be compared
53 @param DevicePath2 the first device path want to be compared
54
55 @retval TRUE equal
56 @retval FALSE different
57 **/
58 BOOLEAN
59 EfiCompareDevicePath (
60 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
61 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
62 )
63 ;
64
65 /**
66 Init hot plug support and root hot plug private data.
67
68 **/
69 EFI_STATUS
70 InitializeHotPlugSupport (
71 VOID
72 )
73 ;
74
75 /**
76 Test whether PCI device is hot plug bus.
77
78 @param PciIoDevice PCI device instance
79
80 @retval EFI_SUCCESS PCI device is hot plug bus
81 @retval EFI_NOT_FOUND PCI device is not hot plug bus
82 **/
83 EFI_STATUS
84 IsPciHotPlugBus (
85 PCI_IO_DEVICE *PciIoDevice
86 )
87 ;
88
89 /**
90 Test whether device path is for root pci hot plug bus
91
92 @param HpbdevicePath tested device path
93 @param HpIndex Return the index of root hot plug in global array.
94
95 @retval TRUE device path is for root pci hot plug
96 @retval FALSE device path is not for root pci hot plug
97 **/
98 BOOLEAN
99 IsRootPciHotPlugBus (
100 IN EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath,
101 OUT UINTN *HpIndex
102 )
103 ;
104
105 /**
106 Test whether device path is for root pci hot plug controller
107
108 @param HpbdevicePath tested device path
109 @param HpIndex Return the index of root hot plug in global array.
110
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
113 **/
114 BOOLEAN
115 IsRootPciHotPlugController (
116 IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
117 OUT UINTN *HpIndex
118 )
119 ;
120
121 /**
122 Wrapper for creating event object for HPC
123
124 @param HpIndex index of hot plug device in global array
125 @param Event event object
126
127 @return status of create event invoken
128 **/
129 EFI_STATUS
130 CreateEventForHpc (
131 IN UINTN HpIndex,
132 OUT EFI_EVENT *Event
133 )
134 ;
135
136 /**
137 Wait for all root HPC initialized.
138
139 @param TimeoutInMicroSeconds microseconds to wait for all root hpc's initialization
140 **/
141 EFI_STATUS
142 AllRootHPCInitialized (
143 IN UINTN TimeoutInMicroSeconds
144 )
145 ;
146
147 /**
148 Check HPC capability register block
149
150 @param PciIoDevice PCI device instance
151
152 @retval EFI_SUCCESS PCI device is HPC
153 @retval EFI_NOT_FOUND PCI device is not HPC
154 **/
155 EFI_STATUS
156 IsSHPC (
157 PCI_IO_DEVICE *PciIoDevice
158 )
159 ;
160
161 /**
162 Get resource padding for hot plug bus
163
164 @param PciIoDevice PCI device instance
165
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.
168 **/
169 EFI_STATUS
170 GetResourcePaddingForHpb (
171 IN PCI_IO_DEVICE *PciIoDevice
172 )
173 ;
174
175 #endif