Closed brianmcgee closed 1 week ago
I now understand the hardware classification better after enabling the debug output.
69: USB 00.1: 0000 Unclassified device
[Created at usb.122]
Unique ID: JRd1.nXPV_d5LjE5
Old Unique ID: FrNE.6cEYkEA3jA6
Parent ID: Uc5H.lRoCB54l1cE
SysFS ID: /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:08:00.1/usb1/1-4/1-4.3/1-4.3:1.1
SysFS BusID: 1-4.3:1.1
Hardware Class: unknown
HW Class List: usb
Model: "Yubico.com Yubikey 4/5 OTP+U2F+CCID"
Hotplug: USB
Vendor: usb 0x1050 "Yubico.com"
Device: usb 0x0407 "Yubikey 4/5 OTP+U2F+CCID"
Revision: "5.43"
Driver: "usbhid"
Driver Modules: "usbhid"
Main Driver Module: "usbhid"
Speed: 12 Mbps
Module Alias: "usb:v1050p0407d0543dc00dsc00dp00ic03isc00ip00in01"
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #87 (Hub)
I can rely on the class list as a fallback when the overall classification is unknown.
USB and PCI devices end up as
Hardware Class: unknown
when they should default tousb
orpci
.I think the line
if(!hd->hw_class) hd->hw_class = hw_unknown;
is preventing the block further down from defaulting the hardware class tohw_usb
,hw_pci
etc.https://github.com/openSUSE/hwinfo/blob/65c75d823398a7e868e2d41535e899fcf123d87a/src/hd/hd.c#L4802-L4824