47 IN UINT16 SourceOffset,
48 OUT VOID *DestinationBuffer,
53 UINT16 ConfigSpaceSize;
56 SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
57 ConfigSpaceSize = (SegmentDev->MaxDomain == PciCapNormal ?
63 if (SourceOffset + Size > ConfigSpaceSize) {
68 SegmentDev->SegmentNr,
71 SegmentDev->FunctionNr,
108 IN UINT16 DestinationOffset,
109 IN VOID *SourceBuffer,
114 UINT16 ConfigSpaceSize;
115 UINT64 DestinationAddress;
117 SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
118 ConfigSpaceSize = (SegmentDev->MaxDomain == PciCapNormal ?
124 if (DestinationOffset + Size > ConfigSpaceSize) {
129 SegmentDev->SegmentNr,
131 SegmentDev->DeviceNr,
132 SegmentDev->FunctionNr,
178 IN PCI_CAP_DOMAIN MaxDomain,
188 if ((Device > PCI_MAX_DEVICE) || (Function > PCI_MAX_FUNC)) {
193 if (SegmentDev ==
NULL) {
197 SegmentDev->Signature = SEGMENT_DEV_SIG;
198 SegmentDev->MaxDomain = MaxDomain;
199 SegmentDev->SegmentNr = Segment;
200 SegmentDev->BusNr = Bus;
201 SegmentDev->DeviceNr = Device;
202 SegmentDev->FunctionNr = Function;
206 *PciDevice = &SegmentDev->BaseDevice;
224 SegmentDev = SEGMENT_DEV_FROM_PCI_CAP_DEV (PciDevice);
VOID EFIAPI PciCapPciSegmentDeviceUninit(IN PCI_CAP_DEV *PciDevice)
STATIC RETURN_STATUS EFIAPI SegmentDevWriteConfig(IN PCI_CAP_DEV *PciDevice, IN UINT16 DestinationOffset, IN VOID *SourceBuffer, IN UINT16 Size)
RETURN_STATUS EFIAPI PciCapPciSegmentDeviceInit(IN PCI_CAP_DOMAIN MaxDomain, IN UINT16 Segment, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Function, OUT PCI_CAP_DEV **PciDevice)
STATIC RETURN_STATUS EFIAPI SegmentDevReadConfig(IN PCI_CAP_DEV *PciDevice, IN UINT16 SourceOffset, OUT VOID *DestinationBuffer, IN UINT16 Size)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI PciSegmentReadBuffer(IN UINT64 StartAddress, IN UINTN Size, OUT VOID *Buffer)
#define PCI_SEGMENT_LIB_ADDRESS(Segment, Bus, Device, Function, Register)
UINTN EFIAPI PciSegmentWriteBuffer(IN UINT64 StartAddress, IN UINTN Size, IN VOID *Buffer)
#define RETURN_UNSUPPORTED
#define RETURN_OUT_OF_RESOURCES
#define RETURN_INVALID_PARAMETER
#define PCI_EXP_MAX_CONFIG_OFFSET
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)