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