From: Pali Rohár Date: Mon, 20 Dec 2021 21:07:28 +0000 (+0100) Subject: libpci: Add new options for pci_fill_info: CLASS_EXT and SUBSYS X-Git-Tag: v3.8.0~41 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b84f21545827cca1150bb53906257f80ebb5a84e;p=pciutils.git 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. --- 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;