]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.h
clean up the un-suitable ';' location when declaring the functions.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciEnumeratorSupport.h
... / ...
CommitLineData
1/**@file\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12**/\r
13\r
14\r
15#ifndef _EFI_PCI_ENUMERATOR_SUPPORT_H\r
16#define _EFI_PCI_ENUMERATOR_SUPPORT_H\r
17\r
18/**\r
19 This routine is used to check whether the pci device is present.\r
20 \r
21 @param PciRootBridgeIo Pointer to instance of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL\r
22 @param Pci Output buffer for PCI device structure\r
23 @param Bus PCI bus NO\r
24 @param Device PCI device NO\r
25 @param Func PCI Func NO\r
26 \r
27 @retval EFI_NOT_FOUND device not present\r
28 @retval EFI_SUCCESS device is found.\r
29**/\r
30EFI_STATUS\r
31PciDevicePresent (\r
32 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,\r
33 PCI_TYPE00 *Pci,\r
34 UINT8 Bus,\r
35 UINT8 Device,\r
36 UINT8 Func\r
37 );\r
38\r
39/**\r
40 Collect all the resource information under this root bridge\r
41 A database that records all the information about pci device subject to this\r
42 root bridge will then be created.\r
43 \r
44 @param Bridge Parent bridge instance\r
45 @param StartBusNumer Bus number of begining \r
46**/\r
47EFI_STATUS\r
48PciPciDeviceInfoCollector (\r
49 IN PCI_IO_DEVICE *Bridge,\r
50 UINT8 StartBusNumber\r
51 );\r
52\r
53/**\r
54 Seach required device and get PCI device info block\r
55 \r
56 @param Bridge Parent bridge instance\r
57 @param Pci Output of PCI device info block\r
58 @param Bus PCI bus NO.\r
59 @param Device PCI device NO.\r
60 @param Func PCI func NO.\r
61 @param PciDevice output of searched PCI device instance\r
62**/\r
63EFI_STATUS\r
64PciSearchDevice (\r
65 IN PCI_IO_DEVICE *Bridge,\r
66 PCI_TYPE00 *Pci,\r
67 UINT8 Bus,\r
68 UINT8 Device,\r
69 UINT8 Func,\r
70 PCI_IO_DEVICE **PciDevice\r
71 );\r
72\r
73/**\r
74 Create PCI private data for PCI device\r
75 \r
76 @param Bridge Parent bridge instance\r
77 @param Pci PCI bar block\r
78 @param Bus PCI device Bus NO.\r
79 @param Device PCI device DeviceNO.\r
80 @param Func PCI device's func NO.\r
81 \r
82 @return new PCI device's private date structure.\r
83**/\r
84PCI_IO_DEVICE *\r
85GatherDeviceInfo (\r
86 IN PCI_IO_DEVICE *Bridge,\r
87 IN PCI_TYPE00 *Pci,\r
88 UINT8 Bus,\r
89 UINT8 Device,\r
90 UINT8 Func\r
91 );\r
92\r
93/**\r
94 Create private data for bridge device's PPB.\r
95 \r
96 @param Bridge Parent bridge \r
97 @param Pci Pci device block\r
98 @param Bus Bridge device's bus NO.\r
99 @param Device Bridge device's device NO.\r
100 @param Func Bridge device's func NO.\r
101 \r
102 @return bridge device instance\r
103**/\r
104PCI_IO_DEVICE *\r
105GatherPpbInfo (\r
106 IN PCI_IO_DEVICE *Bridge,\r
107 IN PCI_TYPE00 *Pci,\r
108 UINT8 Bus,\r
109 UINT8 Device,\r
110 UINT8 Func\r
111 );\r
112\r
113/**\r
114 Create private data for hotplug bridge device\r
115 \r
116 @param Bridge Parent bridge instance\r
117 @param Pci PCI bar block\r
118 @param Bus hotplug bridge device's bus NO.\r
119 @param Device hotplug bridge device's device NO.\r
120 @param Func hotplug bridge device's Func NO.\r
121 \r
122 @return hotplug bridge device instance\r
123**/\r
124PCI_IO_DEVICE *\r
125GatherP2CInfo (\r
126 IN PCI_IO_DEVICE *Bridge,\r
127 IN PCI_TYPE00 *Pci,\r
128 UINT8 Bus,\r
129 UINT8 Device,\r
130 UINT8 Func\r
131 );\r
132\r
133/**\r
134 Create device path for pci deivce\r
135 \r
136 @param ParentDevicePath Parent bridge's path\r
137 @param PciIoDevice Pci device instance\r
138 \r
139 @return device path protocol instance for specific pci device.\r
140**/\r
141EFI_DEVICE_PATH_PROTOCOL *\r
142CreatePciDevicePath (\r
143 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
144 IN PCI_IO_DEVICE *PciIoDevice\r
145 );\r
146\r
147/**\r
148 Check the bar is existed or not.\r
149\r
150 @param PciIoDevice - A pointer to the PCI_IO_DEVICE.\r
151 @param Offset - The offset.\r
152 @param BarLengthValue - The bar length value.\r
153 @param OriginalBarValue - The original bar value.\r
154\r
155 @retval EFI_NOT_FOUND - The bar don't exist.\r
156 @retval EFI_SUCCESS - The bar exist.\r
157\r
158**/\r
159EFI_STATUS\r
160BarExisted (\r
161 IN PCI_IO_DEVICE *PciIoDevice,\r
162 IN UINTN Offset,\r
163 OUT UINT32 *BarLengthValue,\r
164 OUT UINT32 *OriginalBarValue\r
165 );\r
166\r
167/**\r
168 Test whether the device can support attributes \r
169 \r
170 @param PciIoDevice Pci device instance\r
171 @param Command Command register value.\r
172 @param BridgeControl Bridge control value for PPB or P2C.\r
173 @param OldCommand Old command register offset\r
174 @param OldBridgeControl Old Bridge control value for PPB or P2C.\r
175 \r
176 @return EFI_SUCCESS\r
177**/\r
178EFI_STATUS\r
179PciTestSupportedAttribute (\r
180 IN PCI_IO_DEVICE *PciIoDevice,\r
181 IN UINT16 *Command,\r
182 IN UINT16 *BridgeControl,\r
183 IN UINT16 *OldCommand,\r
184 IN UINT16 *OldBridgeControl\r
185 );\r
186\r
187/**\r
188 Set the supported or current attributes of a PCI device\r
189 \r
190 @param PciIoDevice - Structure pointer for PCI device.\r
191 @param Command - Command register value.\r
192 @param BridgeControl - Bridge control value for PPB or P2C.\r
193 @param Option - Make a choice of EFI_SET_SUPPORTS or EFI_SET_ATTRIBUTES.\r
194 \r
195**/\r
196EFI_STATUS\r
197PciSetDeviceAttribute (\r
198 IN PCI_IO_DEVICE *PciIoDevice,\r
199 IN UINT16 Command,\r
200 IN UINT16 BridgeControl,\r
201 IN UINTN Option\r
202 );\r
203\r
204/**\r
205 Determine if the device can support Fast Back to Back attribute\r
206 \r
207 @param PciIoDevice Pci device instance\r
208 @param StatusIndex Status register value\r
209**/\r
210EFI_STATUS\r
211GetFastBackToBackSupport (\r
212 IN PCI_IO_DEVICE *PciIoDevice,\r
213 IN UINT8 StatusIndex\r
214 );\r
215\r
216/**\r
217 Determine the related attributes of all devices under a Root Bridge\r
218 \r
219 @param PciIoDevice PCI device instance\r
220 \r
221**/\r
222EFI_STATUS\r
223DetermineDeviceAttribute (\r
224 IN PCI_IO_DEVICE *PciIoDevice\r
225 );\r
226\r
227/**\r
228 This routine is used to update the bar information for those incompatible PCI device\r
229 \r
230 @param PciIoDevice Pci device instance\r
231 @return EFI_UNSUPPORTED failed to update Pci Info\r
232**/\r
233EFI_STATUS\r
234UpdatePciInfo (\r
235 IN PCI_IO_DEVICE *PciIoDevice\r
236 );\r
237\r
238/**\r
239 This routine will update the alignment with the new alignment\r
240 \r
241 @param Alignment old alignment\r
242 @param NewAlignment new alignment\r
243 \r
244**/\r
245VOID\r
246SetNewAlign (\r
247 IN UINT64 *Alignment,\r
248 IN UINT64 NewAlignment\r
249 );\r
250\r
251/**\r
252 Parse PCI bar bit.\r
253 \r
254 @param PciIoDevice Pci device instance\r
255 @param Offset bar offset\r
256 @param BarIndex bar index\r
257 \r
258 @return next bar offset.\r
259**/\r
260UINTN\r
261PciParseBar (\r
262 IN PCI_IO_DEVICE *PciIoDevice,\r
263 IN UINTN Offset,\r
264 IN UINTN BarIndex\r
265 );\r
266\r
267/**\r
268 This routine is used to initialize the bar of a PCI device\r
269 It can be called typically when a device is going to be rejected\r
270\r
271 @param PciIoDevice Pci device instance\r
272**/\r
273EFI_STATUS\r
274InitializePciDevice (\r
275 IN PCI_IO_DEVICE *PciIoDevice\r
276 );\r
277\r
278/**\r
279 Init PPB for bridge device\r
280 \r
281 @param PciIoDevice Pci device instance\r
282**/\r
283EFI_STATUS\r
284InitializePpb (\r
285 IN PCI_IO_DEVICE *PciIoDevice\r
286 );\r
287\r
288/**\r
289 Init private data for Hotplug bridge device\r
290 \r
291 @param PciIoDevice hotplug bridge device\r
292**/\r
293EFI_STATUS\r
294InitializeP2C (\r
295 IN PCI_IO_DEVICE *PciIoDevice\r
296 );\r
297\r
298/**\r
299 Create and initiliaze general PCI I/O device instance for\r
300 PCI device/bridge device/hotplug bridge device.\r
301 \r
302 @param PciRootBridgeIo Pointer to instance of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL\r
303 @param Pci Pci bar block\r
304 @param Bus device Bus NO.\r
305 @param Device device device NO.\r
306 @param Func device func NO.\r
307 \r
308 @return instance of PCI device\r
309**/\r
310PCI_IO_DEVICE *\r
311CreatePciIoDevice (\r
312 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,\r
313 IN PCI_TYPE00 *Pci,\r
314 UINT8 Bus,\r
315 UINT8 Device,\r
316 UINT8 Func\r
317 );\r
318\r
319/**\r
320 This routine is used to enumerate entire pci bus system\r
321 in a given platform\r
322 It is only called on the second start on the same Root Bridge.\r
323\r
324 @param Controller Parent bridge handler\r
325 \r
326 @return status of operation.\r
327**/\r
328EFI_STATUS\r
329PciEnumeratorLight (\r
330 IN EFI_HANDLE Controller\r
331 );\r
332\r
333/**\r
334 Get bus range.\r
335 \r
336 @param Descriptors A pointer to the address space descriptor.\r
337 @param MinBus The min bus.\r
338 @param MaxBus The max bus.\r
339 @param BusRange The bus range.\r
340 \r
341 @retval EFI_SUCCESS Success operation.\r
342 @retval EFI_NOT_FOUND can not find the specific bus.\r
343**/\r
344EFI_STATUS\r
345PciGetBusRange (\r
346 IN EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors,\r
347 OUT UINT16 *MinBus,\r
348 OUT UINT16 *MaxBus,\r
349 OUT UINT16 *BusRange\r
350 );\r
351\r
352EFI_STATUS\r
353StartManagingRootBridge (\r
354 IN PCI_IO_DEVICE *RootBridgeDev\r
355 );\r
356\r
357/**\r
358 This routine can be used to check whether a PCI device should be rejected when light enumeration\r
359\r
360 @param PciIoDevice Pci device instance\r
361\r
362 @retval TRUE This device should be rejected\r
363 @retval FALSE This device shouldn't be rejected\r
364 \r
365**/\r
366BOOLEAN\r
367IsPciDeviceRejected (\r
368 IN PCI_IO_DEVICE *PciIoDevice\r
369 );\r
370\r
371#endif\r