]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/Library/PciCapPciIoLib.h
1109096379169d07ad67a9d4c5b5e5292b7294c2
2 Library class layered on top of PciCapLib that allows clients to plug an
3 EFI_PCI_IO_PROTOCOL backend into PciCapLib, for config space access.
5 Copyright (C) 2018, Red Hat, Inc.
7 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __PCI_CAP_PCI_IO_LIB_H__
11 #define __PCI_CAP_PCI_IO_LIB_H__
13 #include <Protocol/PciIo.h>
15 #include <Library/PciCapLib.h>
18 Create a PCI_CAP_DEV object from an EFI_PCI_IO_PROTOCOL instance. The config
19 space accessors are based upon EFI_PCI_IO_PROTOCOL.Pci.Read() and
20 EFI_PCI_IO_PROTOCOL.Pci.Write().
22 @param[in] PciIo EFI_PCI_IO_PROTOCOL representation of the PCI device.
24 @param[out] PciDevice The PCI_CAP_DEV object constructed as described above.
25 PciDevice can be passed to the PciCapLib APIs.
27 @retval EFI_SUCCESS PciDevice has been constructed and output.
29 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
33 PciCapPciIoDeviceInit (
34 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
35 OUT PCI_CAP_DEV
**PciDevice
39 Free the resources used by PciDevice.
41 @param[in] PciDevice The PCI_CAP_DEV object to free, originally produced by
42 PciCapPciIoDeviceInit().
46 PciCapPciIoDeviceUninit (
47 IN PCI_CAP_DEV
*PciDevice
50 #endif // __PCI_CAP_PCI_IO_LIB_H__