]> mj.ucw.cz Git - pciutils.git/blob - lspci.man
1d5583bb31d7aa98023593fd0a4d0711cbeb157a
[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 -x
61 Show hexadecimal dump of the standard part of the configuration space (the first
62 64 bytes or 128 bytes for CardBus bridges).
63 .TP
64 .B -xxx
65 Show hexadecimal dump of the whole PCI configuration space. It is available only to root
66 as several PCI devices
67 .B crash
68 when you try to read some parts of the config space (this behavior probably
69 doesn't violate the PCI standard, but it's at least very stupid). However, such
70 devices are rare, so you needn't worry much.
71 .TP
72 .B -xxxx
73 Show hexadecimal dump of the extended (4096-byte) PCI configuration space available
74 on PCI-X 2.0 and PCI Express buses.
75 .TP
76 .B -b
77 Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the
78 PCI bus instead of as seen by the kernel.
79 .TP
80 .B -t
81 Show a tree-like diagram containing all buses, bridges, devices and connections
82 between them.
83 .TP
84 .B -s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]
85 Show only devices in the specified domain (in case your machine has several host bridges,
86 they can either share a common bus number space or each of them can address a PCI domain
87 of its own; domains are numbered from 0 to ffff), bus (0 to ff), slot (0 to 1f) and function (0 to 7).
88 Each component of the device address can be omitted or set to "*", both meaning "any value". All numbers are
89 hexadecimal.  E.g., "0:" means all devices on bus 0, "0" means all functions of device 0
90 on any bus, "0.3" selects third function of device 0 on all buses and ".4" shows only
91 the fourth function of each device.
92 .TP
93 .B -d [<vendor>]:[<device>]
94 Show only devices with specified vendor and device ID. Both ID's are given in
95 hexadecimal and may be omitted or given as "*", both meaning "any value".
96 .TP
97 .B -i <file>
98 Use
99 .B
100 <file>
101 as the PCI ID list instead of @IDSDIR@/pci.ids.
102 .TP
103 .B -m
104 Dump PCI device data in a backward-compatible machine readable form.
105 See below for details.
106 .TP
107 .B -mm
108 Dump PCI device data in a machine readable form for easy parsing by scripts.
109 See below for details.
110 .TP
111 .B -D
112 Always show PCI domain numbers. By default, lspci suppresses them on machines which
113 have only domain 0.
114 .TP
115 .B -M
116 Invoke bus mapping mode which performs a thorough scan of all PCI devices, including
117 those behind misconfigured bridges etc. This option is available only to root and it
118 gives meaningful results only if combined with direct hardware access mode (otherwise
119 the results are identical to normal listing modes, modulo bugs in lspci). Please note
120 that the bus mapper doesn't support PCI domains and scans only domain 0.
121 .TP
122 .B --version
123 Shows
124 .I lspci
125 version. This option should be used stand-alone.
126
127 .SH PCILIB AND ITS OPTIONS
128 The PCI utilities use PCILIB (a portable library providing platform-independent
129 functions for PCI configuration space access) to talk to the PCI cards. It supports
130 the following access methods:
131
132 .TP
133 .B linux_sysfs
134 The
135 .B /sys
136 filesystem on Linux 2.6 and newer. The standard header of the config space is available
137 to all users, the rest only to root. Supports extended configuration space and PCI domains.
138 .TP
139 .B linux_proc
140 The
141 .B /proc/bus/pci
142 interface supported by Linux 2.1 and newer. The standard header of the config space is available
143 to all users, the rest only to root.
144 .TP
145 .B intel_conf1
146 Direct hardware access via Intel configuration mechanism 1. Available on i386 and compatibles
147 on Linux, Solaris/x86, GNU Hurd and Windows. Requires root privileges.
148 .TP
149 .B intel_conf2
150 Direct hardware access via Intel configuration mechanism 2. Available on i386 and compatibles
151 on Linux, Solaris/x86 and GNU Hurd. Requires root privileges. Warning: This method
152 is able to address only first 16 devices on any bus and it seems to be very
153 unreliable in many cases.
154 .TP
155 .B fbsd_device
156 The
157 .B /dev/pci
158 device on FreeBSD. Requires root privileges.
159 .TP
160 .B obsd_device
161 The
162 .B /dev/pci
163 device on OpenBSD. Requires root privileges.
164 .TP
165 .B nbsd_libpci
166 The
167 .B /dev/pci0
168 device on NetBSD accessed using the local libpci library.
169 .TP
170 .B aix_device
171 Access method used on AIX. Requires root privileges.
172
173 .P
174 By default, PCILIB uses the first available access method and displays no debugging
175 messages, but you can use the following switches to control its behavior:
176
177 .TP
178 .B -P <dir>
179 Force use of the linux_proc access method, using
180 .B <dir>
181 instead of /proc/bus/pci.
182 .TP
183 .B -H1
184 Use direct hardware access via Intel configuration mechanism 1.
185 .TP
186 .B -H2
187 Use direct hardware access via Intel configuration mechanism 2.
188 .TP
189 .B -F <file>
190 Extract all information from given file containing output of lspci -x. This is very
191 useful for analysis of user-supplied bug reports, because you can display the
192 hardware configuration in any way you want without disturbing the user with
193 requests for more dumps.
194 .TP
195 .B -G
196 Increase debug level of the library.
197
198 .SH MACHINE READABLE OUTPUT
199 If you intend to process the output of lspci automatically, please use one of the
200 machine-readable output formats
201 .RB ( -m ,
202 .BR -vm ,
203 .BR -vmm )
204 described in this section. All other formats are likely to change
205 between versions of lspci.
206
207 .P
208 All numbers are always printed in hexadecimal. If you want to process numeric ID's instead of
209 names, please add the
210 .B -n
211 switch.
212
213 .SS Simple format (-m)
214
215 In the simple format, each device is described on a single line, which is
216 formatted as parameters suitable for passing to a shell script, i.e., values
217 separated by whitespaces, quoted and escaped if necessary.
218 Some of the arguments are positional: slot, class, vendor name, device name,
219 subsystem vendor name and subsystem name (the last two are empty if
220 the device has no subsystem); the remaining arguments are option-like:
221
222 .TP
223 .BI -r rev
224 Revision number.
225
226 .TP
227 .BI -p progif
228 Programming interface.
229
230 .P
231 The relative order of positional arguments and options is undefined.
232 New options can be added in future versions, but they will always
233 have a single argument not separated from the option by any spaces,
234 so they can be easily ignored if not recognized.
235
236 .SS Verbose format (-vmm)
237
238 The verbose output is a sequence of records separated by blank lines.
239 Each record describes a single device by a sequence of lines, each line
240 containing a single
241 .RI ` tag :
242 .IR value '
243 pair. The
244 .I tag
245 and the
246 .I value
247 are separated by a single tab character.
248 Neither the records nor the lines within a record are in any particular order.
249 Tags are case-sensitive.
250
251 .P
252 The following tags are defined:
253
254 .TP
255 .B Slot
256 The name of the slot where the device resides
257 .RI ([ domain :] bus : device . function ).
258 This tag is always the first in a record.
259
260 .TP
261 .B Class
262 Name of the class.
263
264 .TP
265 .B Vendor
266 Name of the vendor.
267
268 .TP
269 .B Device
270 Name of the device.
271
272 .TP
273 .B SVendor
274 Name of the subsystem vendor (optional).
275
276 .TP
277 .B SDevice
278 Name of the subsystem (optional).
279
280 .TP
281 .B Rev
282 Revision number (optional).
283
284 .TP
285 .B ProgIf
286 Programming interface (optional).
287
288 .P
289 New tags can be added in future versions, so you should silently ignore any tags you don't recognize.
290
291 .SS Backward-compatible verbose format (-vm)
292
293 In this mode, lspci tries to be perfectly compatible with its old versions.
294 It's almost the same as the regular verbose format, but the
295 .B
296 Device
297 tag is used for both the slot and the device name, so it occurs twice
298 in a single record. Please avoid using this format in any new code.
299
300 .SH FILES
301 .TP
302 .B @IDSDIR@/pci.ids
303 A list of all known PCI ID's (vendors, devices, classes and subclasses). Maintained
304 at http://pciids.sourceforge.net/, use the
305 .B update-pciids
306 utility to download the most recent version.
307 .TP
308 .B @IDSDIR@/pci.ids.gz
309 If lspci is compiled with support for compression, this file is tried before pci.ids.
310 .TP
311 .B /proc/bus/pci
312 An interface to PCI bus configuration space provided by the post-2.1.82 Linux
313 kernels. Contains per-bus subdirectories with per-card config space files and a
314 .I devices
315 file containing a list of all PCI devices.
316
317 .SH BUGS
318
319 Sometimes, lspci is not able to decode the configuration registers completely.
320 This usually happens when not enough documentation was available to the authors.
321 In such cases, it at least prints the
322 .B <?>
323 mark to signal that there is potentially something more to say. If you know
324 the details, patches will be of course welcome.
325
326 Access to the extended configuration space is currently supported only by the
327 .B linux_sysfs
328 back-end.
329
330 .SH SEE ALSO
331 .BR setpci (8),
332 .BR update-pciids (8)
333
334 .SH AUTHOR
335 The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.