diff mbox series

[pciutils,1/4] libpci: Add new option PCI_FILL_PARENT

Message ID 20220121142258.28170-2-pali@kernel.org
State New
Headers show
Series Support for PCI_FILL_PARENT | expand

Commit Message

Pali Rohár Jan. 21, 2022, 2:22 p.m. UTC
This change extends libpci and allows providers to fill parent pci_dev.
This is useful to retrieve topology as it is reported by the system itself.
---
 lib/pci.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/lib/pci.h b/lib/pci.h
index c13387e2b4b1..de031f7a416b 100644
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -148,6 +148,7 @@  struct pci_dev {
   u8 prog_if;				/* Programming interface for device_class */
   u8 rev_id;				/* Revision id */
   u16 subsys_vendor_id, subsys_id;	/* Subsystem vendor id and subsystem id */
+  struct pci_dev *parent;		/* Parent device */
 
   /* Fields used internally */
   struct pci_access *access;
@@ -217,6 +218,7 @@  char *pci_get_string_property(struct pci_dev *d, u32 prop) PCI_ABI;
 #define PCI_FILL_REVID		0x00040000
 #define PCI_FILL_SUBSYS		0x00080000
 #define PCI_FILL_DRIVER		0x00100000
+#define PCI_FILL_PARENT		0x00200000
 
 void pci_setup_cache(struct pci_dev *, u8 *cache, int len) PCI_ABI;