]>
Commit | Line | Data |
---|---|---|
02b9a834 LE |
1 | /** @file\r |
2 | Library class layered on top of PciCapLib that allows clients to plug an\r | |
3 | EFI_PCI_IO_PROTOCOL backend into PciCapLib, for config space access.\r | |
4 | \r | |
5 | Copyright (C) 2018, Red Hat, Inc.\r | |
6 | \r | |
b26f0cf9 | 7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
02b9a834 LE |
8 | **/\r |
9 | \r | |
10 | #ifndef __PCI_CAP_PCI_IO_LIB_H__\r | |
11 | #define __PCI_CAP_PCI_IO_LIB_H__\r | |
12 | \r | |
13 | #include <Protocol/PciIo.h>\r | |
14 | \r | |
15 | #include <Library/PciCapLib.h>\r | |
16 | \r | |
17 | \r | |
18 | /**\r | |
19 | Create a PCI_CAP_DEV object from an EFI_PCI_IO_PROTOCOL instance. The config\r | |
20 | space accessors are based upon EFI_PCI_IO_PROTOCOL.Pci.Read() and\r | |
21 | EFI_PCI_IO_PROTOCOL.Pci.Write().\r | |
22 | \r | |
23 | @param[in] PciIo EFI_PCI_IO_PROTOCOL representation of the PCI device.\r | |
24 | \r | |
25 | @param[out] PciDevice The PCI_CAP_DEV object constructed as described above.\r | |
26 | PciDevice can be passed to the PciCapLib APIs.\r | |
27 | \r | |
28 | @retval EFI_SUCCESS PciDevice has been constructed and output.\r | |
29 | \r | |
30 | @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r | |
31 | **/\r | |
32 | EFI_STATUS\r | |
33 | EFIAPI\r | |
34 | PciCapPciIoDeviceInit (\r | |
35 | IN EFI_PCI_IO_PROTOCOL *PciIo,\r | |
36 | OUT PCI_CAP_DEV **PciDevice\r | |
37 | );\r | |
38 | \r | |
39 | \r | |
40 | /**\r | |
41 | Free the resources used by PciDevice.\r | |
42 | \r | |
43 | @param[in] PciDevice The PCI_CAP_DEV object to free, originally produced by\r | |
44 | PciCapPciIoDeviceInit().\r | |
45 | **/\r | |
46 | VOID\r | |
47 | EFIAPI\r | |
48 | PciCapPciIoDeviceUninit (\r | |
49 | IN PCI_CAP_DEV *PciDevice\r | |
50 | );\r | |
51 | \r | |
52 | #endif // __PCI_CAP_PCI_IO_LIB_H__\r |