Bug 289923 - pciconf(8) - add -C option for 'class' filtering
Summary: pciconf(8) - add -C option for 'class' filtering
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Bojan Novković
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-30 16:41 UTC by Slawomir Wojciech Wojtczak
Modified: 2026-09-21 18:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Slawomir Wojciech Wojtczak 2025-09-30 16:41:32 UTC
Hi,

just an idea - as '-c' is already taken for 'capabilities' it would be handy to have '-C' option to filter the devices only to needed class/subclass.

For example now to display 'network' related devices this 'quirk' is needed:

# pciconf -l -v | grep -B 3 -E 'class.*network'
em0@pci0:0:31:6:        class=0x020000 rev=0x21 hdr=0x00 vendor=0x8086 device=0x15d8 subvendor=0x17aa subdevice=0x225d
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Connection (4) I219-V'
    class      = network
--
iwlwifi0@pci0:3:0:0:    class=0x028000 rev=0x29 hdr=0x00 vendor=0x8086 device=0x2526 subvendor=0x8086 subdevice=0x0014
    vendor     = 'Intel Corporation'
    device     = 'Wi-Fi 5(802.11ac) Wireless-AC 9x6x [Thunder Peak]'
    class      = network

It would be a lot better with '-C' and would look something like that:

# pciconf -l -c network
em0@pci0:0:31:6:        class=0x020000 rev=0x21 hdr=0x00 vendor=0x8086 device=0x15d8 iwlwifi0@pci0:3:0:0:    class=0x028000 rev=0x29 hdr=0x00 vendor=0x8086 device=0x2526 

# pciconf -l -v -c network
em0@pci0:0:31:6:        class=0x020000 rev=0x21 hdr=0x00 vendor=0x8086 device=0x15d8 subvendor=0x17aa subdevice=0x225d
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Connection (4) I219-V'
    class      = network
iwlwifi0@pci0:3:0:0:    class=0x028000 rev=0x29 hdr=0x00 vendor=0x8086 device=0x2526 subvendor=0x8086 subdevice=0x0014
    vendor     = 'Intel Corporation'
    device     = 'Wi-Fi 5(802.11ac) Wireless-AC 9x6x [Thunder Peak]'
    class      = network

Regards,
vermaden
Comment 1 Slawomir Wojciech Wojtczak 2026-01-16 13:30:39 UTC
Do you think its useful?
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-09-21 18:40:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=46d383af0dbdb3871354f344b9c1ba99da691121

commit 46d383af0dbdb3871354f344b9c1ba99da691121
Author:     Federico Angelilli <code@fedang.net>
AuthorDate: 2026-09-21 18:23:10 +0000
Commit:     Bojan Novković <bnovkov@FreeBSD.org>
CommitDate: 2026-09-21 18:37:59 +0000

    pciconf: Add -C option to filter by class name

    Differential Revision:  https://reviews.freebsd.org/D59602
    MFC after:      3 weeks
    PR:             289923
    Reviewed by:    bnovkov

 usr.sbin/pciconf/pciconf.8 | 10 ++++++++--
 usr.sbin/pciconf/pciconf.c | 40 +++++++++++++++++++++++++++++++++++-----
 2 files changed, 43 insertions(+), 7 deletions(-)