xref: /pciutils/README (revision 021d41cf)
1ab12277eSMartin MaresThis package contains the PCI Utilities, version @VERSION@.
22f48f637SMartin Mares
3c5cf60d7SMartin MaresCopyright (c) 1997--2024 Martin Mares <[email protected]>
42f48f637SMartin Mares
52f48f637SMartin MaresAll files in this package can be freely distributed and used according
62f48f637SMartin Maresto the terms of the GNU General Public License, either version 2 or
7633e6f81SMartin Mares(at your opinion) any newer version. See https://www.gnu.org/ for details.
82f48f637SMartin Mares
953e73b36SMartin MaresThe author wants to clarify that he does not consider programs which link
1053e73b36SMartin Maresdynamically to the libpci to be derived works of the library.
1153e73b36SMartin Mares
12727ce158SMartin Mares
1307159913SMartin Mares1. What's that?
1407159913SMartin Mares~~~~~~~~~~~~~~~
1555c815b5SMartin MaresThe PCI Utilities package contains a library for portable access to PCI bus
1607159913SMartin Maresconfiguration registers and several utilities based on this library.
1707159913SMartin Mares
180ac282f2SMartin MaresIn runs on the following systems:
190ac282f2SMartin Mares
200ac282f2SMartin Mares	Linux		(via /sys/bus/pci, /proc/bus/pci or i386 ports)
210ac282f2SMartin Mares	FreeBSD		(via /dev/pci)
220ac282f2SMartin Mares	NetBSD		(via libpci)
23ebbd5e81SGrant Pannell	OpenBSD		(via /dev/pci or i386 ports)
240ac282f2SMartin Mares	GNU/kFreeBSD	(via /dev/pci)
250ac282f2SMartin Mares	Solaris/i386	(direct port access)
260ac282f2SMartin Mares	Aix		(via /dev/pci and odmget)
270ac282f2SMartin Mares	GNU Hurd	(direct port access)
2883b2cb2eSPali Rohár	Windows		(via cfgmgr32 or direct port access, see README.Windows for caveats)
29550d67d1SMartin Mares	CYGWIN		(direct port access)
3040e253d7SFrançois Revol	BeOS		(via syscalls)
3140e253d7SFrançois Revol	Haiku		(via /dev/misc/poke)
328d1cb3d7SRichard Yao	Darwin		(via IOKit)
335c5ce192SRudolf Marek	DOS/DJGPP	(via i386 ports)
345f22f791SGongYuJian	SylixOS		(via /proc/pci)
355b52ae79SAgg242	AmigaOS on PPC	(via Expansion library)
36*021d41cfSGuEe-GUI	RT-Thread Smart	(via /proc/pci)
370ac282f2SMartin Mares
3881abd2a7SMartin MaresIt should be very easy to add support for other systems as well (volunteers
3981abd2a7SMartin Mareswanted; if you want to try that, I'll be very glad to see the patches and
4081abd2a7SMartin Maresinclude them in the next version).
41727ce158SMartin Mares
4255c815b5SMartin MaresThe utilities include:  (See manual pages for more details)
43b2c9b373SMartin Mares
4446ea554dSMartin Mares  - lspci: displays detailed information about all PCI buses and devices.
45b2c9b373SMartin Mares
46b2c9b373SMartin Mares  - setpci: allows to read from and write to PCI device configuration
47b2c9b373SMartin Mares    registers. For example, you can adjust the latency timers with it.
4807159913SMartin Mares    CAUTION: There is a couple of dangerous points and caveats, please read
4907159913SMartin Mares    the manual page first!
50b2c9b373SMartin Mares
511b95f396SMartin Mares  - update-pciids: download the current version of the pci.ids file.
521b95f396SMartin Mares
53c5cf60d7SMartin Mares  - pcilmr: performs margining on PCIe links.
54c5cf60d7SMartin Mares
552f48f637SMartin Mares
5607159913SMartin Mares2. Compiling and (un)installing
5707159913SMartin Mares~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5807159913SMartin MaresJust run "make" to compile the package and then "make install" to install it.
59f7f2966bSMartin MaresPlease note that a C compiler supporting the C99 standard is required.
60f7f2966bSMartin MaresAlso, GNU make is needed on most platforms.
61f3395cc5SMartin Mares
6207159913SMartin MaresIf you want to change the default installation location, please override
63f4ddb8d3SMartin Maresthe PREFIX variable specified in the Makefile -- e.g., you can use
64f4ddb8d3SMartin Mares"make PREFIX=/opt/pciutils install" to create a separate installation
65f4ddb8d3SMartin Maresnot interfering with the rest of your system.  Setting the DESTDIR variable
66f4ddb8d3SMartin Mareswill allow you to install to a different directory from the one you intend
67f4ddb8d3SMartin Maresto eventually run it from.  This is useful for people who are packaging
68f4ddb8d3SMartin Marespciutils to install on other computers.
6907159913SMartin Mares
70d7ea742cSMartin MaresThere are several options which can be set in the Makefile or overridden
71d7ea742cSMartin Mareswhen running make:
72d7ea742cSMartin Mares
73d7ea742cSMartin Mares  ZLIB=yes/no	Enable support for compressed pci.ids (requires zlib).
74d7ea742cSMartin Mares		If it is enabled, pciutils will use pci.ids.gz in preference to
75d7ea742cSMartin Mares		pci.ids, even if the pci.ids file is newer.  If the pci.ids.gz
76d7ea742cSMartin Mares		file is missing, it will use pci.ids instead.  If you do not
77d7ea742cSMartin Mares		specify this option, the configure script will try to guess
78d7ea742cSMartin Mares		automatically based on the presence of zlib.
79d7ea742cSMartin Mares
80dab118d2SMartin Mares  DNS=yes/no	Enable support for querying the central database of PCI IDs
81d7ea742cSMartin Mares		using DNS.  Requires libresolv (which is available on most
82d7ea742cSMartin Mares		systems as a part of the standard libraries) and tries to
83d7ea742cSMartin Mares		autodetect its presence if the option is not specified.
84d7ea742cSMartin Mares
852f421184SMartin Mares  SHARED=yes/	Build libpci as a shared library.  Requires GCC 4.0 or newer.
86d7ea742cSMartin Mares  no/local	The ABI of the shared library is intended to remain backward
87d7ea742cSMartin Mares		compatible for a long time (we use symbol versioning to achieve
88d7ea742cSMartin Mares		that, like GNU libc does).  The value `local' includes the
89d7ea742cSMartin Mares		right directory name in the binaries, so the utilities can be
90d7ea742cSMartin Mares		run without installation.  This is not recommended for any
91d7ea742cSMartin Mares		production builds.
92d7ea742cSMartin Mares
93d7ea742cSMartin Mares"make install-lib" installs the library together with its header files
94d7ea742cSMartin Maresfor use by other programs.
95cc062b4aSMartin Mares
9607159913SMartin MaresWhen you are bored of dumping PCI registers, just use "make uninstall".
9707159913SMartin Mares
9807159913SMartin Mares
99dab118d2SMartin Mares3. Getting new IDs
10007159913SMartin Mares~~~~~~~~~~~~~~~~~~~
101dab118d2SMartin MaresThe database of PCI IDs (the pci.ids file) gets out of date much faster
102dab118d2SMartin Maresthan I release new versions of this package, so it is maintained separately.
10307159913SMartin Mares
104633e6f81SMartin MaresIt lives at https://pci-ids.ucw.cz/, where you can browse the database,
105dab118d2SMartin Maresdownload the most recent pci.ids file (e.g., by running the update-ids utility)
106dab118d2SMartin Maresand also submit new entries.
107a33d0eb7SMartin Mares
10814b85d7cSMartin MaresAlternatively, you can use `lspci -q' to query the central database
10914b85d7cSMartin Maresfor new entries via network.
11014b85d7cSMartin Mares
111cb968b8fSMartin MaresThe pci.ids file is also mirrored at https://github.com/pciutils/pciids.
11207159913SMartin Mares
113b5847329SMartin MaresOn Linux systems with a recent enough version of libudev, UDEV's HWDB
114b5847329SMartin Maresdatabase is consulted when pci.ids lacks the device.
115b5847329SMartin Mares
11607159913SMartin Mares
1170ac282f2SMartin Mares4. Getting new versions
1180ac282f2SMartin Mares~~~~~~~~~~~~~~~~~~~~~~~
119dab118d2SMartin MaresThe current version of pciutils is available at:
120dab118d2SMartin Mares
121633e6f81SMartin Mares	https://mj.ucw.cz/sw/pciutils/
122dab118d2SMartin Mares
123dab118d2SMartin MaresThe tarball can be downloaded at the following places:
12407159913SMartin Mares
125310a33cfSMartin Mares	https://mj.ucw.cz/download/linux/pci/
126310a33cfSMartin Mares	ftp://ftp.ucw.cz/pub/mj/linux/pci/
127e4d209fdSMartin Mares	https://www.kernel.org/pub/software/utils/pciutils/ (expect a couple of hours delay)
1280ac282f2SMartin Mares
1290ac282f2SMartin MaresThere is also a public GIT tree at:
1300ac282f2SMartin Mares
131633e6f81SMartin Mares	https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
132cb968b8fSMartin Mares	https://github.com/pciutils/pciutils
13307159913SMartin Mares
13407159913SMartin Mares
13507159913SMartin Mares5. Using the library
13607159913SMartin Mares~~~~~~~~~~~~~~~~~~~~
13714b85d7cSMartin MaresSo far, there is only a little documentation for the library except for the
13814b85d7cSMartin Maresgeneral introduction in the pcilib(7) man page. If you want to use the
13914b85d7cSMartin Mareslibrary in your programs, please follow the comments in lib/pci.h and in
140bc46bc39SMartin Maresthe example program example.c.
14107159913SMartin Mares
14207159913SMartin Mares
14307159913SMartin Mares6. Feedback
14407159913SMartin Mares~~~~~~~~~~~
1452f48f637SMartin MaresIf you have any bug reports or suggestions, send them to the author.
1462f48f637SMartin Mares
147dab118d2SMartin MaresIf you have any new IDs, I'll be very glad to add them to the database.
148633e6f81SMartin MaresJust submit them at https://pci-ids.ucw.cz/.
14907159913SMartin Mares
150dab118d2SMartin MaresAnnouncements of new versions are sent to [email protected]
151dab118d2SMartin Mares(see http://vger.kernel.org/ for instructions).
1522bea6231SMartin Mares
15355c815b5SMartin Mares					Have fun
15455c815b5SMartin Mares							Martin
155