]> git.ipfire.org Git - thirdparty/pciutils.git/blame - lspci.man
Improved man pages. Parts related to the library moved to pcilib(7).
[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
f2bf13dc
MM
10is a utility for displaying information about PCI buses in the system and
11devices connected to them.
727ce158 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
f2bf13dc
MM
22Some parts of the output, especially in the highly verbose modes, are probably
23intelligible only to experienced PCI hackers. For exact definitions of
84d437d6
MM
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
f2bf13dc
MM
41
42.SS Basic display modes
43.TP
44.B -m
45Dump PCI device data in a backward-compatible machine readable form.
46See below for details.
47.TP
48.B -mm
49Dump PCI device data in a machine readable form for easy parsing by scripts.
50See below for details.
51.TP
52.B -t
53Show a tree-like diagram containing all buses, bridges, devices and connections
54between them.
55
56.SS Display options
2f48f637
MM
57.TP
58.B -v
84d437d6 59Be verbose and display detailed information about all devices.
2f48f637
MM
60.TP
61.B -vv
84d437d6
MM
62Be very verbose and display more details. This level includes everything deemed
63useful.
64.TP
65.B -vvv
66Be even more verbose and display everything we are able to parse,
67even if it doesn't look interesting at all (e.g., undefined memory regions).
2f48f637 68.TP
f2bf13dc
MM
69.B -k
70Show kernel drivers handling each device and also kernel modules capable of handling it.
71Turned on by default when
72.B -v
73is given in the normal mode of output.
74(Currently works only on Linux with kernel 2.6 or newer.)
75.TP
76.B -x
77Show hexadecimal dump of the standard part of the configuration space (the first
7864 bytes or 128 bytes for CardBus bridges).
79.TP
80.B -xxx
81Show hexadecimal dump of the whole PCI configuration space. It is available only to root
82as several PCI devices
83.B crash
84when you try to read some parts of the config space (this behavior probably
85doesn't violate the PCI standard, but it's at least very stupid). However, such
86devices are rare, so you needn't worry much.
87.TP
88.B -xxxx
89Show hexadecimal dump of the extended (4096-byte) PCI configuration space available
90on PCI-X 2.0 and PCI Express buses.
91.TP
92.B -b
93Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the
94PCI bus instead of as seen by the kernel.
95.TP
96.B -D
97Always show PCI domain numbers. By default, lspci suppresses them on machines which
98have only domain 0.
99
100.SS Options to control resolving ID's to names
101.TP
2f48f637
MM
102.B -n
103Show PCI vendor and device codes as numbers instead of looking them up in the
84d437d6 104PCI ID list.
2f48f637 105.TP
bc2eed2d
MM
106.B -nn
107Show PCI vendor and device codes as both numbers and names.
108.TP
7059c711
MM
109.B -q
110Use DNS to query the central PCI ID database if a device is not found in the local
111.B pci.ids
112file. If the DNS query succeeds, the result is cached in
113.B ~/.pciids-cache
114and it is recognized in subsequent runs even if
115.B -q
116is not given any more. Please use this switch inside automated scripts only
117with caution to avoid overloading the database servers.
118.TP
119.B -qq
120Same as
121.BR -q ,
122but the local cache is reset.
123.TP
124.B -Q
125Query the central database even for entries which are recognized locally.
126Use this if you suspect that the displayed entry is wrong.
f2bf13dc
MM
127
128.SS Options for selection of devices
2f48f637 129.TP
1f7c91cc
MM
130.B -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
131Show only devices in the specified domain (in case your machine has several host bridges,
132they can either share a common bus number space or each of them can address a PCI domain
133of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7).
134Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
e4842ff3 135hexadecimal. E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
727ce158 136on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
1f7c91cc 137the fourth function of each device.
e4842ff3
MM
138.TP
139.B -d [<vendor>]:[<device>]
140Show only devices with specified vendor and device ID. Both ID's are given in
1f7c91cc 141hexadecimal and may be omitted or given as "*", both meaning "any value".
f2bf13dc
MM
142
143.SS Other options
2f48f637
MM
144.TP
145.B -i <file>
146Use
147.B
148<file>
54e13765 149as the PCI ID list instead of @IDSDIR@/pci.ids.
0a33d0ec 150.TP
11339c0d
MM
151.B -p <file>
152Use
153.B
154<file>
155as the map of PCI ID's handled by kernel modules. By default, lspci uses
156.RI /lib/modules/ kernel_version /modules.pcimap.
157Applies only to Linux systems with recent enough module tools.
158.TP
1812a795 159.B -M
1f7c91cc
MM
160Invoke bus mapping mode which performs a thorough scan of all PCI devices, including
161those behind misconfigured bridges etc. This option is available only to root and it
162gives meaningful results only if combined with direct hardware access mode (otherwise
163the results are identical to normal listing modes, modulo bugs in lspci). Please note
164that the bus mapper doesn't support PCI domains and scans only domain 0.
89984232
MM
165.TP
166.B --version
94db5c82 167Shows
89984232 168.I lspci
1f7c91cc 169version. This option should be used stand-alone.
2f48f637 170
f2bf13dc
MM
171.SS PCI access options
172.PP
173The PCI utilities use the PCI library to talk to PCI devices (see
174\fBpcilib\fP(7) for details). You can use the following options to
175influence its behavior:
84d437d6 176.TP
f2bf13dc
MM
177.B -A <method>
178The library supports a variety of methods to access the PCI hardware.
179By default, it uses the first access method available, but you can use
180this option to override this decision. See \fB-A help\fP for a list of
181available methods and their descriptions.
727ce158 182.TP
f2bf13dc
MM
183.B -O <param>=<value>
184The behavior of the library is controlled by several named parameters.
185This option allows to set the value of any of the parameters. Use \fB-O help\fP
186for a list of known parameters and their default values.
727ce158
MM
187.TP
188.B -H1
84d437d6 189Use direct hardware access via Intel configuration mechanism 1.
f2bf13dc 190(This is a shorthand for \fB-A intel-conf1\fP.)
727ce158
MM
191.TP
192.B -H2
84d437d6 193Use direct hardware access via Intel configuration mechanism 2.
f2bf13dc 194(This is a shorthand for \fB-A intel-conf2\fP.)
727ce158 195.TP
727ce158 196.B -F <file>
f2bf13dc
MM
197Instead of accessing real hardware, read the list of devices and values of their
198configuration registers from the given file produced by an earlier run of lspci -x.
199This is very useful for analysis of user-supplied bug reports, because you can display
200the hardware configuration in any way you want without disturbing the user with
84d437d6 201requests for more dumps.
727ce158
MM
202.TP
203.B -G
84d437d6 204Increase debug level of the library.
727ce158 205
6d896960
MM
206.SH MACHINE READABLE OUTPUT
207If you intend to process the output of lspci automatically, please use one of the
208machine-readable output formats
209.RB ( -m ,
210.BR -vm ,
211.BR -vmm )
212described in this section. All other formats are likely to change
213between versions of lspci.
214
215.P
216All numbers are always printed in hexadecimal. If you want to process numeric ID's instead of
217names, please add the
218.B -n
219switch.
220
221.SS Simple format (-m)
222
223In the simple format, each device is described on a single line, which is
224formatted as parameters suitable for passing to a shell script, i.e., values
225separated by whitespaces, quoted and escaped if necessary.
226Some of the arguments are positional: slot, class, vendor name, device name,
227subsystem vendor name and subsystem name (the last two are empty if
228the device has no subsystem); the remaining arguments are option-like:
229
230.TP
231.BI -r rev
232Revision number.
233
234.TP
235.BI -p progif
236Programming interface.
237
238.P
239The relative order of positional arguments and options is undefined.
240New options can be added in future versions, but they will always
241have a single argument not separated from the option by any spaces,
242so they can be easily ignored if not recognized.
243
244.SS Verbose format (-vmm)
245
246The verbose output is a sequence of records separated by blank lines.
247Each record describes a single device by a sequence of lines, each line
248containing a single
249.RI ` tag :
250.IR value '
251pair. The
252.I tag
253and the
254.I value
255are separated by a single tab character.
256Neither the records nor the lines within a record are in any particular order.
257Tags are case-sensitive.
258
259.P
260The following tags are defined:
261
262.TP
263.B Slot
264The name of the slot where the device resides
265.RI ([ domain :] bus : device . function ).
266This tag is always the first in a record.
267
268.TP
269.B Class
270Name of the class.
271
272.TP
273.B Vendor
274Name of the vendor.
275
276.TP
277.B Device
278Name of the device.
279
280.TP
281.B SVendor
282Name of the subsystem vendor (optional).
283
284.TP
285.B SDevice
286Name of the subsystem (optional).
287
288.TP
289.B Rev
290Revision number (optional).
291
292.TP
293.B ProgIf
294Programming interface (optional).
295
11339c0d
MM
296.TP
297.B Driver
298Kernel driver currently handling the device (optional, Linux only).
299
300.TP
301.B Module
302Kernel module reporting that it is capable of handling the device
303(optional, Linux only).
304
6d896960
MM
305.P
306New tags can be added in future versions, so you should silently ignore any tags you don't recognize.
307
308.SS Backward-compatible verbose format (-vm)
309
310In this mode, lspci tries to be perfectly compatible with its old versions.
311It's almost the same as the regular verbose format, but the
312.B
313Device
314tag is used for both the slot and the device name, so it occurs twice
315in a single record. Please avoid using this format in any new code.
316
2f48f637
MM
317.SH FILES
318.TP
54e13765 319.B @IDSDIR@/pci.ids
84d437d6
MM
320A list of all known PCI ID's (vendors, devices, classes and subclasses). Maintained
321at http://pciids.sourceforge.net/, use the
322.B update-pciids
323utility to download the most recent version.
2f48f637 324.TP
cc062b4a
MM
325.B @IDSDIR@/pci.ids.gz
326If lspci is compiled with support for compression, this file is tried before pci.ids.
327.TP
7059c711
MM
328.B ~/.pciids-cache
329All ID's found in the DNS query mode are cached in this file.
2f48f637 330
fa2273ca
MM
331.SH BUGS
332
333Sometimes, lspci is not able to decode the configuration registers completely.
334This usually happens when not enough documentation was available to the authors.
335In such cases, it at least prints the
336.B <?>
337mark to signal that there is potentially something more to say. If you know
338the details, patches will be of course welcome.
339
340Access to the extended configuration space is currently supported only by the
341.B linux_sysfs
342back-end.
343
727ce158 344.SH SEE ALSO
1f7c91cc 345.BR setpci (8),
f2bf13dc
MM
346.BR update-pciids (8),
347.BR pcilib (7)
727ce158 348
2f48f637 349.SH AUTHOR
4284af58 350The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.