]> mj.ucw.cz Git - pciutils.git/commitdiff
libpci: Add new options for pci_fill_info: CLASS_EXT and SUBSYS
authorPali Rohár <pali@kernel.org>
Mon, 20 Dec 2021 21:07:28 +0000 (22:07 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 10 Feb 2022 12:49:35 +0000 (13:49 +0100)
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.

lib/pci.h

index b9fd9bfb9b5b4b55e2d26aea5ec520e856afe3cf..8d099158e1cd5f08256d7fdf7cc84990ab33d2e4 100644 (file)
--- 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;