]> git.ipfire.org Git - thirdparty/pciutils.git/blame - lspci.man
Finished support for displaying of kernel drivers/modules.
[thirdparty/pciutils.git] / lspci.man
CommitLineData
4284af58 1.TH lspci 8 "@TODAY@" "@VERSION@" "The PCI Utilities"
2f48f637
MM
2.IX lspci
3.SH NAME
4lspci \- list all PCI devices
5.SH SYNOPSIS
6.B lspci
7.RB [ options ]
8.SH DESCRIPTION
9.B lspci
727ce158
MM
10is a utility for displaying information about all PCI buses in the system and
11all devices connected to them.
12
84d437d6
MM
13By default, it shows a brief list of devices. Use the options described
14below to request either a more verbose output or output intended for
15parsing by other programs.
16
2f48f637
MM
17If you are going to report bugs in PCI device drivers or in
18.I lspci
84d437d6
MM
19itself, please include output of "lspci -vvx" or even better "lspci -vvxxx"
20(however, see below for possible caveats).
21
22Some parts of the output, especially in the highly verbose modes, is probably
23intelligible only to experienced PCI hackers. For the exact definitions of
24the fields, please consult either the PCI specifications or the
25.B header.h
26and
27.B /usr/include/linux/pci.h
28include files.
29
30Access to some parts of the PCI configuration space is restricted to root
31on many operating systems, so the features of
32.I lspci
33available to normal users are limited. However,
34.I lspci
35tries its best to display as much as available and mark all other
36information with
37.I <access denied>
38text.
2f48f637
MM
39
40.SH OPTIONS
41.TP
42.B -v
84d437d6 43Be verbose and display detailed information about all devices.
2f48f637
MM
44.TP
45.B -vv
84d437d6
MM
46Be very verbose and display more details. This level includes everything deemed
47useful.
48.TP
49.B -vvv
50Be even more verbose and display everything we are able to parse,
51even if it doesn't look interesting at all (e.g., undefined memory regions).
2f48f637
MM
52.TP
53.B -n
54Show PCI vendor and device codes as numbers instead of looking them up in the
84d437d6 55PCI ID list.
2f48f637 56.TP
bc2eed2d
MM
57.B -nn
58Show PCI vendor and device codes as both numbers and names.
59.TP
2f48f637 60.B -x
84d437d6
MM
61Show hexadecimal dump of the standard part of the configuration space (the first
6264 bytes or 128 bytes for CardBus bridges).
2f48f637 63.TP
472bd340 64.B -xxx
84d437d6 65Show hexadecimal dump of the whole PCI configuration space. It is available only to root
472bd340
MM
66as several PCI devices
67.B crash
84d437d6
MM
68when you try to read some parts of the config space (this behavior probably
69doesn't violate the PCI standard, but it's at least very stupid). However, such
70devices are rare, so you needn't worry much.
2f48f637 71.TP
ec25b52d 72.B -xxxx
84d437d6
MM
73Show hexadecimal dump of the extended (4096-byte) PCI configuration space available
74on PCI-X 2.0 and PCI Express buses.
ec25b52d 75.TP
11339c0d
MM
76.B -k
77Show kernel drivers handling each device and also kernel modules capable of handling it.
78Turned on by default when
79.B -v
80is given in the normal mode of output.
81(Currently works only on Linux with kernel 2.6 or newer.)
82.TP
2f48f637
MM
83.B -b
84Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the
85PCI bus instead of as seen by the kernel.
86.TP
87.B -t
727ce158 88Show a tree-like diagram containing all buses, bridges, devices and connections
2f48f637
MM
89between them.
90.TP
1f7c91cc
MM
91.B -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
92Show only devices in the specified domain (in case your machine has several host bridges,
93they can either share a common bus number space or each of them can address a PCI domain
94of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7).
95Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
e4842ff3 96hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
727ce158 97on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
1f7c91cc 98the fourth function of each device.
e4842ff3
MM
99.TP
100.B -d [<vendor>]:[<device>]
101Show only devices with specified vendor and device ID. Both ID's are given in
1f7c91cc 102hexadecimal and may be omitted or given as "*", both meaning "any value".
2f48f637
MM
103.TP
104.B -i <file>
105Use
106.B
107<file>
54e13765 108as the PCI ID list instead of @IDSDIR@/pci.ids.
0a33d0ec 109.TP
11339c0d
MM
110.B -p <file>
111Use
112.B
113<file>
114as the map of PCI ID's handled by kernel modules. By default, lspci uses
115.RI /lib/modules/ kernel_version /modules.pcimap.
116Applies only to Linux systems with recent enough module tools.
117.TP
0a33d0ec 118.B -m
6d896960
MM
119Dump PCI device data in a backward-compatible machine readable form.
120See below for details.
121.TP
122.B -mm
123Dump PCI device data in a machine readable form for easy parsing by scripts.
124See below for details.
1812a795 125.TP
af61eb25
MM
126.B -D
127Always show PCI domain numbers. By default, lspci suppresses them on machines which
128have only domain 0.
129.TP
1812a795 130.B -M
1f7c91cc
MM
131Invoke bus mapping mode which performs a thorough scan of all PCI devices, including
132those behind misconfigured bridges etc. This option is available only to root and it
133gives meaningful results only if combined with direct hardware access mode (otherwise
134the results are identical to normal listing modes, modulo bugs in lspci). Please note
135that the bus mapper doesn't support PCI domains and scans only domain 0.
89984232
MM
136.TP
137.B --version
94db5c82 138Shows
89984232 139.I lspci
1f7c91cc 140version. This option should be used stand-alone.
2f48f637 141
84d437d6 142.SH PCILIB AND ITS OPTIONS
727ce158 143The PCI utilities use PCILIB (a portable library providing platform-independent
84d437d6
MM
144functions for PCI configuration space access) to talk to the PCI cards. It supports
145the following access methods:
146
147.TP
148.B linux_sysfs
149The
150.B /sys
151filesystem on Linux 2.6 and newer. The standard header of the config space is available
11339c0d
MM
152to all users, the rest only to root. Supports extended configuration space, PCI domains
153and information on attached kernel drivers.
84d437d6
MM
154.TP
155.B linux_proc
156The
157.B /proc/bus/pci
158interface supported by Linux 2.1 and newer. The standard header of the config space is available
159to all users, the rest only to root.
160.TP
161.B intel_conf1
162Direct hardware access via Intel configuration mechanism 1. Available on i386 and compatibles
163on Linux, Solaris/x86, GNU Hurd and Windows. Requires root privileges.
164.TP
165.B intel_conf2
166Direct hardware access via Intel configuration mechanism 2. Available on i386 and compatibles
167on Linux, Solaris/x86 and GNU Hurd. Requires root privileges. Warning: This method
168is able to address only first 16 devices on any bus and it seems to be very
169unreliable in many cases.
170.TP
171.B fbsd_device
172The
173.B /dev/pci
174device on FreeBSD. Requires root privileges.
175.TP
f04b3863
MM
176.B obsd_device
177The
178.B /dev/pci
179device on OpenBSD. Requires root privileges.
84d437d6
MM
180.TP
181.B nbsd_libpci
182The
183.B /dev/pci0
184device on NetBSD accessed using the local libpci library.
f04b3863
MM
185.TP
186.B aix_device
187Access method used on AIX. Requires root privileges.
84d437d6
MM
188
189.P
727ce158 190By default, PCILIB uses the first available access method and displays no debugging
84d437d6 191messages, but you can use the following switches to control its behavior:
727ce158
MM
192
193.TP
194.B -P <dir>
84d437d6 195Force use of the linux_proc access method, using
727ce158 196.B <dir>
84d437d6 197instead of /proc/bus/pci.
727ce158
MM
198.TP
199.B -H1
84d437d6 200Use direct hardware access via Intel configuration mechanism 1.
727ce158
MM
201.TP
202.B -H2
84d437d6 203Use direct hardware access via Intel configuration mechanism 2.
727ce158 204.TP
727ce158
MM
205.B -F <file>
206Extract all information from given file containing output of lspci -x. This is very
207useful for analysis of user-supplied bug reports, because you can display the
208hardware configuration in any way you want without disturbing the user with
84d437d6 209requests for more dumps.
727ce158
MM
210.TP
211.B -G
84d437d6 212Increase debug level of the library.
727ce158 213
6d896960
MM
214.SH MACHINE READABLE OUTPUT
215If you intend to process the output of lspci automatically, please use one of the
216machine-readable output formats
217.RB ( -m ,
218.BR -vm ,
219.BR -vmm )
220described in this section. All other formats are likely to change
221between versions of lspci.
222
223.P
224All numbers are always printed in hexadecimal. If you want to process numeric ID's instead of
225names, please add the
226.B -n
227switch.
228
229.SS Simple format (-m)
230
231In the simple format, each device is described on a single line, which is
232formatted as parameters suitable for passing to a shell script, i.e., values
233separated by whitespaces, quoted and escaped if necessary.
234Some of the arguments are positional: slot, class, vendor name, device name,
235subsystem vendor name and subsystem name (the last two are empty if
236the device has no subsystem); the remaining arguments are option-like:
237
238.TP
239.BI -r rev
240Revision number.
241
242.TP
243.BI -p progif
244Programming interface.
245
246.P
247The relative order of positional arguments and options is undefined.
248New options can be added in future versions, but they will always
249have a single argument not separated from the option by any spaces,
250so they can be easily ignored if not recognized.
251
252.SS Verbose format (-vmm)
253
254The verbose output is a sequence of records separated by blank lines.
255Each record describes a single device by a sequence of lines, each line
256containing a single
257.RI ` tag :
258.IR value '
259pair. The
260.I tag
261and the
262.I value
263are separated by a single tab character.
264Neither the records nor the lines within a record are in any particular order.
265Tags are case-sensitive.
266
267.P
268The following tags are defined:
269
270.TP
271.B Slot
272The name of the slot where the device resides
273.RI ([ domain :] bus : device . function ).
274This tag is always the first in a record.
275
276.TP
277.B Class
278Name of the class.
279
280.TP
281.B Vendor
282Name of the vendor.
283
284.TP
285.B Device
286Name of the device.
287
288.TP
289.B SVendor
290Name of the subsystem vendor (optional).
291
292.TP
293.B SDevice
294Name of the subsystem (optional).
295
296.TP
297.B Rev
298Revision number (optional).
299
300.TP
301.B ProgIf
302Programming interface (optional).
303
11339c0d
MM
304.TP
305.B Driver
306Kernel driver currently handling the device (optional, Linux only).
307
308.TP
309.B Module
310Kernel module reporting that it is capable of handling the device
311(optional, Linux only).
312
6d896960
MM
313.P
314New tags can be added in future versions, so you should silently ignore any tags you don't recognize.
315
316.SS Backward-compatible verbose format (-vm)
317
318In this mode, lspci tries to be perfectly compatible with its old versions.
319It's almost the same as the regular verbose format, but the
320.B
321Device
322tag is used for both the slot and the device name, so it occurs twice
323in a single record. Please avoid using this format in any new code.
324
2f48f637
MM
325.SH FILES
326.TP
54e13765 327.B @IDSDIR@/pci.ids
84d437d6
MM
328A list of all known PCI ID's (vendors, devices, classes and subclasses). Maintained
329at http://pciids.sourceforge.net/, use the
330.B update-pciids
331utility to download the most recent version.
2f48f637 332.TP
cc062b4a
MM
333.B @IDSDIR@/pci.ids.gz
334If lspci is compiled with support for compression, this file is tried before pci.ids.
335.TP
2f48f637 336.B /proc/bus/pci
727ce158
MM
337An interface to PCI bus configuration space provided by the post-2.1.82 Linux
338kernels. Contains per-bus subdirectories with per-card config space files and a
339.I devices
2f48f637
MM
340file containing a list of all PCI devices.
341
fa2273ca
MM
342.SH BUGS
343
344Sometimes, lspci is not able to decode the configuration registers completely.
345This usually happens when not enough documentation was available to the authors.
346In such cases, it at least prints the
347.B <?>
348mark to signal that there is potentially something more to say. If you know
349the details, patches will be of course welcome.
350
351Access to the extended configuration space is currently supported only by the
352.B linux_sysfs
353back-end.
354
727ce158 355.SH SEE ALSO
1f7c91cc
MM
356.BR setpci (8),
357.BR update-pciids (8)
727ce158 358
2f48f637 359.SH AUTHOR
4284af58 360The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.