aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-12-20 22:07:28 +0100
committerMartin Mares <mj@ucw.cz>2022-02-10 13:49:35 +0100
commitb84f21545827cca1150bb53906257f80ebb5a84e (patch)
tree93f83a065d35472ed99592413716d400574540eb
parentccf68033a452cd32ac4c1f7d8618e79102bd08a8 (diff)
downloadpciutils-b84f21545827cca1150bb53906257f80ebb5a84e.tar.gz
libpci: Add new options for pci_fill_info: CLASS_EXT and SUBSYS
This change extends libpci library and allows providers to fill these informations (Programming interface, Revision id and Subsystem ids) via native system APIs, which sometimes may differs from what is stored in PCI config space. Programming interface is part of 24-bit Device Class number but apparently libpci exports only high 16-bit of this number via device_class member.
-rw-r--r--lib/pci.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pci.h b/lib/pci.h
index b9fd9bf..8d09915 100644
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -145,6 +145,8 @@ struct pci_dev {
pciaddr_t bridge_base_addr[4]; /* Bridge base addresses (without flags) */
pciaddr_t bridge_size[4]; /* Bridge sizes */
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 */
/* Fields used internally */
struct pci_access *access;
@@ -210,6 +212,8 @@ char *pci_get_string_property(struct pci_dev *d, u32 prop) PCI_ABI;
#define PCI_FILL_IOMMU_GROUP 0x4000
#define PCI_FILL_BRIDGE_BASES 0x8000
#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 */
void pci_setup_cache(struct pci_dev *, u8 *cache, int len) PCI_ABI;