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
39 InstallHotPlugRequestProtocol (
46 TODO: Add function description
50 Status - TODO: add argument description
54 TODO: add return values
60 InstallPciHotplugGuid (
61 IN PCI_IO_DEVICE
*PciIoDevice
67 TODO: Add function description
71 PciIoDevice - TODO: add argument description
75 TODO: add return values
81 UninstallPciHotplugGuid (
82 IN PCI_IO_DEVICE
*PciIoDevice
88 TODO: Add function description
92 PciIoDevice - TODO: add argument description
96 TODO: add return values
103 IN PCI_IO_DEVICE
*PciIoDevice
109 TODO: Add function description
113 PciIoDevice - TODO: add argument description
117 TODO: add return values
123 RemoveRejectedPciDevices (
124 EFI_HANDLE RootBridgeHandle
,
125 IN PCI_IO_DEVICE
*Bridge
131 TODO: Add function description
135 RootBridgeHandle - TODO: add argument description
136 Bridge - TODO: add argument description
140 TODO: add return values
146 PciHostBridgeResourceAllocator (
147 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
153 TODO: Add function description
157 PciResAlloc - TODO: add argument description
161 TODO: add return values
167 PciHostBridgeResourceAllocator_WithoutHotPlugDeviceSupport (
168 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
173 PciHostBridgeResourceAllocator_WithHotPlugDeviceSupport (
174 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
180 IN PCI_IO_DEVICE
*Bridge
,
181 IN UINT8 StartBusNumber
,
182 OUT UINT8
*SubBusNumber
,
183 OUT UINT8
*PaddedBusRange
189 TODO: Add function description
193 Bridge - TODO: add argument description
194 StartBusNumber - TODO: add argument description
195 SubBusNumber - TODO: add argument description
196 PaddedBusRange - TODO: add argument description
200 TODO: add return values
206 PciScanBus_WithHotPlugDeviceSupport (
207 IN PCI_IO_DEVICE
*Bridge
,
208 IN UINT8 StartBusNumber
,
209 OUT UINT8
*SubBusNumber
,
210 OUT UINT8
*PaddedBusRange
215 PciScanBus_WithoutHotPlugDeviceSupport (
216 IN PCI_IO_DEVICE
*Bridge
,
217 IN UINT8 StartBusNumber
,
218 OUT UINT8
*SubBusNumber
,
219 OUT UINT8
*PaddedBusRange
224 PciRootBridgeP2CProcess (
225 IN PCI_IO_DEVICE
*Bridge
231 TODO: Add function description
235 Bridge - TODO: add argument description
239 TODO: add return values
245 PciHostBridgeP2CProcess (
246 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
252 TODO: Add function description
256 PciResAlloc - TODO: add argument description
260 TODO: add return values
266 PciHostBridgeEnumerator (
267 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
273 TODO: Add function description
277 PciResAlloc - TODO: add argument description
281 TODO: add return values
287 Read PCI configuration space through EFI_PCI_IO_PROTOCOL.
289 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.
290 @param Width Signifies the width of the memory operations.
291 @Param Address The address within the PCI configuration space for the PCI controller.
292 @param Buffer For read operations, the destination buffer to store the results. For
293 write operations, the source buffer to write data from.
295 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
296 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
297 @retval EFI_INVALID_PARAMETER Buffer is NULL.
298 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
303 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
304 IN EFI_PCI_IO_PROTOCOL_WIDTH Width
,
311 Write PCI configuration space through EFI_PCI_IO_PROTOCOL.
313 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.
314 @param Width Signifies the width of the memory operations.
315 @Param Address The address within the PCI configuration space for the PCI controller.
316 @param Buffer For read operations, the destination buffer to store the results. For
317 write operations, the source buffer to write data from.
319 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
320 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
321 @retval EFI_INVALID_PARAMETER Buffer is NULL.
322 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
327 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
328 IN EFI_PCI_IO_PROTOCOL_WIDTH Width
,
335 Write PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
337 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
338 @param Pci A pointer to PCI_TYPE00.
339 @param Width Signifies the width of the memory operations.
340 @Param Address The address within the PCI configuration space for the PCI controller.
341 @param Buffer For read operations, the destination buffer to store the results. For
342 write operations, the source buffer to write data from.
344 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
345 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
346 @retval EFI_INVALID_PARAMETER Buffer is NULL.
347 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
351 PciRootBridgeIoWrite (
352 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
*PciRootBridgeIo
,
354 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width
,
361 Read PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
363 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
364 @param Pci A pointer to PCI_TYPE00.
365 @param Width Signifies the width of the memory operations.
366 @Param Address The address within the PCI configuration space for the PCI controller.
367 @param Buffer For read operations, the destination buffer to store the results. For
368 write operations, the source buffer to write data from.
370 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
371 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
372 @retval EFI_INVALID_PARAMETER Buffer is NULL.
373 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
377 PciRootBridgeIoRead (
378 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
*PciRootBridgeIo
,
380 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width
,