3 Copyright (c) 2006 - 2007, 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
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.
18 PCI Bus Driver Lib header file.
19 Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable
26 #ifndef _EFI_PCI_LIB_H
27 #define _EFI_PCI_LIB_H
30 // Mask definistions for PCD PcdPciIncompatibleDeviceSupportMask
32 #define PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT 0x01
33 #define PCI_INCOMPATIBLE_READ_SUPPORT 0x02
34 #define PCI_INCOMPATIBLE_WRITE_SUPPORT 0x04
35 #define PCI_INCOMPATIBLE_REGISTER_UPDATE_SUPPORT 0x08
36 #define PCI_INCOMPATIBLE_ACCESS_WIDTH_SUPPORT 0x0a
40 } EFI_DEVICE_HANDLE_EXTENDED_DATA_PAYLOAD
;
44 UINT16 DevicePathSize
;
50 } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA_PAYLOAD
;
53 InstallHotPlugRequestProtocol (
60 TODO: Add function description
64 Status - TODO: add argument description
68 TODO: add return values
74 InstallPciHotplugGuid (
75 IN PCI_IO_DEVICE
*PciIoDevice
81 TODO: Add function description
85 PciIoDevice - TODO: add argument description
89 TODO: add return values
95 UninstallPciHotplugGuid (
96 IN PCI_IO_DEVICE
*PciIoDevice
102 TODO: Add function description
106 PciIoDevice - TODO: add argument description
110 TODO: add return values
117 IN PCI_IO_DEVICE
*PciIoDevice
123 TODO: Add function description
127 PciIoDevice - TODO: add argument description
131 TODO: add return values
137 RemoveRejectedPciDevices (
138 EFI_HANDLE RootBridgeHandle
,
139 IN PCI_IO_DEVICE
*Bridge
145 TODO: Add function description
149 RootBridgeHandle - TODO: add argument description
150 Bridge - TODO: add argument description
154 TODO: add return values
160 PciHostBridgeResourceAllocator (
161 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
167 TODO: Add function description
171 PciResAlloc - TODO: add argument description
175 TODO: add return values
181 PciHostBridgeResourceAllocator_WithoutHotPlugDeviceSupport (
182 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
187 PciHostBridgeResourceAllocator_WithHotPlugDeviceSupport (
188 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
194 IN PCI_IO_DEVICE
*Bridge
,
195 IN UINT8 StartBusNumber
,
196 OUT UINT8
*SubBusNumber
,
197 OUT UINT8
*PaddedBusRange
203 TODO: Add function description
207 Bridge - TODO: add argument description
208 StartBusNumber - TODO: add argument description
209 SubBusNumber - TODO: add argument description
210 PaddedBusRange - TODO: add argument description
214 TODO: add return values
220 PciScanBus_WithHotPlugDeviceSupport (
221 IN PCI_IO_DEVICE
*Bridge
,
222 IN UINT8 StartBusNumber
,
223 OUT UINT8
*SubBusNumber
,
224 OUT UINT8
*PaddedBusRange
229 PciScanBus_WithoutHotPlugDeviceSupport (
230 IN PCI_IO_DEVICE
*Bridge
,
231 IN UINT8 StartBusNumber
,
232 OUT UINT8
*SubBusNumber
,
233 OUT UINT8
*PaddedBusRange
238 PciRootBridgeP2CProcess (
239 IN PCI_IO_DEVICE
*Bridge
245 TODO: Add function description
249 Bridge - TODO: add argument description
253 TODO: add return values
259 PciHostBridgeP2CProcess (
260 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
266 TODO: Add function description
270 PciResAlloc - TODO: add argument description
274 TODO: add return values
280 PciHostBridgeEnumerator (
281 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
287 TODO: Add function description
291 PciResAlloc - TODO: add argument description
295 TODO: add return values
301 Read PCI configuration space through EFI_PCI_IO_PROTOCOL.
303 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.
304 @param Width Signifies the width of the memory operations.
305 @Param Address The address within the PCI configuration space for the PCI controller.
306 @param Buffer For read operations, the destination buffer to store the results. For
307 write operations, the source buffer to write data from.
309 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
310 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
311 @retval EFI_INVALID_PARAMETER Buffer is NULL.
312 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
317 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
318 IN EFI_PCI_IO_PROTOCOL_WIDTH Width
,
325 Write PCI configuration space through EFI_PCI_IO_PROTOCOL.
327 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.
328 @param Width Signifies the width of the memory operations.
329 @Param Address The address within the PCI configuration space for the PCI controller.
330 @param Buffer For read operations, the destination buffer to store the results. For
331 write operations, the source buffer to write data from.
333 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
334 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
335 @retval EFI_INVALID_PARAMETER Buffer is NULL.
336 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
341 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
342 IN EFI_PCI_IO_PROTOCOL_WIDTH Width
,
349 Write PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
351 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
352 @param Pci A pointer to PCI_TYPE00.
353 @param Width Signifies the width of the memory operations.
354 @Param Address The address within the PCI configuration space for the PCI controller.
355 @param Buffer For read operations, the destination buffer to store the results. For
356 write operations, the source buffer to write data from.
358 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
359 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
360 @retval EFI_INVALID_PARAMETER Buffer is NULL.
361 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
365 PciRootBridgeIoWrite (
366 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
*PciRootBridgeIo
,
368 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width
,
375 Read PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
377 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
378 @param Pci A pointer to PCI_TYPE00.
379 @param Width Signifies the width of the memory operations.
380 @Param Address The address within the PCI configuration space for the PCI controller.
381 @param Buffer For read operations, the destination buffer to store the results. For
382 write operations, the source buffer to write data from.
384 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
385 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
386 @retval EFI_INVALID_PARAMETER Buffer is NULL.
387 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
391 PciRootBridgeIoRead (
392 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
*PciRootBridgeIo
,
394 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width
,