TianoCore EDK2 master
Loading...
Searching...
No Matches
PciLib.h File Reference

Go to the source code of this file.

Data Structures

struct  EFI_DEVICE_HANDLE_EXTENDED_DATA_PAYLOAD
 
struct  EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA_PAYLOAD
 

Enumerations

enum  PCI_RESIZABLE_BAR_OPERATION { PciResizableBarMin = 0x00 , PciResizableBarMax = 0xFF }
 

Functions

VOID GetBackPcCardBar (IN PCI_IO_DEVICE *PciIoDevice)
 
VOID RemoveRejectedPciDevices (IN EFI_HANDLE RootBridgeHandle, IN PCI_IO_DEVICE *Bridge)
 
EFI_STATUS PciHostBridgeResourceAllocator (IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc)
 
EFI_STATUS PciAllocateBusNumber (IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber, IN UINT8 NumberOfBuses, OUT UINT8 *NextBusNumber)
 
EFI_STATUS PciScanBus (IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber, OUT UINT8 *SubBusNumber, OUT UINT8 *PaddedBusRange)
 
EFI_STATUS PciRootBridgeP2CProcess (IN PCI_IO_DEVICE *Bridge)
 
EFI_STATUS PciHostBridgeP2CProcess (IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc)
 
EFI_STATUS PciHostBridgeEnumerator (IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc)
 
EFI_STATUS PciProgramResizableBar (IN PCI_IO_DEVICE *PciIoDevice, IN PCI_RESIZABLE_BAR_OPERATION ResizableBarOp)
 

Detailed Description

Internal library declaration for PCI Bus module.

Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PciLib.h.

Enumeration Type Documentation

◆ PCI_RESIZABLE_BAR_OPERATION

enum PCI_RESIZABLE_BAR_OPERATION

Definition at line 26 of file PciLib.h.

Function Documentation

◆ GetBackPcCardBar()

VOID GetBackPcCardBar ( IN PCI_IO_DEVICE PciIoDevice)

Retrieve the PCI Card device BAR information via PciIo interface.

Parameters
PciIoDevicePCI Card device instance.

Definition at line 73 of file PciLib.c.

◆ PciAllocateBusNumber()

EFI_STATUS PciAllocateBusNumber ( IN PCI_IO_DEVICE Bridge,
IN UINT8  StartBusNumber,
IN UINT8  NumberOfBuses,
OUT UINT8 *  NextBusNumber 
)

Allocate NumberOfBuses buses and return the next available PCI bus number.

Parameters
BridgeBridge device instance.
StartBusNumberCurrent available PCI bus number.
NumberOfBusesNumber of buses enumerated below the StartBusNumber.
NextBusNumberNext available PCI bus number.
Return values
EFI_SUCCESSAvailable bus number resource is enough. Next available PCI bus number is returned in NextBusNumber.
EFI_OUT_OF_RESOURCESAvailable bus number resource is not enough for allocation.

Definition at line 1019 of file PciLib.c.

◆ PciHostBridgeEnumerator()

EFI_STATUS PciHostBridgeEnumerator ( IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL PciResAlloc)

This function is used to enumerate the entire host bridge in a given platform.

Parameters
PciResAllocA pointer to the PCI Host Resource Allocation protocol.
Return values
EFI_SUCCESSSuccessfully enumerated the host bridge.
EFI_OUT_OF_RESOURCESNo enough memory available.
otherSome error occurred when enumerating the host bridge.

Definition at line 1543 of file PciLib.c.

◆ PciHostBridgeP2CProcess()

EFI_STATUS PciHostBridgeP2CProcess ( IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL PciResAlloc)

Process Option Rom on the specified host bridge.

Parameters
PciResAllocPointer to instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
Return values
EFI_SUCCESSSuccess process.
EFI_NOT_FOUNDCan not find the root bridge instance.
otherSome error occurred when processing Option Rom on the host bridge.

Definition at line 1498 of file PciLib.c.

◆ PciHostBridgeResourceAllocator()

EFI_STATUS PciHostBridgeResourceAllocator ( IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL PciResAlloc)

Submits the I/O and memory resource requirements for the specified PCI Host Bridge.

Parameters
PciResAllocPoint to protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
Return values
EFI_SUCCESSSuccessfully finished resource allocation.
EFI_NOT_FOUNDCannot get root bridge instance.
EFI_OUT_OF_RESOURCESPlatform failed to program the resources if no hot plug supported.
otherSome error occurred when allocating resources for the PCI Host Bridge.
Note
Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug.

Definition at line 469 of file PciLib.c.

◆ PciProgramResizableBar()

EFI_STATUS PciProgramResizableBar ( IN PCI_IO_DEVICE PciIoDevice,
IN PCI_RESIZABLE_BAR_OPERATION  ResizableBarOp 
)

This function is used to program the Resizable BAR Register.

Parameters
PciIoDeviceA pointer to the PCI_IO_DEVICE.
ResizableBarOpPciResizableBarMax: Set BAR to max size PciResizableBarMin: set BAR to min size.
Return values
EFI_SUCCESSSuccessfully enumerated the host bridge.
otherSome error occurred when enumerating the host bridge.

Definition at line 1793 of file PciLib.c.

◆ PciRootBridgeP2CProcess()

EFI_STATUS PciRootBridgeP2CProcess ( IN PCI_IO_DEVICE Bridge)

Process Option Rom on the specified root bridge.

Parameters
BridgePci root bridge device instance.
Return values
EFI_SUCCESSSuccess process.
otherSome error occurred when processing Option Rom on the root bridge.

Definition at line 1429 of file PciLib.c.

◆ PciScanBus()

EFI_STATUS PciScanBus ( IN PCI_IO_DEVICE Bridge,
IN UINT8  StartBusNumber,
OUT UINT8 *  SubBusNumber,
OUT UINT8 *  PaddedBusRange 
)

Scan pci bus and assign bus number to the given PCI bus system.

Parameters
BridgeBridge device instance.
StartBusNumberstart point.
SubBusNumberPoint to sub bus number.
PaddedBusRangeCustomized bus number.
Return values
EFI_SUCCESSSuccessfully scanned and assigned bus number.
otherSome error occurred when scanning pci bus.
Note
Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug.

Definition at line 1082 of file PciLib.c.

◆ RemoveRejectedPciDevices()

VOID RemoveRejectedPciDevices ( IN EFI_HANDLE  RootBridgeHandle,
IN PCI_IO_DEVICE Bridge 
)

Remove rejected pci device from specific root bridge handle.

Parameters
RootBridgeHandleSpecific parent root bridge handle.
BridgeBridge device instance.

Definition at line 151 of file PciLib.c.