xref: /pciutils/README (revision c5cf60d7)
1ab12277eSMartin MaresThis package contains the PCI Utilities, version @VERSION@.
22f48f637SMartin Mares
3*c5cf60d7SMartin 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)
360ac282f2SMartin Mares
3781abd2a7SMartin MaresIt should be very easy to add support for other systems as well (volunteers
3881abd2a7SMartin Mareswanted; if you want to try that, I'll be very glad to see the patches and
3981abd2a7SMartin Maresinclude them in the next version).
40727ce158SMartin Mares
4155c815b5SMartin MaresThe utilities include:  (See manual pages for more details)
42b2c9b373SMartin Mares
4346ea554dSMartin Mares  - lspci: displays detailed information about all PCI buses and devices.
44b2c9b373SMartin Mares
45b2c9b373SMartin Mares  - setpci: allows to read from and write to PCI device configuration
46b2c9b373SMartin Mares    registers. For example, you can adjust the latency timers with it.
4707159913SMartin Mares    CAUTION: There is a couple of dangerous points and caveats, please read
4807159913SMartin Mares    the manual page first!
49b2c9b373SMartin Mares
501b95f396SMartin Mares  - update-pciids: download the current version of the pci.ids file.
511b95f396SMartin Mares
52*c5cf60d7SMartin Mares  - pcilmr: performs margining on PCIe links.
53*c5cf60d7SMartin Mares
542f48f637SMartin Mares
5507159913SMartin Mares2. Compiling and (un)installing
5607159913SMartin Mares~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5707159913SMartin MaresJust run "make" to compile the package and then "make install" to install it.
58f7f2966bSMartin MaresPlease note that a C compiler supporting the C99 standard is required.
59f7f2966bSMartin MaresAlso, GNU make is needed on most platforms.
60f3395cc5SMartin Mares
6107159913SMartin MaresIf you want to change the default installation location, please override
62f4ddb8d3SMartin Maresthe PREFIX variable specified in the Makefile -- e.g., you can use
63f4ddb8d3SMartin Mares"make PREFIX=/opt/pciutils install" to create a separate installation
64f4ddb8d3SMartin Maresnot interfering with the rest of your system.  Setting the DESTDIR variable
65f4ddb8d3SMartin Mareswill allow you to install to a different directory from the one you intend
66f4ddb8d3SMartin Maresto eventually run it from.  This is useful for people who are packaging
67f4ddb8d3SMartin Marespciutils to install on other computers.
6807159913SMartin Mares
69d7ea742cSMartin MaresThere are several options which can be set in the Makefile or overridden
70d7ea742cSMartin Mareswhen running make:
71d7ea742cSMartin Mares
72d7ea742cSMartin Mares  ZLIB=yes/no	Enable support for compressed pci.ids (requires zlib).
73d7ea742cSMartin Mares		If it is enabled, pciutils will use pci.ids.gz in preference to
74d7ea742cSMartin Mares		pci.ids, even if the pci.ids file is newer.  If the pci.ids.gz
75d7ea742cSMartin Mares		file is missing, it will use pci.ids instead.  If you do not
76d7ea742cSMartin Mares		specify this option, the configure script will try to guess
77d7ea742cSMartin Mares		automatically based on the presence of zlib.
78d7ea742cSMartin Mares
79dab118d2SMartin Mares  DNS=yes/no	Enable support for querying the central database of PCI IDs
80d7ea742cSMartin Mares		using DNS.  Requires libresolv (which is available on most
81d7ea742cSMartin Mares		systems as a part of the standard libraries) and tries to
82d7ea742cSMartin Mares		autodetect its presence if the option is not specified.
83d7ea742cSMartin Mares
842f421184SMartin Mares  SHARED=yes/	Build libpci as a shared library.  Requires GCC 4.0 or newer.
85d7ea742cSMartin Mares  no/local	The ABI of the shared library is intended to remain backward
86d7ea742cSMartin Mares		compatible for a long time (we use symbol versioning to achieve
87d7ea742cSMartin Mares		that, like GNU libc does).  The value `local' includes the
88d7ea742cSMartin Mares		right directory name in the binaries, so the utilities can be
89d7ea742cSMartin Mares		run without installation.  This is not recommended for any
90d7ea742cSMartin Mares		production builds.
91d7ea742cSMartin Mares
92d7ea742cSMartin Mares"make install-lib" installs the library together with its header files
93d7ea742cSMartin Maresfor use by other programs.
94cc062b4aSMartin Mares
9507159913SMartin MaresWhen you are bored of dumping PCI registers, just use "make uninstall".
9607159913SMartin Mares
9707159913SMartin Mares
98dab118d2SMartin Mares3. Getting new IDs
9907159913SMartin Mares~~~~~~~~~~~~~~~~~~~
100dab118d2SMartin MaresThe database of PCI IDs (the pci.ids file) gets out of date much faster
101dab118d2SMartin Maresthan I release new versions of this package, so it is maintained separately.
10207159913SMartin Mares
103633e6f81SMartin MaresIt lives at https://pci-ids.ucw.cz/, where you can browse the database,
104dab118d2SMartin Maresdownload the most recent pci.ids file (e.g., by running the update-ids utility)
105dab118d2SMartin Maresand also submit new entries.
106a33d0eb7SMartin Mares
10714b85d7cSMartin MaresAlternatively, you can use `lspci -q' to query the central database
10814b85d7cSMartin Maresfor new entries via network.
10914b85d7cSMartin Mares
110cb968b8fSMartin MaresThe pci.ids file is also mirrored at https://github.com/pciutils/pciids.
11107159913SMartin Mares
112b5847329SMartin MaresOn Linux systems with a recent enough version of libudev, UDEV's HWDB
113b5847329SMartin Maresdatabase is consulted when pci.ids lacks the device.
114b5847329SMartin Mares
11507159913SMartin Mares
1160ac282f2SMartin Mares4. Getting new versions
1170ac282f2SMartin Mares~~~~~~~~~~~~~~~~~~~~~~~
118dab118d2SMartin MaresThe current version of pciutils is available at:
119dab118d2SMartin Mares
120633e6f81SMartin Mares	https://mj.ucw.cz/sw/pciutils/
121dab118d2SMartin Mares
122dab118d2SMartin MaresThe tarball can be downloaded at the following places:
12307159913SMartin Mares
124310a33cfSMartin Mares	https://mj.ucw.cz/download/linux/pci/
125310a33cfSMartin Mares	ftp://ftp.ucw.cz/pub/mj/linux/pci/
126e4d209fdSMartin Mares	https://www.kernel.org/pub/software/utils/pciutils/ (expect a couple of hours delay)
1270ac282f2SMartin Mares
1280ac282f2SMartin MaresThere is also a public GIT tree at:
1290ac282f2SMartin Mares
130633e6f81SMartin Mares	https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
131cb968b8fSMartin Mares	https://github.com/pciutils/pciutils
13207159913SMartin Mares
13307159913SMartin Mares
13407159913SMartin Mares5. Using the library
13507159913SMartin Mares~~~~~~~~~~~~~~~~~~~~
13614b85d7cSMartin MaresSo far, there is only a little documentation for the library except for the
13714b85d7cSMartin Maresgeneral introduction in the pcilib(7) man page. If you want to use the
13814b85d7cSMartin Mareslibrary in your programs, please follow the comments in lib/pci.h and in
139bc46bc39SMartin Maresthe example program example.c.
14007159913SMartin Mares
14107159913SMartin Mares
14207159913SMartin Mares6. Feedback
14307159913SMartin Mares~~~~~~~~~~~
1442f48f637SMartin MaresIf you have any bug reports or suggestions, send them to the author.
1452f48f637SMartin Mares
146dab118d2SMartin MaresIf you have any new IDs, I'll be very glad to add them to the database.
147633e6f81SMartin MaresJust submit them at https://pci-ids.ucw.cz/.
14807159913SMartin Mares
149dab118d2SMartin MaresAnnouncements of new versions are sent to [email protected]
150dab118d2SMartin Mares(see http://vger.kernel.org/ for instructions).
1512bea6231SMartin Mares
15255c815b5SMartin Mares					Have fun
15355c815b5SMartin Mares							Martin
154