2 .\" Stefan Esser <se@FreeBSD.org>. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .Nd diagnostic utility for the PCI bus
40 .Fl r Oo Fl b | h Oc Ar selector addr Ns Op : Ns Ar addr2
42 .Fl w Oo Fl b | h Oc Ar selector addr value
46 utility provides a command line interface to functionality provided by the
50 As such, some of the functions are only available to users with write
53 normally only the super-user.
57 option, it lists all devices found by the boot probe in the following format:
59 foo0@pci0:4:0: class=0x010000 card=0x00000000 chip=0x000f1000 rev=0x01 hdr=0x00
60 bar0@pci0:5:0: class=0x000100 card=0x00000000 chip=0x88c15333 rev=0x00 hdr=0x00
61 none0@pci0:6:0: class=0x020000 card=0x00000000 chip=0x802910ec rev=0x00 hdr=0x00
64 The first column gives the
65 device name, unit number, and
67 If there is no device configured in the kernel for the
69 device in question, the device name will be
71 Unit numbers for unconfigured devices start at zero and are incremented for
72 each unconfigured device that is encountered.
75 is in a form which may directly be used for the other forms of the command.
76 The second column is the class code, with the class byte printed as two
77 hex digits, followed by the sub-class and the interface bytes.
78 The third column gives the contents of the subvendorid register, introduced
79 in revision 2.1 of the
82 Note that it will be 0 for older cards.
83 The field consists of the card ID in the upper
84 half and the card vendor ID in the lower half of the value.
86 The fourth column contains the chip device ID, which identifies the chip
87 this card is based on.
88 It consists of two fields, identifying the chip and
90 The fifth column prints the chip's revision.
91 The sixth column describes the header type.
92 Currently assigned header types include 0 for most devices,
102 If the most significant bit
103 of the header type register is set for
108 device, which contains several (similar or independent) functions on
115 will list any capabilities supported by each device.
116 Each capability will be enumerated via a line in the following format:
118 cap 10[40] = PCI-Express 1 root port
121 The first value after the
123 prefix is the capability ID in hexadecimal.
124 The second value in the square brackets is the offset of the capability
125 in config space in hexadecimal.
126 The format of the text after the equals sign is capability-specific.
132 will attempt to load the vendor/device information database, and print
133 vendor, device, class and subclass identification strings for each device.
142 .Li pci Ns Va bus Ns \&: Ns Va device
143 (optionally followed by
144 .Li \&: Ns Va function ) .
145 A final colon may be appended and
146 will be ignored; this is so that the first column in the output of
149 can be used without modification.
150 All numbers are base 10.
156 determines whether any driver has been assigned to the device
159 An exit status of zero indicates that the device has a driver;
160 non-zero indicates that it does not.
164 option reads a configuration space register at byte offset
168 and prints out its value in hexadecimal.
169 The optional second address
171 specifies a range to read.
176 into a configuration space register at byte offset
180 For both operations, the flags
184 select the width of the operation;
186 indicates a byte operation, and
188 indicates a halfword (two-byte) operation.
189 The default is to read or
190 write a longword (four bytes).
192 The PCI vendor/device information database is normally read from
193 .Pa /usr/share/misc/pci_vendors .
194 This path can be overridden by setting the environment variable
195 .Ev PCICONF_VENDOR_DATABASE .
203 utility appeared first in
215 utility was written by
218 .An Garrett Wollman .
224 options are implemented in
226 but not in the underlying
229 It might be useful to give non-root users access to the
234 But only root will be able to execute a
236 to provide the device with a driver KLD, and reading of configuration space
237 registers may cause a failure in badly designed