On 2/11/22 5:33 PM, enh wrote: > On Fri, Feb 11, 2022 at 3:06 PM Rob Landley <r...@landley.net > Indeed. I'd forgotten that lspci already had database reading code when I > added > it to lsusb. The two file formats actually look identical, except that > pci.ids > has a third indentation level. Should be easy to get them to share code... > > oh, that's convenient! TIL. i'll admit that the possibility _hadn't even > occurred to me_ that two different linux things would actually have used the > same format.
Except that the third indentation level is "subsystem" which is only displayed for -v. Which is easy enough to do, except that -v displays all sorts of OTHER information we don't currently display... 00:1f.3 SMBus: Intel Corporation 7 Series/C216 Chipset Family SMBus Controller (rev 04) Subsystem: Dell 7 Series/C216 Chipset Family SMBus Controller Flags: medium devsel, IRQ 18 Memory at f7e35000 (64-bit, non-prefetchable) [size=256] I/O ports at f040 [size=32] Kernel driver in use: i801_smbus Kernel modules: i2c_i801 The uevent data gives all the info it's displaying now: $ cat /sys/bus/pci/devices/*1f.3/uevent DRIVER=i801_smbus PCI_CLASS=C0500 PCI_ID=8086:1E22 PCI_SUBSYS_ID=1028:0532 PCI_SLOT_NAME=0000:00:1f.3 MODALIAS=pci:v00008086d00001E22sv00001028sd00000532bc0Csc05i00 The PCI_ID gives the first two levels and PCI_SUBSYS is what you match on the third, and DRIVER is "driver in use", but where did it get i2c_i801 from? Memory and I/O ports seem to be from "resource" (although... non-prefetchable?) Flags I dunno either (although irq has a file....) > maybe we'll have the year of linux on the desktop after all! :-) We did. It was 1998. Rob _______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net