Name Date Size #Lines LOC

..21-Oct-2025-

compat/H09-Oct-2025-838430

lib/H09-Oct-2025-19,19714,646

lmr/H09-Oct-2025-1,9161,532

maint/H09-Oct-2025-479408

tests/H09-Oct-2025-22,51722,327

.gitignoreH A D09-Oct-202580 1211

COPYINGH A D09-Oct-202517.6 KiB340281

ChangeLogH A D09-Oct-202579.3 KiB2,4931,538

MakefileH A D09-Oct-20258.2 KiB257196

READMEH A D09-Oct-20255.7 KiB155112

README.WindowsH A D09-Oct-20253.9 KiB7156

TODOH A D09-Oct-2025504 2318

bitops.hH A D09-Oct-20251.2 KiB4015

common.cH A D09-Oct-20252.7 KiB137116

example.cH A D09-Oct-20251.4 KiB3824

ls-caps-vendor.cH A D09-Oct-20257.2 KiB255210

ls-caps.cH A D09-Oct-202556.3 KiB1,9161,744

ls-ecaps.cH A D09-Oct-202563.2 KiB2,0821,766

ls-kernel.cH A D09-Oct-20255.6 KiB299234

ls-map.cH A D09-Oct-20254.3 KiB185160

ls-tree.cH A D09-Oct-202511.2 KiB469387

ls-vpd.cH A D09-Oct-20254.9 KiB225178

lspci.cH A D09-Oct-202535.3 KiB1,2321,097

lspci.hH A D09-Oct-20252.7 KiB11057

lspci.manH A D09-Oct-202510.8 KiB372328

pci.idsH A D09-Oct-20251.5 MiB40,27540,267

pci.ids.manH A D09-Oct-20253.7 KiB9877

pcilib.manH A D09-Oct-202511.3 KiB289274

pcilmr.cH A D09-Oct-20256.3 KiB221180

pcilmr.manH A D09-Oct-20258.3 KiB265248

pciutils.hH A D09-Oct-20251.9 KiB6638

pciutils.lsmH A D09-Oct-2025547 1413

pciutils.specH A D09-Oct-20251.2 KiB5040

setpci.cH A D09-Oct-202520.4 KiB838745

setpci.manH A D09-Oct-20256.4 KiB192177

update-pciids.manH A D09-Oct-2025790 3930

update-pciids.shH A D09-Oct-20252.1 KiB9877

README

