]> mj.ucw.cz Git - pciutils.git/commitdiff
libpci: Add new option PCI_FILL_PARENT
authorPali Rohár <pali@kernel.org>
Tue, 28 Dec 2021 19:09:57 +0000 (20:09 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 10 Feb 2022 12:49:35 +0000 (13:49 +0100)
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

index 8d099158e1cd5f08256d7fdf7cc84990ab33d2e4..3947fc12b258a8b04bb4c8b9f05fdc116a57202c 100644 (file)
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -147,6 +147,7 @@ struct pci_dev {
   pciaddr_t bridge_flags[4];           /* PCI_IORESOURCE_* flags for bridge addresses */
   u8 prog_if, rev_id;                  /* Programming interface for device_class and revision id */
   u16 subsys_vendor_id, subsys_id;     /* Subsystem vendor id and subsystem id */
+  struct pci_dev *parent;              /* Parent device, does not have to be always accessible */
 
   /* Fields used internally */
   struct pci_access *access;
@@ -214,6 +215,7 @@ char *pci_get_string_property(struct pci_dev *d, u32 prop) PCI_ABI;
 #define PCI_FILL_RESCAN                0x00010000
 #define PCI_FILL_CLASS_EXT     0x00020000      /* prog_if and rev_id */
 #define PCI_FILL_SUBSYS                0x00040000      /* subsys_vendor_id and subsys_id */
+#define PCI_FILL_PARENT                0x00080000
 
 void pci_setup_cache(struct pci_dev *, u8 *cache, int len) PCI_ABI;