]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/Library/PciCapPciIoLib.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / Library / PciCapPciIoLib.h
1 /** @file
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.
4
5 Copyright (C) 2018, Red Hat, Inc.
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8 **/
9
10 #ifndef __PCI_CAP_PCI_IO_LIB_H__
11 #define __PCI_CAP_PCI_IO_LIB_H__
12
13 #include <Protocol/PciIo.h>
14
15 #include <Library/PciCapLib.h>
16
17 /**
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().
21
22 @param[in] PciIo EFI_PCI_IO_PROTOCOL representation of the PCI device.
23
24 @param[out] PciDevice The PCI_CAP_DEV object constructed as described above.
25 PciDevice can be passed to the PciCapLib APIs.
26
27 @retval EFI_SUCCESS PciDevice has been constructed and output.
28
29 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
30 **/
31 EFI_STATUS
32 EFIAPI
33 PciCapPciIoDeviceInit (
34 IN EFI_PCI_IO_PROTOCOL *PciIo,
35 OUT PCI_CAP_DEV **PciDevice
36 );
37
38 /**
39 Free the resources used by PciDevice.
40
41 @param[in] PciDevice The PCI_CAP_DEV object to free, originally produced by
42 PciCapPciIoDeviceInit().
43 **/
44 VOID
45 EFIAPI
46 PciCapPciIoDeviceUninit (
47 IN PCI_CAP_DEV *PciDevice
48 );
49
50 #endif // __PCI_CAP_PCI_IO_LIB_H__