lspci 中文man页面

来源:互联网 发布:服务器 linux 编辑:程序博客网 时间:2024/06/06 06:45

NAME

lspci - 列出所有PCI设备  

总览 SYNOPSIS

lspci [options]  

描述 DESCRIPTION

lspci 是一个用来显示系统中所有PCI总线设备或连接到该总线上的所有设备的工具。

为了能使用这个命令所有功能,你需要有 linux 2.1.82 或以上版本,支持 /proc/bus/pci 接口的内核。在旧版本内核中,PCI工具必须使用只有root才能执行的直接硬件访问,而且总是出现竞争状况以及其他问题。

如果你要报告 PCI 设备驱动中,或者是 lspci 自身的 bugs,请在报告中包含 "lspci -vvx" 的输出。

选项 OPTIONS

-v
使得 lspci 以冗余模式显示所有设备的详细信息。
-vv
使得 lspci 以过冗余模式显示更详细的信息 (事实上是 PCI 设备能给出的所有东西)。这些数据的确切意义没有在此手册页中解释,如果你想知道更多,请参照 /usr/include/linux/pci.h 或者 PCI 规范。
-n
以数字形式显示 PCI 生产厂商和设备号,而不是在 PCI ID 数据库中查找它们。
-x
以十六进制显示 PCI 配置空间 (configuration space) 的前64个字节映象 (标准头部信息)。此参数对调试驱动和 lspci 本身很有用。
-xxx
以十六进制显示所有 PCI 配置空间的映象。此选项只有 root 可用,并且很多 PCI 设备在你试图读取配置空间的未定义部分时会崩溃 (此操作可能不违反PCI标准,但是它至少非常愚蠢)。
-b
以总线为中心进行查看。显示所有 IRQ 号和内存地址,就象 PCI 总线上的卡看到的一样,而不是内核看到的内容。
-t
以树形方式显示包含所有总线、桥、设备和它们的连接的图表。
-s [[<bus>]:][<slot>][.[<func>]]
仅显示指定总线、插槽上的设备或设备上的功能块信息。设备地址的任何部分都可以忽略,或以“*”代替 (意味着所有值)。所有数字都是十六进制。例如:“0:”指的是在0号总线上的所有设备;“0”指的是在任意总线上0号设备的所有功能块;“0.3”选择了所有总线上0号设备的第三个功能块;“.4”则是只列出每一设备上的第四个功能块。
-d [<vendor>]:[<device>]
只显示指定生产厂商和设备 ID 的设备。 这两个 ID 都以十六进制表示,可以忽略或者以“*”代替 (意味着所有值)。
-i <file>
使用 <file> 作为 PCI ID 数据库而不是使用默认的 /usr/share/hwdata/pci.ids
-p <dir>
使用 <dir> 作为包含 PCI 总线信息的目录而不是使用默认的目录 /proc/bus/pci
-m
以机器可读的方式转储 PCI 设备数据 (支持两种模式:普通和冗余),便于脚本解析。
-M
使用总线映射模式,这种模式对总线进行全面地扫描以查明总线上的所有设备,包括配置错误的桥之后的设备。请注意,此操作只应在调试时使用,并可能造成系统崩溃 (只在设备有错误的时候,但是不幸的是它们存在),此命令只有 root 可以使用。同时,在不直接接触硬件的 PCI 访问模式中使用 -M 参数没有意义,因为显示的结果 (排除 lspci 中的 bug 的影响) 与普通的列表模式相同。
--version
显示 lspci 的版本。这个选项应当单独使用。

PCILIB 选项 PCILIB OPTIONS

PCI 工具使用 PCILIB (一种可移植的库,提供平台独立的函数来访问 PCI 配置空间) 来和PCI卡交互。下面的选项用来控制库参数,特别是所用访问模式的指定。默认情况下,PCILIB 使用第一种可用的访问模式,不会显示任何调试信息。每一个开关选项都列出了一组它所支持的硬件/软件列表。

-P <dir>
使用 linux 2.1 风格的配置,直接访问目录 <dir> 而非 /proc/bus/pci 目录。(只能在 linux 2.1 或以上版本中使用)
-H1
通过 Intel 架构 1 来实现直接硬件访问。(只能用于 i386 及其兼容机)
-H2
通过Intel 架构 2 来实现直接硬件访问。警告:此模式只能寻址任何总线上的前16个设备,并且在很多情况下相当不可靠。(只能用于 i386 及其兼容机)
-S
使用 PCI 系统调用访问。(只能用于 Alpha 和 Ultra-Sparc 上的 Linux)
-F <file>
从所给的包含 lspci -x 命令输出的文件中获取相关信息。这在分析用户提交的错误报告时很有用,因为你可以用任何方式来显示硬件配置信息而无需为了获取更多信息打扰用户。(可用于所有系统)
-G
增加库的调试等级。(可用于所有系统)

