]> git.ipfire.org Git - thirdparty/pciutils.git/blame - pcilib.man
ls-ecaps: Correct the link state reporting
[thirdparty/pciutils.git] / pcilib.man
CommitLineData
f2bf13dc 1.TH pcilib 7 "@TODAY@" "@VERSION@" "The PCI Utilities"
f2bf13dc
MM
2.SH NAME
3pcilib \- a library for accessing PCI devices
4
5.SH DESCRIPTION
6
7The PCI library (also known as \fIpcilib\fP and \fIlibpci\fP) is a portable library
8for accessing PCI devices and their configuration space.
9
10.SH ACCESS METHODS
11
12.PP
13The library supports a variety of methods to access the configuration space
14on different operating systems. By default, the first matching method in this
15list is used, but you can specify override the decision (see the \fB-A\fP switch
16of \fIlspci\fP).
17
18.TP
19.B linux-sysfs
20The
21.B /sys
22filesystem on Linux 2.6 and newer. The standard header of the config space is available
9bd5b1cf 23to all users, the rest only to root. Supports extended configuration space, PCI domains,
e16e04e8
MM
24VPD (from Linux 2.6.26), physical slots (also since Linux 2.6.26) and information on attached
25kernel drivers.
f2bf13dc
MM
26.TP
27.B linux-proc
28The
29.B /proc/bus/pci
30interface supported by Linux 2.1 and newer. The standard header of the config space is available
31to all users, the rest only to root.
32.TP
33.B intel-conf1
34Direct hardware access via Intel configuration mechanism 1. Available on i386 and compatibles
40e253d7 35on Linux, Solaris/x86, GNU Hurd, Windows, BeOS and Haiku. Requires root privileges.
f2bf13dc
MM
36.TP
37.B intel-conf2
38Direct hardware access via Intel configuration mechanism 2. Available on i386 and compatibles
40e253d7 39on Linux, Solaris/x86, GNU Hurd, Windows, BeOS and Haiku. Requires root privileges. Warning: This method
f2bf13dc
MM
40is able to address only the first 16 devices on any bus and it seems to be very
41unreliable in many cases.
42.TP
0a7350fb
PR
43.B mmio-conf1
44Direct hardware access via Intel configuration mechanism 1 via memory-mapped I/O.
45Mostly used on non-i386 platforms. Requires root privileges. Warning: This method
46needs to be properly configured via the
47.B mmio-conf1.addrs
48parameter.
49.TP
e2d9340b
PR
50.B mmio-conf1-ext
51Direct hardware access via Extended PCIe Intel configuration mechanism 1 via memory-mapped I/O.
52Mostly used on non-i386 platforms. Requires root privileges. Warning: This method
53needs to be properly configured via the
54.B mmio-conf1-ext.addrs
55parameter.
56.TP
2ba0f6f4
PR
57.B ecam
58Direct hardware access via PCIe ECAM (Enhanced Configuration Access Mechanism).
59Available on all PCIe-compliant hardware. Requires root privileges and access
60to physical memory (on Linux systems disabled CONFIG_STRICT_DEVMEM option). On
61ACPI compatible systems is ECAM mapping read from the MCFG table specified by the
62.B ecam.acpimcfg
63parameter. On EFI compatible systems, ACPI MCFG table can be located in physical
64memory via EFI system table specified by the
65.B ecam.efisystab
66parameter. On FreeBSD/NetBSD systems, physical address of ACPI MCFG table can be
67located by kenv or sysctl interface when the
68.B ecam.bsd
69parameter is not disabled. On x86 BIOS compatible systems, ACPI MCFG table can
70be located in physical memory by scanning x86 BIOS memory when the
71.B ecam.x86bios
72parameter is not disabled. Alternatively ECAM mappings can be specified by the
73.B ecam.addrs
74parameter which takes precedence over ACPI MCFG table. This option is required
75on systems without ACPI and also on systems without EFI or x86 BIOS.
76.TP
f2bf13dc
MM
77.B fbsd-device
78The
79.B /dev/pci
80device on FreeBSD. Requires root privileges.
81.TP
82.B aix-device
83Access method used on AIX. Requires root privileges.
84.TP
85.B nbsd-libpci
86The
87.B /dev/pci0
88device on NetBSD accessed using the local libpci library.
89.TP
90.B obsd-device
91The
92.B /dev/pci
93device on OpenBSD. Requires root privileges.
94.TP
95.B dump
96Read the contents of configuration registers from a file specified in the
97.B dump.name
98parameter. The format corresponds to the output of \fIlspci\fP \fB-x\fP.
d4c2ab05
MM
99.TP
100.B darwin
101Access method used on Mac OS X / Darwin. Must be run as root and the system
102must have been booted with debug=0x144.
765da485
PR
103.TP
104.B win32-cfgmgr32
105Device listing on Windows systems using the Windows Configuration Manager
106via cfgmgr32.dll system library. This method does not require any special
107Administrator rights or privileges. Configuration Manager provides only basic
108information about devices, assigned resources and device tree structure. There
848123eb
PR
109is no access to the PCI configuration space but libpci either tries to use
110other access method to access configuration space or it provides read-only
111virtual emulation based on information from Configuration Manager. Other
112access method can be chosen by the
113.B win32.cfgmethod
114parameter. By default the first working one is selected (if any). Starting
765da485
PR
115with Windows 8 (NT 6.2) it is not possible to retrieve resources from 32-bit
116application or library on 64-bit system.
963d7cb7
PR
117.TP
118.B win32-sysdbg
119Access to the PCI configuration space via NT SysDbg interface on Windows
120systems. Process needs to have Debug privilege, which local Administrators
121have by default. Not available on 64-bit systems and neither on recent 32-bit
122systems. Only devices from the first domain are accessible and only first
123256 bytes of the PCI configuration space is accessible via this method.
388dc6c2
PR
124.TP
125.B win32-kldbg
126Access to the PCI configuration space via Kernel Local Debugging Driver
127kldbgdrv.sys. This driver is not part of the Windows system but is part of
128the Microsoft WinDbg tool. It is required to have kldbgdrv.sys driver installed
129in the system32 directory or to have windbg.exe or kd.exe binary in PATH.
130kldbgdrv.sys driver has some restrictions. Process needs to have Debug privilege
131and Windows system has to be booted with Debugging option. Debugging option can
132be enabled by calling (takes effect after next boot):
133.B bcdedit /debug on
134.IP
135Download links for WinDbg 6.12.2.633 standalone installer from Microsoft Windows
136SDK for Windows 7 and .NET Framework 4:
137.br
138amd64: https://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup/WinSDKDebuggingTools_amd64/dbg_amd64.msi
139.br
140ia64: https://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup/WinSDKDebuggingTools_ia64/dbg_ia64.msi
141.br
142x86: https://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup/WinSDKDebuggingTools/dbg_x86.msi
143.IP
144Archived download links of previous WinDbg versions:
145.br
146https://web.archive.org/web/20110221133326/https://www.microsoft.com/whdc/devtools/debugging/installx86.mspx
147.br
148https://web.archive.org/web/20110214012715/https://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx
5b52ae79
A
149.TP
150.B aos-expansion
151Access method used on PowerPC Amiga running OS4+. Access is made through Expansion.library. It offers read and write access to configuration space.
f2bf13dc
MM
152
153.SH PARAMETERS
154
155.PP
156The library is controlled by several parameters. They should have sensible default
157values, but in case you want to do something unusual (or even something weird),
158you can override them (see the \fB-O\fP switch of \fIlspci\fP).
159
160.SS Parameters of specific access methods
161
162.TP
163.B dump.name
164Name of the bus dump file to read from.
165.TP
166.B fbsd.path
167Path to the FreeBSD PCI device.
168.TP
169.B nbsd.path
170Path to the NetBSD PCI device.
171.TP
172.B obsd.path
173Path to the OpenBSD PCI device.
174.TP
175.B proc.path
176Path to the procfs bus tree.
177.TP
178.B sysfs.path
179Path to the sysfs device tree.
0a7350fb
PR
180.TP
181.B devmem.path
182Path to the /dev/mem device.
183.TP
184.B mmio-conf1.addrs
185Physical addresses of memory-mapped I/O ports for Intel configuration mechanism 1.
186CF8 (address) and CFC (data) I/O port addresses are separated by slash and
187multiple addresses for different PCI domains are separated by commas.
188Format: 0xaddr1/0xdata1,0xaddr2/0xdata2,...
e2d9340b
PR
189.TP
190.B mmio-conf1-ext.addrs
191Physical addresses of memory-mapped I/O ports for Extended PCIe Intel configuration mechanism 1.
192It has same format as
193.B mmio-conf1.addrs
194parameter.
848123eb 195.TP
2ba0f6f4
PR
196.B ecam.addrs
197Physical addresses of PCIe ECAM mappings. Each mapping must contains first PCI
198bus number and physical address where mapping starts. And then it may contain
199the length of the mapping, the last PCI bus number and PCI domain number. When
200the last PCI bus number is not provided then it is calculated from the length
201of the mapping or it is assumed 0xff. When length of the mapping is provided
202then it is calculated from the last PCI bus number. And when PCI domain is not
203provided then 0x0 is assumed. All numbers must be supplied in hexadecimal form
204(leading prefix 0x is not required). Multiple mappings are separated by commas.
205Format: [domain:]start_bus[-end_bus]:start_addr[+length],...
206.TP
207.B ecam.acpimcfg
208Path to the ACPI MCFG table. Processed by the
209.BR glob (3)
210function, so it may contain wildcards (*).
211.TP
212.B ecam.efisystab
213Path to the EFI system table.
214.TP
215.B ecam.bsd
216When not set to 0 then use BSD kenv or sysctl to find ACPI MCFG table. Default
217value is 1 on BSD systems.
218.TP
219.B ecam.x86bios
220When not set to 0 then scan x86 BIOS memory for ACPI MCFG table. Default value
221is 1 on x86 systems.
222.TP
848123eb 223.B win32.cfgmethod
96240635 224Config space access method to use with win32-cfgmgr32 on Windows systems. Value
848123eb 225.I auto
96240635
MM
226or an empty string selects the first access method which supports access
227to the config space on Windows. Value
848123eb 228.I win32-cfgmgr32
ea404c2a
MM
229or
230.I none
96240635 231only builds a read-only virtual emulated config space with information from the
848123eb 232Configuration Manager.
f2bf13dc
MM
233
234.SS Parameters for resolving of ID's via DNS
235.TP
236.B net.domain
237DNS domain containing the ID database.
238.TP
239.B net.cache_name
71b65e73
MM
240Name of the file used for caching of resolved ID's. An initial
241.B ~/
242is expanded to the user's home directory.
f2bf13dc 243
ac357d3b
MM
244.SS Parameters for resolving of ID's via UDEV's HWDB
245.TP
246.B hwdb.disable
247Disable use of HWDB if set to a non-zero value.
248
f2bf13dc
MM
249.SH SEE ALSO
250
251.BR lspci (8),
252.BR setpci (8),
ef5b622f 253.BR pci.ids (5),
f2bf13dc
MM
254.BR update-pciids (8)
255
256.SH AUTHOR
257The PCI Utilities are maintained by Martin Mares <mj@ucw.cz>.