]> git.ipfire.org Git - thirdparty/pciutils.git/blame - lspci.man
Document new filter syntax in man pages
[thirdparty/pciutils.git] / lspci.man
CommitLineData
4284af58 1.TH lspci 8 "@TODAY@" "@VERSION@" "The PCI Utilities"
2f48f637
MM
2.SH NAME
3lspci \- list all PCI devices
4.SH SYNOPSIS
5.B lspci
6.RB [ options ]
7.SH DESCRIPTION
8.B lspci
f2bf13dc
MM
9is a utility for displaying information about PCI buses in the system and
10devices connected to them.
727ce158 11
84d437d6
MM
12By default, it shows a brief list of devices. Use the options described
13below to request either a more verbose output or output intended for
14parsing by other programs.
15
2f48f637
MM
16If you are going to report bugs in PCI device drivers or in
17.I lspci
84d437d6
MM
18itself, please include output of "lspci -vvx" or even better "lspci -vvxxx"
19(however, see below for possible caveats).
20
f2bf13dc
MM
21Some parts of the output, especially in the highly verbose modes, are probably
22intelligible only to experienced PCI hackers. For exact definitions of
84d437d6
MM
23the fields, please consult either the PCI specifications or the
24.B header.h
25and
26.B /usr/include/linux/pci.h
27include files.
28
29Access to some parts of the PCI configuration space is restricted to root
30on many operating systems, so the features of
31.I lspci
32available to normal users are limited. However,
33.I lspci
34tries its best to display as much as available and mark all other
35information with
36.I <access denied>
37text.
2f48f637
MM
38
39.SH OPTIONS
f2bf13dc
MM
40
41.SS Basic display modes
42.TP
43.B -m
44Dump PCI device data in a backward-compatible machine readable form.
45See below for details.
46.TP
47.B -mm
48Dump PCI device data in a machine readable form for easy parsing by scripts.
49See below for details.
50.TP
51.B -t
52Show a tree-like diagram containing all buses, bridges, devices and connections
53between them.
54
55.SS Display options
2f48f637
MM
56.TP
57.B -v
84d437d6 58Be verbose and display detailed information about all devices.
2f48f637
MM
59.TP
60.B -vv
84d437d6
MM
61Be very verbose and display more details. This level includes everything deemed
62useful.
63.TP
64.B -vvv
65Be even more verbose and display everything we are able to parse,
66even if it doesn't look interesting at all (e.g., undefined memory regions).
2f48f637 67.TP
f2bf13dc
MM
68.B -k
69Show kernel drivers handling each device and also kernel modules capable of handling it.
70Turned on by default when
71.B -v
72is given in the normal mode of output.
73(Currently works only on Linux with kernel 2.6 or newer.)
74.TP
75.B -x
76Show hexadecimal dump of the standard part of the configuration space (the first
7764 bytes or 128 bytes for CardBus bridges).
78.TP
79.B -xxx
80Show hexadecimal dump of the whole PCI configuration space. It is available only to root
81as several PCI devices
82.B crash
83when you try to read some parts of the config space (this behavior probably
84doesn't violate the PCI standard, but it's at least very stupid). However, such
85devices are rare, so you needn't worry much.
86.TP
87.B -xxxx
88Show hexadecimal dump of the extended (4096-byte) PCI configuration space available
89on PCI-X 2.0 and PCI Express buses.
90.TP
91.B -b
92Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the
93PCI bus instead of as seen by the kernel.
94.TP
95.B -D
96Always show PCI domain numbers. By default, lspci suppresses them on machines which
97have only domain 0.
62e78fa6
MM
98.TP
99.B -P
100Identify PCI devices by path through each bridge, instead of by bus number.
101.TP
102.B -PP
103Identify PCI devices by path through each bridge, showing the bus number as
104well as the device number.
f2bf13dc
MM
105
106.SS Options to control resolving ID's to names
107.TP
2f48f637
MM
108.B -n
109Show PCI vendor and device codes as numbers instead of looking them up in the
84d437d6 110PCI ID list.
2f48f637 111.TP
bc2eed2d
MM
112.B -nn
113Show PCI vendor and device codes as both numbers and names.
114.TP
7059c711
MM
115.B -q
116Use DNS to query the central PCI ID database if a device is not found in the local
117.B pci.ids
118file. If the DNS query succeeds, the result is cached in
119.B ~/.pciids-cache
120and it is recognized in subsequent runs even if
121.B -q
122is not given any more. Please use this switch inside automated scripts only
123with caution to avoid overloading the database servers.
124.TP
125.B -qq
126Same as
127.BR -q ,
128but the local cache is reset.
129.TP
130.B -Q
131Query the central database even for entries which are recognized locally.
132Use this if you suspect that the displayed entry is wrong.
f2bf13dc
MM
133
134.SS Options for selection of devices
2f48f637 135.TP
c8b1fb09 136.B -s [[[[<domain>]:]<bus>]:][<device>][.[<func>]]
1f7c91cc
MM
137Show only devices in the specified domain (in case your machine has several host bridges,
138they can either share a common bus number space or each of them can address a PCI domain
c8b1fb09 139of its own; domains are numbered from 0 to ffff), bus (0 to ff), device (0 to 1f) and function (0 to 7).
1f7c91cc 140Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
e4842ff3 141hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
727ce158 142on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
1f7c91cc 143the fourth function of each device.
e4842ff3 144.TP
2c32712a
MM
145.B -d [<vendor>]:[<device>][:<class>[:<prog-if>]]
146Show only devices with specified vendor, device, class ID, and programming interface.
147The ID's are given in hexadecimal and may be omitted or given as "*", both meaning
148"any value". The class ID can contain "x" characters which stand for "any digit".
f2bf13dc
MM
149
150.SS Other options
2f48f637
MM
151.TP
152.B -i <file>
153Use
154.B
155<file>
54e13765 156as the PCI ID list instead of @IDSDIR@/pci.ids.
0a33d0ec 157.TP
11339c0d
MM
158.B -p <file>
159Use
160.B
161<file>
162as the map of PCI ID's handled by kernel modules. By default, lspci uses
163.RI /lib/modules/ kernel_version /modules.pcimap.
164Applies only to Linux systems with recent enough module tools.
165.TP
1812a795 166.B -M
1f7c91cc 167Invoke bus mapping mode which performs a thorough scan of all PCI devices, including
cea2dfbc
MM
168those behind misconfigured bridges, etc. This option gives meaningful results only
169with a direct hardware access mode, which usually requires root privileges.
c87f3d73
MM
170By default, the bus mapper scans domain. You can use the
171.B -s
172option to select a different domain.
89984232
MM
173.TP
174.B --version
94db5c82 175Shows
89984232 176.I lspci
1f7c91cc 177version. This option should be used stand-alone.
2f48f637 178
f2bf13dc
MM
179.SS PCI access options
180.PP
181The PCI utilities use the PCI library to talk to PCI devices (see
182\fBpcilib\fP(7) for details). You can use the following options to
183influence its behavior:
84d437d6 184.TP
f2bf13dc
MM
185.B -A <method>
186The library supports a variety of methods to access the PCI hardware.
187By default, it uses the first access method available, but you can use
188this option to override this decision. See \fB-A help\fP for a list of
189available methods and their descriptions.
727ce158 190.TP
f2bf13dc
MM
191.B -O <param>=<value>
192The behavior of the library is controlled by several named parameters.
8f33a693 193This option allows one to set the value of any of the parameters. Use \fB-O help\fP
f2bf13dc 194for a list of known parameters and their default values.
727ce158
MM
195.TP
196.B -H1
84d437d6 197Use direct hardware access via Intel configuration mechanism 1.
f2bf13dc 198(This is a shorthand for \fB-A intel-conf1\fP.)
727ce158
MM
199.TP
200.B -H2
84d437d6 201Use direct hardware access via Intel configuration mechanism 2.
f2bf13dc 202(This is a shorthand for \fB-A intel-conf2\fP.)
727ce158 203.TP
727ce158 204.B -F <file>
f2bf13dc
MM
205Instead of accessing real hardware, read the list of devices and values of their
206configuration registers from the given file produced by an earlier run of lspci -x.
207This is very useful for analysis of user-supplied bug reports, because you can display
208the hardware 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
2849a165
AC
296.TP
297.B PhySlot
298The physical slot where the device resides (optional, Linux only).
299
6d896960
MM
300.TP
301.B Rev
302Revision number (optional).
303
304.TP
305.B ProgIf
306Programming interface (optional).
307
11339c0d
MM
308.TP
309.B Driver
310Kernel driver currently handling the device (optional, Linux only).
311
312.TP
313.B Module
314Kernel module reporting that it is capable of handling the device
1036aa24 315(optional, Linux only). Multiple lines with this tag can occur.
11339c0d 316
1d9d1a01
MM
317.TP
318.B NUMANode
319NUMA node this device is connected to (optional, Linux only).
320
a5065438
AXH
321.TP
322.B IOMMUGroup
323IOMMU group that this device is part of (optional, Linux only).
324
6d896960
MM
325.P
326New tags can be added in future versions, so you should silently ignore any tags you don't recognize.
327
328.SS Backward-compatible verbose format (-vm)
329
330In this mode, lspci tries to be perfectly compatible with its old versions.
331It's almost the same as the regular verbose format, but the
332.B
333Device
334tag is used for both the slot and the device name, so it occurs twice
335in a single record. Please avoid using this format in any new code.
336
2f48f637
MM
337.SH FILES
338.TP
54e13765 339.B @IDSDIR@/pci.ids
84d437d6 340A list of all known PCI ID's (vendors, devices, classes and subclasses). Maintained
633e6f81 341at https://pci-ids.ucw.cz/, use the
84d437d6
MM
342.B update-pciids
343utility to download the most recent version.
2f48f637 344.TP
cc062b4a
MM
345.B @IDSDIR@/pci.ids.gz
346If lspci is compiled with support for compression, this file is tried before pci.ids.
347.TP
7059c711
MM
348.B ~/.pciids-cache
349All ID's found in the DNS query mode are cached in this file.
2f48f637 350
fa2273ca
MM
351.SH BUGS
352
353Sometimes, lspci is not able to decode the configuration registers completely.
354This usually happens when not enough documentation was available to the authors.
355In such cases, it at least prints the
356.B <?>
357mark to signal that there is potentially something more to say. If you know
358the details, patches will be of course welcome.
359
360Access to the extended configuration space is currently supported only by the
361.B linux_sysfs
362back-end.
363
727ce158 364.SH SEE ALSO
1f7c91cc 365.BR setpci (8),
ef5b622f 366.BR pci.ids (5),
f2bf13dc
MM
367.BR update-pciids (8),
368.BR pcilib (7)
727ce158 369
2f48f637 370.SH AUTHOR
4284af58 371The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.