diff mbox series

[pciutils,1/5] libpci: Add new options for pci_fill_info: PROGIF, REVID and SUBSYS

Message ID 20220121135718.27172-2-pali@kernel.org
State New
Headers show
Series Support for PROGIF, REVID and SUBSYS | expand

Commit Message

Pali Rohár Jan. 21, 2022, 1:57 p.m. UTC
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 | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/lib/pci.h b/lib/pci.h
index b9fd9bfb9b5b..8c3c11b9ebeb 100644
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -145,6 +145,9 @@  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;				/* Programming interface for device_class */
+  u8 rev_id;				/* Revision id */
+  u16 subsys_vendor_id, subsys_id;	/* Subsystem vendor id and subsystem id */
 
   /* Fields used internally */
   struct pci_access *access;
@@ -210,6 +213,9 @@  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_PROGIF		0x00020000
+#define PCI_FILL_REVID		0x00040000
+#define PCI_FILL_SUBSYS		0x00080000
 
 void pci_setup_cache(struct pci_dev *, u8 *cache, int len) PCI_ABI;