summaryrefslogtreecommitdiff
path: root/lspci.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-12-28 20:14:47 +0100
committerMartin Mares <mj@ucw.cz>2022-02-10 13:49:35 +0100
commit67954c8b6514859a0e115538200187f3a1ffd366 (patch)
tree0e74cc2b7c3b384146340eb52fa069d698345f8a /lspci.c
parente9e7fab13d16067658f02d47094a949f56aef596 (diff)
downloadpciutils-67954c8b6514859a0e115538200187f3a1ffd366.tar.gz
lspci: Build tree based on PCI_FILL_PARENT information
Topology reported by system (libpci provider) may be different from topology built based on primary/secondary/subordinate numbers from PCI bridges by lspci. This happens for example when some non-compliant PCI-to-PCI bridge with Type 0 header (e.g. Marvell one) is available in the system. So add additional edges reported by libpci when building tree in lspci.
Diffstat (limited to 'lspci.c')
-rw-r--r--lspci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lspci.c b/lspci.c
index f52e792..b29580a 100644
--- a/lspci.c
+++ b/lspci.c
@@ -143,7 +143,7 @@ scan_device(struct pci_dev *p)
d->config_cached += 64;
}
pci_setup_cache(p, d->config, d->config_cached);
- pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_CLASS_EXT | PCI_FILL_SUBSYS);
+ pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_CLASS | PCI_FILL_CLASS_EXT | PCI_FILL_SUBSYS | (need_topology ? PCI_FILL_PARENT : 0));
return d;
}