From: "Pali Rohár" <pali@kernel.org>
To: "Martin Mares" <mj@ucw.cz>, "Bjorn Helgaas" <helgaas@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Matthew Wilcox" <willy@infradead.org>,
linux-pci@vger.kernel.org
Subject: [PATCH pciutils 1/5] libpci: Add new options for pci_fill_info: PROGIF, REVID and SUBSYS
Date: Fri, 21 Jan 2022 14:57:14 +0100 [thread overview]
Message-ID: <20220121135718.27172-2-pali@kernel.org> (raw)
In-Reply-To: <20220121135718.27172-1-pali@kernel.org>
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 --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;
--
2.20.1
next prev parent reply other threads:[~2022-01-21 13:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 13:57 [PATCH pciutils 0/5] Support for PROGIF, REVID and SUBSYS Pali Rohár
2022-01-21 13:57 ` Pali Rohár [this message]
2022-01-21 13:57 ` [PATCH pciutils 2/5] libpci: generic: Implement PROGIF, REVID and SUBSYS support Pali Rohár
2022-01-21 13:57 ` [PATCH pciutils 3/5] libpci: generic: Implement SUBSYS also for PCI_HEADER_TYPE_BRIDGE Pali Rohár
2022-01-21 14:40 ` Martin Mareš
2022-01-21 16:11 ` Pali Rohár
2022-01-21 20:43 ` Martin Mareš
2022-01-21 13:57 ` [PATCH pciutils 4/5] libpci: sysfs: Implement PROGIF, REVID and SUBSYS support Pali Rohár
2022-01-21 13:57 ` [PATCH pciutils 5/5] lspci: Retrieve prog if, subsystem ids and revision id via libpci Pali Rohár
2022-01-21 14:40 ` [PATCH pciutils 0/5] Support for PROGIF, REVID and SUBSYS Martin Mareš
2022-01-21 15:12 ` Pali Rohár
2022-01-21 15:15 ` Martin Mareš
2022-01-21 15:26 ` Pali Rohár
2022-01-21 15:29 ` Martin Mareš
2022-01-21 15:35 ` Pali Rohár
2022-01-21 15:38 ` Martin Mareš
2022-01-21 15:45 ` Pali Rohár
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220121135718.27172-2-pali@kernel.org \
--to=pali@kernel.org \
--cc=helgaas@kernel.org \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=mj@ucw.cz \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).