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