git: 4dc810b5ff5b - main - pciconf: extend tree mode to also print numerical IDs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 06 Sep 2026 00:14:02 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=4dc810b5ff5b3e0a88575269205a1eb88b70e4d0
commit 4dc810b5ff5b3e0a88575269205a1eb88b70e4d0
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-04-03 21:37:45 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-09-06 00:12:47 +0000
pciconf: extend tree mode to also print numerical IDs
Also print the vendor/device and subvendor/subdevice IDs in addition
to any strings from the database found if the -v flag is given more
than once.
This helps with device identification if the strings resolve to
identical values for entire product families as well as when the
exact card cannot be determined from the string.
In theory a second call to pciconf could present that information in
non-tree mode but that kind-of defeats the purpose.
Reviewed by: jhb
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D56248
---
usr.sbin/pciconf/pciconf.8 | 4 +++-
usr.sbin/pciconf/pciconf.c | 9 ++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/usr.sbin/pciconf/pciconf.8 b/usr.sbin/pciconf/pciconf.8
index acb5fc4d039d..1c9be4e817ae 100644
--- a/usr.sbin/pciconf/pciconf.8
+++ b/usr.sbin/pciconf/pciconf.8
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 24, 2026
+.Dd September 5, 2026
.Dt PCICONF 8
.Os
.Sh NAME
@@ -313,6 +313,8 @@ the device name or PCI selector is followed by the device's vendor and device
strings from the vendor/device information database.
If an identification string is not found in the database,
the ID register values are output instead.
+If the option is specified twice, the vendor, device, subvendor, and
+subdevice IDs are displayed in addition to the found strings.
.Ss Device Information Modes
With the
.Fl a
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index f3c6a413826f..581a0cb3ff85 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -185,7 +185,7 @@ main(int argc, char **argv)
break;
case 'v':
- verbose = 1;
+ verbose++;
break;
case 'V':
@@ -523,6 +523,13 @@ print_tree_entry(struct pci_tree_entry *e, const char *indent, bool last,
TAILQ_FOREACH(di, &vi->devs, link) {
if (di->id == p->pc_device) {
printf(" %s", di->desc);
+ if (verbose > 1)
+ printf(" [0x%04x:0x%04x "
+ "0x%04x:0x%04x]",
+ p->pc_vendor,
+ p->pc_device,
+ p->pc_subvendor,
+ p->pc_subdevice);
break;
}
}