1This package contains the PCI Utilities, version @VERSION@.
2
3Copyright (c) 1997--2024 Martin Mares <[email protected]>
4
5All files in this package can be freely distributed and used according
6to the terms of the GNU General Public License, either version 2 or
7(at your opinion) any newer version. See https://www.gnu.org/ for details.
8
9The author wants to clarify that he does not consider programs which link
10dynamically to the libpci to be derived works of the library.
11
12
131. What's that?
14~~~~~~~~~~~~~~~
15The PCI Utilities package contains a library for portable access to PCI bus
16configuration registers and several utilities based on this library.
17
18In runs on the following systems:
19
20	Linux		(via /sys/bus/pci, /proc/bus/pci or i386 ports)
21	FreeBSD		(via /dev/pci)
22	NetBSD		(via libpci)
23	OpenBSD		(via /dev/pci or i386 ports)
24	GNU/kFreeBSD	(via /dev/pci)
25	Solaris/i386	(direct port access)
26	Aix		(via /dev/pci and odmget)
27	GNU Hurd	(direct port access)
28	Windows		(via cfgmgr32 or direct port access, see README.Windows for caveats)
29	CYGWIN		(direct port access)
30	BeOS		(via syscalls)
31	Haiku		(via /dev/misc/poke)
32	Darwin		(via IOKit)
33	DOS/DJGPP	(via i386 ports)
34	SylixOS		(via /proc/pci)
35	AmigaOS on PPC	(via Expansion library)
36	RT-Thread Smart	(via /proc/pci)
37
38It should be very easy to add support for other systems as well (volunteers
39wanted; if you want to try that, I'll be very glad to see the patches and
40include them in the next version).
41
42The utilities include:  (See manual pages for more details)
43
44  - lspci: displays detailed information about all PCI buses and devices.
45
46  - setpci: allows to read from and write to PCI device configuration
47    registers. For example, you can adjust the latency timers with it.
48    CAUTION: There is a couple of dangerous points and caveats, please read
49    the manual page first!
50
51  - update-pciids: download the current version of the pci.ids file.
52
53  - pcilmr: performs margining on PCIe links.
54
55
562. Compiling and (un)installing
57~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58Just run "make" to compile the package and then "make install" to install it.
59Please note that a C compiler supporting the C99 standard is required.
60Also, GNU make is needed on most platforms.
61
62If you want to change the default installation location, please override
63the PREFIX variable specified in the Makefile -- e.g., you can use
64"make PREFIX=/opt/pciutils install" to create a separate installation
65not interfering with the rest of your system.  Setting the DESTDIR variable
66will allow you to install to a different directory from the one you intend
67to eventually run it from.  This is useful for people who are packaging
68pciutils to install on other computers.
69
70There are several options which can be set in the Makefile or overridden
71when running make:
72
73  ZLIB=yes/no	Enable support for compressed pci.ids (requires zlib).
74		If it is enabled, pciutils will use pci.ids.gz in preference to
75		pci.ids, even if the pci.ids file is newer.  If the pci.ids.gz
76		file is missing, it will use pci.ids instead.  If you do not
77		specify this option, the configure script will try to guess
78		automatically based on the presence of zlib.
79
80  DNS=yes/no	Enable support for querying the central database of PCI IDs
81		using DNS.  Requires libresolv (which is available on most
82		systems as a part of the standard libraries) and tries to
83		autodetect its presence if the option is not specified.
84
85  SHARED=yes/	Build libpci as a shared library.  Requires GCC 4.0 or newer.
86  no/local	The ABI of the shared library is intended to remain backward
87		compatible for a long time (we use symbol versioning to achieve
88		that, like GNU libc does).  The value `local' includes the
89		right directory name in the binaries, so the utilities can be
90		run without installation.  This is not recommended for any
91		production builds.
92
93"make install-lib" installs the library together with its header files
94for use by other programs.
95
96When you are bored of dumping PCI registers, just use "make uninstall".
97
98
993. Getting new IDs
100~~~~~~~~~~~~~~~~~~~
101The database of PCI IDs (the pci.ids file) gets out of date much faster
102than I release new versions of this package, so it is maintained separately.
103
104It lives at https://pci-ids.ucw.cz/, where you can browse the database,
105download the most recent pci.ids file (e.g., by running the update-ids utility)
106and also submit new entries.
107
108Alternatively, you can use `lspci -q' to query the central database
109for new entries via network.
110
111The pci.ids file is also mirrored at https://github.com/pciutils/pciids.
112
113On Linux systems with a recent enough version of libudev, UDEV's HWDB
114database is consulted when pci.ids lacks the device.
115
116
1174. Getting new versions
118~~~~~~~~~~~~~~~~~~~~~~~
119The current version of pciutils is available at:
120
121	https://mj.ucw.cz/sw/pciutils/
122
123The tarball can be downloaded at the following places:
124
125	https://mj.ucw.cz/download/linux/pci/
126	ftp://ftp.ucw.cz/pub/mj/linux/pci/
127	https://www.kernel.org/pub/software/utils/pciutils/ (expect a couple of hours delay)
128
129There is also a public GIT tree at:
130
131	https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
132	https://github.com/pciutils/pciutils
133
134
1355. Using the library
136~~~~~~~~~~~~~~~~~~~~
137So far, there is only a little documentation for the library except for the
138general introduction in the pcilib(7) man page. If you want to use the
139library in your programs, please follow the comments in lib/pci.h and in
140the example program example.c.
141
142
1436. Feedback
144~~~~~~~~~~~
145If you have any bug reports or suggestions, send them to the author.
146
147If you have any new IDs, I'll be very glad to add them to the database.
148Just submit them at https://pci-ids.ucw.cz/.
149
150Announcements of new versions are sent to [email protected]
151(see http://vger.kernel.org/ for instructions).
152
153					Have fun
154							Martin
155

README.Windows

1Since 2.1.99-test5, pciutils should also be compilable on Windows. Thanks
2to Alexander Stock for contributing the port.
3
4Updated after version 2.2.6 to compile again, and with MinGW, even (only?)
5cross-compiling. (Hopefully it works with MSVC too.)
6
7For simple listing PCI devices in system via win32-cfgmgr32 access method
8which provides only basic information and emulated config space, there is no
9special requirement. To list PCI resources on Windows 8 and higher versions,
10it is necessary to have architecture-native version (e.g. AMD64 version on
11AMD64 systems).
12
13For config space access there are different windows specific access methods:
14- win32-kldbg - Kernel Local Debugging Driver kldbgdrv.sys
15- win32-sysdbg - NT SysDbg interface
16- intel-conf1 - Direct hardware access via Intel configuration mechanism 1
17
18The default access method is win32-cfgmgr32 and by default it tries to use
19one of the above config access access method to provide as much as possible
20information to application. More details about particular access method and
21caveats are described in the pcilib(8) manual page.
22
23The default access method for config space is win32-kldbg. It uses Microsoft's
24Kernel Local Debugging Driver kldbgdrv.sys. This driver is not part of the
25Windows system but is part of the Microsoft WinDbg tool. It is required to
26have kldbgdrv.sys driver installed in the system32 directory or to have
27windbg.exe or kd.exe binary in PATH. kldbgdrv.sys driver has some restrictions.
28Process needs to have Debug privilege and Windows system has to be booted with
29Debugging option. Debugging option can be enabled by calling (takes effect
30after next boot): bcdedit /debug on
31
32Download links for WinDbg 6.12.2.633 standalone installer from Microsoft:
33https://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup/WinSDKDebuggingTools_amd64/dbg_amd64.msi
34https://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup/WinSDKDebuggingTools/dbg_x86.msi
35
36To access config space via intel-conf1 access method on NT-based systems via
37NT ProcessUserModeIOPL system call, it is required to have SeTcbPrivilege
38(Act as part of the operating system privilege), which can be enabled in User
39Accounts settings (take effect after next login). By default this privilege is
40not enabled for any non-system user. Or alternatively it is required to be in
41local Administrators group and on Windows 2000 SP4 or higher systems to have
42SeImpersonatePrivilege (Impersonate a client after authentication privilege)
43which is by default enabled for all local Administrators accounts. There is no
44special requirement for DOS-based systems. 64-bit systems do not have to allow
45users to access config space even with SeTcbPrivilege.
46
47To compile this port, run following command:
48
49  make CROSS_COMPILE=i586-mingw32msvc- HOST=i586-windows ZLIB=no IDSDIR=""
50
51To build 64-bit version, run:
52
53  make CROSS_COMPILE=x86_64-w64-mingw32- HOST=x86_64-windows ZLIB=no IDSDIR=""
54
55Sometimes compilation may fail due to broken or missing getopt implementation.
56In this case try to compile with additional make option: COMPAT_GETOPT=yes
57
58Building of shared DLL library libpci3.dll is supported too but needs to be
59manually enabled by make option: SHARED=yes
60
61This DLL library libpci3.dll has versioned symbols with stable ordinal numbers
62which provides backward and forward compatibility. Every symbol in DLL library
63has '@LIBPCI_3.<version>' suffix to achieve it. For linking application to
64libpci3.dll it is possible to generate import library from libpci3.def file.
65Such import library will provide import symbol names without versioned suffix
66as an alias for the latest symbol version, which matches function name in pci.h
67header file. The alias is resolved by the linker at linking time, so the final
68application binary would always reference only versioned symbol. DLL library
69libpci3.dll does not provide unversioned symbols, so for using GetProcAddress()
70or dlsym() it is needed to specify full versioned symbol name.
71