TianoCore EDK2 master
|
Go to the source code of this file.
Functions | |
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) |
STATIC RETURN_STATUS EFIAPI | ProtoDevReadConfig (IN PCI_CAP_DEV *PciDevice, IN UINT16 SourceOffset, OUT VOID *DestinationBuffer, IN UINT16 Size) |
STATIC RETURN_STATUS EFIAPI | ProtoDevWriteConfig (IN PCI_CAP_DEV *PciDevice, IN UINT16 DestinationOffset, IN VOID *SourceBuffer, IN UINT16 Size) |
EFI_STATUS EFIAPI | PciCapPciIoDeviceInit (IN EFI_PCI_IO_PROTOCOL *PciIo, OUT PCI_CAP_DEV **PciDevice) |
VOID EFIAPI | PciCapPciIoDeviceUninit (IN PCI_CAP_DEV *PciDevice) |
Plug an EFI_PCI_IO_PROTOCOL backend into PciCapLib, for config space access.
Copyright (C) 2018, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UefiPciCapPciIoLib.c.
EFI_STATUS EFIAPI PciCapPciIoDeviceInit | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
OUT PCI_CAP_DEV ** | PciDevice | ||
) |
Create a PCI_CAP_DEV object from an EFI_PCI_IO_PROTOCOL instance. The config space accessors are based upon EFI_PCI_IO_PROTOCOL.Pci.Read() and EFI_PCI_IO_PROTOCOL.Pci.Write().
[in] | PciIo | EFI_PCI_IO_PROTOCOL representation of the PCI device. |
[out] | PciDevice | The PCI_CAP_DEV object constructed as described above. PciDevice can be passed to the PciCapLib APIs. |
EFI_SUCCESS | PciDevice has been constructed and output. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 208 of file UefiPciCapPciIoLib.c.
VOID EFIAPI PciCapPciIoDeviceUninit | ( | IN PCI_CAP_DEV * | PciDevice | ) |
Free the resources used by PciDevice.
[in] | PciDevice | The PCI_CAP_DEV object to free, originally produced by PciCapPciIoDeviceInit(). |
Definition at line 237 of file UefiPciCapPciIoLib.c.
STATIC RETURN_STATUS EFIAPI ProtoDevReadConfig | ( | IN PCI_CAP_DEV * | PciDevice, |
IN UINT16 | SourceOffset, | ||
OUT VOID * | DestinationBuffer, | ||
IN UINT16 | Size | ||
) |
Read the config space of a given PCI device (both normal and extended).
ProtoDevReadConfig() performs as few config space accesses as possible (without attempting 64-bit wide accesses).
ProtoDevReadConfig() returns an unspecified error if accessing Size bytes from SourceOffset exceeds the config space limit of the PCI device. Fewer than Size bytes may have been read in this case.
[in] | PciDevice | Implementation-specific unique representation of the PCI device in the PCI hierarchy. |
[in] | SourceOffset | Source offset in the config space of the PCI device to start reading from. |
[out] | DestinationBuffer | Buffer to store the read data to. |
[in] | Size | The number of bytes to transfer. |
RETURN_SUCCESS | Size bytes have been transferred from config space to DestinationBuffer. |
Definition at line 124 of file UefiPciCapPciIoLib.c.
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 | ||
) |
Transfer bytes between the config space of a given PCI device and a memory buffer.
ProtoDevTransferConfig() performs as few config space accesses as possible (without attempting 64-bit wide accesses).
[in] | PciIo | The EFI_PCI_IO_PROTOCOL representation of the PCI device. |
[in] | TransferFunction | The EFI_PCI_IO_PROTOCOL_CONFIG function that implements the transfer. The direction of the transfer is inherent to TransferFunction. TransferFunction() is required to return an unspecified error if any sub-transfer within Size bytes from ConfigOffset exceeds the config space limit of the PCI device. |
[in] | ConfigOffset | The offset in the config space of the PCI device at which the transfer should commence. |
[in,out] | Buffer | The memory buffer where the transfer should occur. |
[in] | Size | The number of bytes to transfer. |
EFI_SUCCESS | Size bytes have been transferred between config space and Buffer. |
Definition at line 47 of file UefiPciCapPciIoLib.c.
STATIC RETURN_STATUS EFIAPI ProtoDevWriteConfig | ( | IN PCI_CAP_DEV * | PciDevice, |
IN UINT16 | DestinationOffset, | ||
IN VOID * | SourceBuffer, | ||
IN UINT16 | Size | ||
) |
Write the config space of a given PCI device (both normal and extended).
ProtoDevWriteConfig() performs as few config space accesses as possible (without attempting 64-bit wide accesses).
ProtoDevWriteConfig() returns an unspecified error if accessing Size bytes at DestinationOffset exceeds the config space limit of the PCI device. Fewer than Size bytes may have been written in this case.
[in] | PciDevice | Implementation-specific unique representation of the PCI device in the PCI hierarchy. |
[in] | DestinationOffset | Destination offset in the config space of the PCI device to start writing at. |
[in] | SourceBuffer | Buffer to read the data to be stored from. |
[in] | Size | The number of bytes to transfer. |
RETURN_SUCCESS | Size bytes have been transferred from SourceBuffer to config space. |
Definition at line 173 of file UefiPciCapPciIoLib.c.