It started with me trying to debug iwlwifi
kernel panic which brings down the network interface. So, I thought to write some stuff about the controller itself.
Starting with lspci
output which basically reads sysfs (that would be /sys, more about sysfs in another post).
$ lspci -s 0000:03:00.0 -v
03:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth (rev 99)
Subsystem: Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth
Flags: bus master, fast devsel, latency 0, IRQ 125
Memory at 91000000 (64-bit, non-prefetchable) [size=8K]
Capabilities: <access denied>
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
Well, I can see all the information at /sys/bus/pci/devices/0000:03:00.0
anyway, but lspci is nicer to look at. So, what is ‘0000:03:00.0’?
0000: Is the domain for that PCI bus(it’s linux thing) 03: is bus number 00: is device number .0: is function number
Actually, my network controller is 3rd port of PCI bridge.
+-1c.2-[03]----00.0 Intel Corporation Dual Band Wireless-AC 3165 Plus Bluetooth
1c
is a device number of PCI bridge on the bus 0 (connected to Host Bridge aka Root Complex).
00:1c.2 PCI bridge: Intel Corporation Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Series PCI Express Port #3 (rev 35)
Back to wireless controller sysfs /sys/bus/pci/devices/0000:03:00.0
. Here are some files sysfs gives us. Starting with driver
which expected (see lspci out above)
$ ls -l driver
lrwxrwxrwx 1 root root 0 Aug 24 18:33 driver -> ../../../../bus/pci/drivers/iwlwifi
Then vendor and device ids which lspci looks up and translates to the text above.
$ more device
0x3166
$ more vendor
0x8086
Side note, from pciutils
the repo where lspci lives
pciutils$ rg 3166 .
./pci.ids
31392: 3166 Dual Band Wireless-AC 3165 Plus Bluetooth
and 0x8086
is Intel
for obvious reasons.
The speeds and link width(ie lanes) are there as well.
$ more current_link_speed
2.5 GT/s
$ more current_link_width
1
And the part we all waiting. The PCI configuration space. The vendor and device at the start as expected.
hexdump config
0000000 8086 3166 0406 0010 0099 0280 0000 0000
0000010 0004 9100 0000 0000 0000 0000 0000 0000
0000020 0000 0000 0000 0000 0000 0000 8086 4210
0000030 0000 0000 00c8 0000 0000 0000 01ff 0000
0000040