本文将简单介绍下PCI ID database和Class Codes相关知识,然后分享lspci的常用操作。

PCI ID database

https://pci-ids.ucw.cz/

tools: PCI Lookup

1
2
$ lspci -n -s 00:02.0
00:02.0 0300: 8086:5a85 (rev 0b)

查询结果HD Graphics 500.

Class Codes

https://blog.ladsai.com/pci-configuration-space-class-code.html
The Class Code, Subclass, and Prog IF registers are used to identify the device’s type, the device’s function, and the device’s register-level programming interface, respectively.

1
2
$ lspci -n -s 00:02.0
00:02.0 0300: 8086:5a85 (rev 0b)

0300: VGA-Compatible Controller

常用操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
lspci -n

lspci -t

lspci -v

lspci -s 03:00.0

lspci -k

lspci -vxxx -s 0:02.0

lspci -nxxx -s 0:02.0

lspci -vmm

lspci -D

Each device is given a bus number, a device number and a function number. On Linux, PCI devices are also given domain numbers, but they are usually omitted by lspci since very often all devices have the same domain number (usually zero).

For more detailed guideline, please type man lspci or info lspci.同时可以参考Interpreting the output of lspci.


参考资料:

  1. osdev PCI
  2. 7 Linux lspci Command Examples to Get PCI Bus Hardware Device Info
  3. Interpreting the output of lspci