]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.h
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciHotPlugSupport.h
CommitLineData
9060e3ec 1/** @file\r
2 PCI Hot Plug support functions declaration for PCI Bus module.\r
3\r
cd5ebaa0
HT
4Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
9060e3ec 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H_\r
16#define _EFI_PCI_HOT_PLUG_SUPPORT_H_\r
17\r
18//\r
19// stall 1 second, its unit is 100ns\r
20//\r
21#define STALL_1_SECOND 1000000\r
22\r
23//\r
24// PCI Hot Plug controller private data\r
25//\r
26typedef struct {\r
27 EFI_EVENT Event;\r
28 BOOLEAN Initialized;\r
29 VOID *Padding;\r
30} ROOT_HPC_DATA;\r
31\r
32//\r
33// Reference of some global variabes\r
34//\r
35extern EFI_PCI_HOT_PLUG_INIT_PROTOCOL *gPciHotPlugInit;\r
36extern EFI_HPC_LOCATION *gPciRootHpcPool;\r
37extern ROOT_HPC_DATA *gPciRootHpcData;\r
38\r
39/**\r
40 Event notification function to set Hot Plug controller status.\r
41\r
42 @param Event The event that invoke this function.\r
43 @param Context The calling context, pointer to ROOT_HPC_DATA.\r
44\r
45**/\r
46VOID\r
47EFIAPI\r
48PciHPCInitialized (\r
49 IN EFI_EVENT Event,\r
50 IN VOID *Context\r
51 );\r
52\r
53/**\r
54 Compare two device pathes to check if they are exactly same.\r
55\r
56 @param DevicePath1 A pointer to the first device path data structure.\r
57 @param DevicePath2 A pointer to the second device path data structure.\r
58\r
59 @retval TRUE They are same.\r
60 @retval FALSE They are not same.\r
61\r
62**/\r
63BOOLEAN\r
64EfiCompareDevicePath (\r
65 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,\r
66 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2\r
67 );\r
68\r
69/**\r
70 Check hot plug support and initialize root hot plug private data.\r
71\r
72 If Hot Plug is supported by the platform, call PCI Hot Plug Init protocol\r
73 to get PCI Hot Plug controller's information and constructor the root hot plug\r
74 private data structure.\r
75\r
76 @retval EFI_SUCCESS They are same.\r
77 @retval EFI_UNSUPPORTED No PCI Hot Plug controler on the platform.\r
78 @retval EFI_OUT_OF_RESOURCES No memory to constructor root hot plug private\r
79 data structure.\r
80\r
81**/\r
82EFI_STATUS\r
83InitializeHotPlugSupport (\r
84 VOID\r
85 );\r
86\r
87/**\r
88 Test whether PCI device is hot plug bus.\r
89\r
90 @param PciIoDevice PCI device instance.\r
91\r
92 @retval TRUE PCI device is a hot plug bus.\r
93 @retval FALSE PCI device is not a hot plug bus.\r
94\r
95**/\r
96BOOLEAN\r
97IsPciHotPlugBus (\r
98 PCI_IO_DEVICE *PciIoDevice\r
99 );\r
100\r
101/**\r
102 Test whether device path is for root pci hot plug bus.\r
103\r
104 @param HpbDevicePath A pointer to device path data structure to be tested.\r
105 @param HpIndex If HpIndex is not NULL, return the index of root hot\r
106 plug in global array when TRUE is retuned.\r
107\r
108 @retval TRUE The device path is for root pci hot plug bus.\r
109 @retval FALSE The device path is not for root pci hot plug bus.\r
110\r
111**/\r
112BOOLEAN\r
113IsRootPciHotPlugBus (\r
114 IN EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath,\r
115 OUT UINTN *HpIndex OPTIONAL\r
116 );\r
117\r
118/**\r
119 Test whether device path is for root pci hot plug controller.\r
120\r
121 @param HpcDevicePath A pointer to device path data structure to be tested.\r
122 @param HpIndex If HpIndex is not NULL, return the index of root hot\r
123 plug in global array when TRUE is retuned.\r
124\r
125 @retval TRUE The device path is for root pci hot plug controller.\r
126 @retval FALSE The device path is not for root pci hot plug controller.\r
127\r
128**/\r
129BOOLEAN\r
130IsRootPciHotPlugController (\r
131 IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,\r
132 OUT UINTN *HpIndex\r
133 );\r
134\r
135/**\r
136 Creating event object for PCI Hot Plug controller.\r
137\r
138 @param HpIndex Index of hot plug device in global array.\r
139 @param Event The retuned event that invoke this function.\r
140\r
141 @return Status of create event invoken.\r
142\r
143**/\r
144EFI_STATUS\r
145CreateEventForHpc (\r
146 IN UINTN HpIndex,\r
147 OUT EFI_EVENT *Event\r
148 );\r
149\r
150/**\r
151 Wait for all root PCI Hot Plug controller finished initializing.\r
152\r
153 @param TimeoutInMicroSeconds Microseconds to wait for all root HPCs' initialization.\r
154\r
155 @retval EFI_SUCCESS All HPCs initialization finished.\r
156 @retval EFI_TIMEOUT Not ALL HPCs initialization finished in Microseconds.\r
157\r
158**/\r
159EFI_STATUS\r
160AllRootHPCInitialized (\r
161 IN UINTN TimeoutInMicroSeconds\r
162 );\r
163\r
164/**\r
165 Check whether PCI-PCI bridge has PCI Hot Plug capability register block.\r
166\r
167 @param PciIoDevice A Pointer to the PCI-PCI bridge.\r
168\r
169 @retval TRUE PCI device is HPC.\r
170 @retval FALSE PCI device is not HPC.\r
171\r
172**/\r
173BOOLEAN\r
174IsSHPC (\r
175 IN PCI_IO_DEVICE *PciIoDevice\r
176 );\r
177\r
178/**\r
179 Get resource padding if the specified PCI bridge is a hot plug bus.\r
180\r
181 @param PciIoDevice PCI bridge instance.\r
182\r
183**/\r
184VOID\r
185GetResourcePaddingForHpb (\r
186 IN PCI_IO_DEVICE *PciIoDevice\r
187 );\r
188\r
189#endif\r