]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.h
1. Added EdkPciIncompatibleDeviceSupportLib in EdkModulePkg, this library is used...
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / PciBus / Dxe / PciLib.h
CommitLineData
878ddf1f 1/*++\r
2\r
98419ef4 3Copyright (c) 2006 - 2007, 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
878ddf1f 11\r
12Module Name:\r
13\r
14 PciLib.h\r
98419ef4 15\r
878ddf1f 16Abstract:\r
17\r
6874dbd0 18 PCI Bus Driver Lib header file.\r
19 Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable\r
20 support hot plug.\r
878ddf1f 21\r
22Revision History\r
23\r
24--*/\r
25\r
26#ifndef _EFI_PCI_LIB_H\r
27#define _EFI_PCI_LIB_H\r
28\r
98419ef4 29//\r
30// Mask definistions for PCD PcdPciIncompatibleDeviceSupportMask\r
31//\r
32#define PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT 0x01\r
33#define PCI_INCOMPATIBLE_READ_SUPPORT 0x02\r
34#define PCI_INCOMPATIBLE_WRITE_SUPPORT 0x04\r
35#define PCI_INCOMPATIBLE_REGISTER_UPDATE_SUPPORT 0x08\r
36#define PCI_INCOMPATIBLE_ACCESS_WIDTH_SUPPORT 0x0a\r
37\r
878ddf1f 38VOID\r
39InstallHotPlugRequestProtocol (\r
40 IN EFI_STATUS *Status\r
41 )\r
42/*++\r
43\r
44Routine Description:\r
45\r
46 TODO: Add function description\r
47\r
48Arguments:\r
49\r
50 Status - TODO: add argument description\r
51\r
52Returns:\r
53\r
54 TODO: add return values\r
55\r
56--*/\r
57;\r
58\r
59VOID\r
60InstallPciHotplugGuid (\r
61 IN PCI_IO_DEVICE *PciIoDevice\r
62 )\r
63/*++\r
64\r
65Routine Description:\r
66\r
67 TODO: Add function description\r
68\r
69Arguments:\r
70\r
71 PciIoDevice - TODO: add argument description\r
72\r
73Returns:\r
74\r
75 TODO: add return values\r
76\r
77--*/\r
78;\r
79\r
80VOID\r
81UninstallPciHotplugGuid (\r
82 IN PCI_IO_DEVICE *PciIoDevice\r
83 )\r
84/*++\r
85\r
86Routine Description:\r
87\r
88 TODO: Add function description\r
89\r
90Arguments:\r
91\r
92 PciIoDevice - TODO: add argument description\r
93\r
94Returns:\r
95\r
96 TODO: add return values\r
97\r
98--*/\r
99;\r
100\r
101VOID\r
102GetBackPcCardBar (\r
103 IN PCI_IO_DEVICE *PciIoDevice\r
104 )\r
105/*++\r
106\r
107Routine Description:\r
108\r
109 TODO: Add function description\r
110\r
111Arguments:\r
112\r
113 PciIoDevice - TODO: add argument description\r
114\r
115Returns:\r
116\r
117 TODO: add return values\r
118\r
119--*/\r
120;\r
121\r
122EFI_STATUS\r
123RemoveRejectedPciDevices (\r
124 EFI_HANDLE RootBridgeHandle,\r
125 IN PCI_IO_DEVICE *Bridge\r
126 )\r
127/*++\r
128\r
129Routine Description:\r
130\r
131 TODO: Add function description\r
132\r
133Arguments:\r
134\r
135 RootBridgeHandle - TODO: add argument description\r
136 Bridge - TODO: add argument description\r
137\r
138Returns:\r
139\r
140 TODO: add return values\r
141\r
142--*/\r
143;\r
144\r
145EFI_STATUS\r
146PciHostBridgeResourceAllocator (\r
147 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r
148 )\r
149/*++\r
150\r
151Routine Description:\r
152\r
153 TODO: Add function description\r
154\r
155Arguments:\r
156\r
157 PciResAlloc - TODO: add argument description\r
158\r
159Returns:\r
160\r
161 TODO: add return values\r
162\r
163--*/\r
164;\r
165\r
6874dbd0 166EFI_STATUS\r
167PciHostBridgeResourceAllocator_WithoutHotPlugDeviceSupport (\r
168 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r
169 )\r
170;\r
171\r
172EFI_STATUS\r
173PciHostBridgeResourceAllocator_WithHotPlugDeviceSupport (\r
174 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r
175 )\r
176;\r
177\r
878ddf1f 178EFI_STATUS\r
179PciScanBus (\r
180 IN PCI_IO_DEVICE *Bridge,\r
181 IN UINT8 StartBusNumber,\r
182 OUT UINT8 *SubBusNumber,\r
183 OUT UINT8 *PaddedBusRange\r
184 )\r
185/*++\r
186\r
187Routine Description:\r
188\r
189 TODO: Add function description\r
190\r
191Arguments:\r
192\r
193 Bridge - TODO: add argument description\r
194 StartBusNumber - TODO: add argument description\r
195 SubBusNumber - TODO: add argument description\r
196 PaddedBusRange - TODO: add argument description\r
197\r
198Returns:\r
199\r
200 TODO: add return values\r
201\r
202--*/\r
203;\r
204\r
6874dbd0 205EFI_STATUS\r
206PciScanBus_WithHotPlugDeviceSupport (\r
207 IN PCI_IO_DEVICE *Bridge,\r
208 IN UINT8 StartBusNumber,\r
209 OUT UINT8 *SubBusNumber,\r
210 OUT UINT8 *PaddedBusRange\r
211 )\r
212;\r
213\r
214EFI_STATUS\r
215PciScanBus_WithoutHotPlugDeviceSupport (\r
216 IN PCI_IO_DEVICE *Bridge,\r
217 IN UINT8 StartBusNumber,\r
218 OUT UINT8 *SubBusNumber,\r
219 OUT UINT8 *PaddedBusRange\r
220 )\r
221;\r
222\r
878ddf1f 223EFI_STATUS\r
224PciRootBridgeP2CProcess (\r
225 IN PCI_IO_DEVICE *Bridge\r
226 )\r
227/*++\r
228\r
229Routine Description:\r
230\r
231 TODO: Add function description\r
232\r
233Arguments:\r
234\r
235 Bridge - TODO: add argument description\r
236\r
237Returns:\r
238\r
239 TODO: add return values\r
240\r
241--*/\r
242;\r
243\r
244EFI_STATUS\r
245PciHostBridgeP2CProcess (\r
246 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r
247 )\r
248/*++\r
249\r
250Routine Description:\r
251\r
252 TODO: Add function description\r
253\r
254Arguments:\r
255\r
256 PciResAlloc - TODO: add argument description\r
257\r
258Returns:\r
259\r
260 TODO: add return values\r
261\r
262--*/\r
263;\r
264\r
265EFI_STATUS\r
266PciHostBridgeEnumerator (\r
267 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r
268 )\r
269/*++\r
270\r
271Routine Description:\r
272\r
273 TODO: Add function description\r
274\r
275Arguments:\r
276\r
277 PciResAlloc - TODO: add argument description\r
278\r
279Returns:\r
280\r
281 TODO: add return values\r
282\r
283--*/\r
284;\r
285\r
98419ef4 286/**\r
287 Read PCI configuration space through EFI_PCI_IO_PROTOCOL.\r
288\r
289 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.\r
290 @param Width Signifies the width of the memory operations.\r
291 @Param Address The address within the PCI configuration space for the PCI controller.\r
292 @param Buffer For read operations, the destination buffer to store the results. For\r
293 write operations, the source buffer to write data from.\r
294\r
295 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
296 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r
297 @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
298 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
299\r
300**/\r
301EFI_STATUS\r
302PciIoRead (\r
303 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
304 IN EFI_PCI_IO_PROTOCOL_WIDTH Width,\r
305 IN UINT32 Address,\r
306 IN UINTN Count,\r
307 IN OUT VOID *Buffer\r
308 );\r
309\r
310/**\r
311 Write PCI configuration space through EFI_PCI_IO_PROTOCOL.\r
312\r
313 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.\r
314 @param Width Signifies the width of the memory operations.\r
315 @Param Address The address within the PCI configuration space for the PCI controller.\r
316 @param Buffer For read operations, the destination buffer to store the results. For\r
317 write operations, the source buffer to write data from.\r
318\r
319 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
320 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r
321 @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
322 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
323\r
324**/\r
325EFI_STATUS\r
326PciIoWrite (\r
327 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
328 IN EFI_PCI_IO_PROTOCOL_WIDTH Width,\r
329 IN UINT32 Address,\r
330 IN UINTN Count,\r
331 IN OUT VOID *Buffer\r
332 );\r
333\r
334/**\r
335 Write PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
336\r
337 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
338 @param Pci A pointer to PCI_TYPE00.\r
339 @param Width Signifies the width of the memory operations.\r
340 @Param Address The address within the PCI configuration space for the PCI controller.\r
341 @param Buffer For read operations, the destination buffer to store the results. For\r
342 write operations, the source buffer to write data from.\r
343\r
344 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
345 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r
346 @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
347 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
348\r
349**/\r
350EFI_STATUS\r
351PciRootBridgeIoWrite (\r
352 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,\r
353 IN PCI_TYPE00 *Pci,\r
354 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r
355 IN UINT64 Address,\r
356 IN UINTN Count,\r
357 IN OUT VOID *Buffer\r
358 );\r
359\r
360/**\r
361 Read PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
362\r
363 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
364 @param Pci A pointer to PCI_TYPE00.\r
365 @param Width Signifies the width of the memory operations.\r
366 @Param Address The address within the PCI configuration space for the PCI controller.\r
367 @param Buffer For read operations, the destination buffer to store the results. For\r
368 write operations, the source buffer to write data from.\r
369\r
370 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
371 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r
372 @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
373 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
374\r
375**/\r
376EFI_STATUS\r
377PciRootBridgeIoRead (\r
378 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,\r
379 IN PCI_TYPE00 *Pci,\r
380 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r
381 IN UINT64 Address,\r
382 IN UINTN Count,\r
383 IN OUT VOID *Buffer\r
384 );\r
878ddf1f 385#endif\r