50 IN UINT16 ConfigOffset,
69 if ((Size >= 4) && ((ConfigOffset & 3) == 0)) {
70 Width = EfiPciIoWidthUint32;
71 Count = Size >> Width;
72 }
else if ((Size >= 2) && ((ConfigOffset & 1) == 0)) {
73 Width = EfiPciIoWidthUint16;
76 Width = EfiPciIoWidthUint8;
80 Status = TransferFunction (PciIo, Width, ConfigOffset, Count, Buffer);
81 if (EFI_ERROR (Status)) {
85 Progress = Count << Width;
86 ConfigOffset += Progress;
126 IN UINT16 SourceOffset,
127 OUT VOID *DestinationBuffer,
133 ProtoDev = PROTO_DEV_FROM_PCI_CAP_DEV (PciDevice);
136 ProtoDev->PciIo->Pci.
Read,
175 IN UINT16 DestinationOffset,
176 IN VOID *SourceBuffer,
182 ProtoDev = PROTO_DEV_FROM_PCI_CAP_DEV (PciDevice);
185 ProtoDev->PciIo->Pci.
Write,
216 if (ProtoDev ==
NULL) {
217 return EFI_OUT_OF_RESOURCES;
220 ProtoDev->Signature = PROTO_DEV_SIG;
221 ProtoDev->PciIo = PciIo;
225 *PciDevice = &ProtoDev->BaseDevice;
243 ProtoDev = PROTO_DEV_FROM_PCI_CAP_DEV (PciDevice);
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_PCI_IO_PROTOCOL_CONFIG)(IN EFI_PCI_IO_PROTOCOL *This, IN EFI_PCI_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
EFI_PCI_IO_PROTOCOL_WIDTH
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI PciCapPciIoDeviceUninit(IN PCI_CAP_DEV *PciDevice)
STATIC RETURN_STATUS EFIAPI ProtoDevReadConfig(IN PCI_CAP_DEV *PciDevice, IN UINT16 SourceOffset, OUT VOID *DestinationBuffer, IN UINT16 Size)
STATIC EFI_STATUS ProtoDevTransferConfig(IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_PCI_IO_PROTOCOL_CONFIG TransferFunction, IN UINT16 ConfigOffset, IN OUT UINT8 *Buffer, IN UINT16 Size)
EFI_STATUS EFIAPI PciCapPciIoDeviceInit(IN EFI_PCI_IO_PROTOCOL *PciIo, OUT PCI_CAP_DEV **PciDevice)
STATIC RETURN_STATUS EFIAPI ProtoDevWriteConfig(IN PCI_CAP_DEV *PciDevice, IN UINT16 DestinationOffset, IN VOID *SourceBuffer, IN UINT16 Size)
EFI_PCI_IO_PROTOCOL_CONFIG Read
EFI_PCI_IO_PROTOCOL_CONFIG Write