文件 FILES

/usr/share/hwdata/pci.ids
所有已知 PCI ID 的清单 (厂商,设备名,类,子类)
/proc/bus/pci
linux 2.1.82 之后版本内核提供的 PCI 总线配置空间的接口。包含每个总线 (per-bus) 的子目录以及每个设备卡 (per-card) 的配置空间文件,还有一个 devices 文件,包含所有PCI设备的列表。

参见 SEE ALSO

setpci(8)

NAME

lspci - list all PCI devices  

SYNOPSIS

lspci [options]  

DESCRIPTION

lspci is a utility for displaying information about all PCI buses in the system and all devices connected to them.

If you are going to report bugs in PCI device drivers or in lspci itself, please include output of "lspci -vvx".

OPTIONS

-v
Tells lspci to be verbose and display detailed information about all devices.
-vv
Tells lspci to be very verbose and display even more information (actually everything the PCI device is able to tell). The exact meaning of these data is not explained in this manual page, if you want to know more, consult /usr/include/linux/pci.h or the PCI specs.
-n
Show PCI vendor and device codes as numbers instead of looking them up in the PCI ID database.
-x
Show hexadecimal dump of first 64 bytes of the PCI configuration space (the standard header). Useful for debugging of drivers and lspci itself.
-xxx
Show hexadecimal dump of whole PCI configuration space. Available only for root as several PCI devices crash when you try to read undefined portions of the config space (this behavior probably doesn't violate the PCI standard, but it's at least very stupid).
-xxxx
Show hexadecimal dump of the extended PCI configuration space.
-b
Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the PCI bus instead of as seen by the kernel.
-t
Show a tree-like diagram containing all buses, bridges, devices and connections between them.
-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
Show only devices in the specified domain (in case your machine has several host bridges, they can either share a common bus number space or each of them can address a PCI domain of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7). Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0 on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only the fourth function of each device.
-d [<vendor>]:[<device>]
Show only devices with specified vendor and device ID. Both ID's are given in hexadecimal and may be omitted or given as "*", both meaning "any value".
-i <file>
Use <file> as PCI ID database instead of /usr/share/hwdata/pci.ids.
-p <dir>
Use <dir> as directory containing PCI bus information instead of /proc/bus/pci.
-m
Dump PCI device data in machine readable form (both normal and verbose format supported) for easy parsing by scripts.
-M
Invoke bus mapping mode which performs a thorough scan of all PCI devices, including those behind misconfigured bridges etc. This option is available only to root and it gives meaningful results only if combined with direct hardware access mode (otherwise the results are identical to normal listing modes, modulo bugs in lspci). Please note that the bus mapper doesn't support PCI domains and scans only domain 0.
--version
Shows lspci version. This option should be used stand-alone.

PCILIB OPTIONS

The PCI utilities use PCILIB (a portable library providing platform-independent functions for PCI configuration space access) to talk to the PCI cards. The following options control parameters of the library, especially what access method it uses. By default, PCILIB uses the first available access method and displays no debugging messages. Each switch is accompanied by a list of hardware/software configurations it's supported in.

-P <dir>
Force use of Linux /proc/bus/pci style configuration access, using <dir> instead of /proc/bus/pci. (Linux 2.1 or newer only)
-H1
Use direct hardware access via Intel configuration mechanism 1. (i386 and compatible only)
-H2
Use direct hardware access via Intel configuration mechanism 2. Warning: This method is able to address only first 16 devices on any bus and it seems to be very unreliable in many cases. (i386 and compatible only)
-F <file>
Extract all information from given file containing output of lspci -x. This is very useful for analysis of user-supplied bug reports, because you can display the hardware configuration in any way you want without disturbing the user with requests for more dumps. (All systems)
-G
Increase debug level of the library. (All systems)

FILES

/usr/share/hwdata/pci.ids
A list of all known PCI ID's (vendors, devices, classes and subclasses).
/proc/bus/pci
An interface to PCI bus configuration space provided by the post-2.1.82 Linux kernels. Contains per-bus subdirectories with per-card config space files and a devices file containing a list of all PCI devices.

SEE ALSO

setpci(8), update-pciids(8)

0 0