[Toybox] [PATCH] lspci: use a different default location for pci.ids on Android.

Rob Landley rob at landley.net
Sat Feb 12 02:46:54 PST 2022

On 2/11/22 5:33 PM, enh wrote:
> On Fri, Feb 11, 2022 at 3:06 PM Rob Landley <rob at 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

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.


More information about the Toybox mailing list