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