]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/Library/PciCapPciIoLib.h
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 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __PCI_CAP_PCI_IO_LIB_H__
17 #define __PCI_CAP_PCI_IO_LIB_H__
19 #include <Protocol/PciIo.h>
21 #include <Library/PciCapLib.h>
25 Create a PCI_CAP_DEV object from an EFI_PCI_IO_PROTOCOL instance. The config
26 space accessors are based upon EFI_PCI_IO_PROTOCOL.Pci.Read() and
27 EFI_PCI_IO_PROTOCOL.Pci.Write().
29 @param[in] PciIo EFI_PCI_IO_PROTOCOL representation of the PCI device.
31 @param[out] PciDevice The PCI_CAP_DEV object constructed as described above.
32 PciDevice can be passed to the PciCapLib APIs.
34 @retval EFI_SUCCESS PciDevice has been constructed and output.
36 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
40 PciCapPciIoDeviceInit (
41 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
42 OUT PCI_CAP_DEV
**PciDevice
47 Free the resources used by PciDevice.
49 @param[in] PciDevice The PCI_CAP_DEV object to free, originally produced by
50 PciCapPciIoDeviceInit().
54 PciCapPciIoDeviceUninit (
55 IN PCI_CAP_DEV
*PciDevice
58 #endif // __PCI_CAP_PCI_IO_LIB_H__