1
0
Fork 0
mirror of https://github.com/pciutils/pciutils.git synced 2026-09-19 21:00:58 +00:00
The PCI Utilities
  • C 92.8%
  • Roff 4.3%
  • Perl 1.3%
  • Makefile 1.3%
  • Shell 0.3%
Find a file
David Matlack e59acdfd93 lspci: Determine bridge window address size from bridge_flags
Use bridge_flags to determine address size bits (16- vs 32-bit for I/O,
32- vs 64-bit for prefetchable memory) when displaying bridge ranges
populated via PCI_FILL_BRIDGE_BASES.

Commit ccf68033a4 ("lspci: Use PCI_FILL_BRIDGE_BASES to detect if
range behind bridge is disabled or unsupported") introduced code in
show_htype1() that reads PCI_IO_RANGE_TYPE_MASK and
PCI_MEMORY_RANGE_TYPE_MASK from bridge_base_addr[]. However,
bridge_base_addr[] holds base addresses without flags, as documented in
lib/pci.h and implemented across backends like sysfs.c and
win32-cfgmgr32.c.

Because bridge_base_addr[] does not contain configuration register flag
bits, masking the lower bits evaluates to zero. As a result, 32-bit I/O
windows are mislabeled as "[16-bit]" and 64-bit prefetchable memory
windows are mislabeled as "[32-bit]" when using PCI_FILL_BRIDGE_BASES.

Fixes: ccf68033a4 ("lspci: Use PCI_FILL_BRIDGE_BASES to detect if range behind bridge is disabled or unsupported")
Signed-off-by: David Matlack <dmatlack@google.com>
2026-08-24 22:36:04 +02:00
compat compat/getopt: Fix compatibility with non-GNU C library 2021-12-28 16:26:39 +01:00
lib names-hwdb: Do now crash when hwdb.bin is not available 2026-06-08 14:04:32 +02:00
lmr pcilmr: update PCIe 6.0 margin handling 2026-07-08 20:43:58 +02:00
maint Add a maintainer script for linting man pages 2026-04-22 12:05:02 +02:00
tests Update DPC tests/cap-dpc 2026-04-20 19:40:25 +02:00
tools build-man: Switch to ISO 8601 date 2026-04-22 11:55:10 +02:00
.gitignore Gitignore: Add pcilmr 2024-02-18 01:36:44 +01:00
bitops.h Use snprintf instead of sprintf to prevent buffer overruns 2025-06-21 17:14:42 +02:00
ChangeLog Released as v3.15.0 2026-04-05 21:24:24 +02:00
common.c Update license comments and added SPDX license identifiers 2023-06-18 14:37:33 +02:00
COPYING Added a copy of the GPL. Oh, those lawyers... 2009-08-14 14:16:57 +02:00
example.c Coding style cleanup: `for(...)' wants a space. 2008-11-10 18:22:04 +01:00
ls-caps-vendor.c Fix formatting of 64-bit integers 2025-06-21 17:19:12 +02:00
ls-caps.c ls-caps: Add support to decode Gen7 speed 2025-07-07 12:04:41 +02:00
ls-ecaps.c ls-ecaps: Decode DPC RP PIO registers 2026-04-17 14:55:39 +02:00
ls-kernel.c Update license comments and added SPDX license identifiers 2023-06-18 14:37:33 +02:00
ls-map.c Update license comments and added SPDX license identifiers 2023-06-18 14:37:33 +02:00
ls-tree.c Update license comments and added SPDX license identifiers 2023-06-18 14:37:33 +02:00
ls-vpd.c Update license comments and added SPDX license identifiers 2023-06-18 14:37:33 +02:00
lspci.c lspci: Determine bridge window address size from bridge_flags 2026-08-24 22:36:04 +02:00
lspci.h libpci: Add separate file for bit manipulation functions 2024-02-17 23:44:34 +01:00
lspci.man Yet more fixes to man pages 2026-04-22 12:05:02 +02:00
Makefile Makefile: Clean up processing of man pages 2026-04-22 11:55:00 +02:00
pci.ids Update pci.ids to current snapshot 2026-04-05 21:16:18 +02:00
pci.ids.man Yet more fixes to man pages 2026-04-22 12:05:02 +02:00
pcilib.man Yet more fixes to man pages 2026-04-22 12:05:02 +02:00
pcilmr.c pcilmr: Add PCIe Gen 6 (64 GT/s) support 2026-05-12 10:22:17 +02:00
pcilmr.man Clean up man pages 2026-04-22 12:05:02 +02:00
pciutils.h pcilmr: Fix compilation for windows and djgpp 2024-02-18 15:55:48 +01:00
pciutils.lsm pciutils.lsm: metalab.unc.edu is gone 2022-04-16 00:21:39 +02:00
pciutils.spec Switched to a new primary distribution site 2019-09-26 17:38:37 +02:00
README Released as v3.15.0 2026-04-05 21:24:24 +02:00
README.DJGPP Add README.DJGPP 2026-04-05 18:50:29 +02:00
README.Windows README.Windows: Fix typo 2024-04-05 22:51:49 +02:00
setpci.c lspci, setpci: Warn when -s or -d is used multiple times 2026-04-05 19:18:47 +02:00
setpci.man Clean up man pages 2026-04-22 12:05:02 +02:00
TODO Library: Handle domains in all back-ends 2020-05-25 15:28:33 +02:00
update-pciids.man Man pages: clarify pci.ids location 2021-12-26 22:17:10 +01:00
update-pciids.sh update-pciids: Report itself as an user agent, version included 2023-07-23 15:44:03 +02:00

This package contains the PCI Utilities, version @VERSION@.

Copyright (c) 1997--2026 Martin Mares <mj@ucw.cz>

All files in this package can be freely distributed and used according
to the terms of the GNU General Public License, either version 2 or
(at your opinion) any newer version. See https://www.gnu.org/ for details.

The author wants to clarify that he does not consider programs which link
dynamically to the libpci to be derived works of the library.


1. What's that?
~~~~~~~~~~~~~~~
The PCI Utilities package contains a library for portable access to PCI bus
configuration registers and several utilities based on this library.

In runs on the following systems:

	Linux		(via /sys/bus/pci, /proc/bus/pci or i386 ports)
	FreeBSD		(via /dev/pci)
	NetBSD		(via libpci)
	OpenBSD		(via /dev/pci or i386 ports)
	GNU/kFreeBSD	(via /dev/pci)
	Solaris/i386	(direct port access)
	Aix		(via /dev/pci and odmget)
	GNU Hurd	(direct port access)
	Windows		(via cfgmgr32 or direct port access, see README.Windows for caveats)
	CYGWIN		(direct port access)
	BeOS		(via syscalls)
	Haiku		(via /dev/misc/poke)
	Darwin		(via IOKit)
	DOS/DJGPP	(via i386 ports, see README.DJGPP)
	SylixOS		(via /proc/pci)
	AmigaOS on PPC	(via Expansion library)
	RT-Thread Smart	(via /proc/pci)

It should be very easy to add support for other systems as well (volunteers
wanted; if you want to try that, I'll be very glad to see the patches and
include them in the next version).

The utilities include:  (See manual pages for more details)

  - lspci: displays detailed information about all PCI buses and devices.

  - setpci: allows to read from and write to PCI device configuration
    registers. For example, you can adjust the latency timers with it.
    CAUTION: There is a couple of dangerous points and caveats, please read
    the manual page first!

  - update-pciids: download the current version of the pci.ids file.

  - pcilmr: performs margining on PCIe links.


2. Compiling and (un)installing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Just run "make" to compile the package and then "make install" to install it.
Please note that a C compiler supporting the C99 standard is required.
Also, GNU make is needed on most platforms.

If you want to change the default installation location, please override
the PREFIX variable specified in the Makefile -- e.g., you can use
"make PREFIX=/opt/pciutils install" to create a separate installation
not interfering with the rest of your system.  Setting the DESTDIR variable
will allow you to install to a different directory from the one you intend
to eventually run it from.  This is useful for people who are packaging
pciutils to install on other computers.

There are several options which can be set in the Makefile or overridden
when running make:

  ZLIB=yes/no	Enable support for compressed pci.ids (requires zlib).
		If it is enabled, pciutils will use pci.ids.gz in preference to
		pci.ids, even if the pci.ids file is newer.  If the pci.ids.gz
		file is missing, it will use pci.ids instead.  If you do not
		specify this option, the configure script will try to guess
		automatically based on the presence of zlib.

  DNS=yes/no	Enable support for querying the central database of PCI IDs
		using DNS.  Requires libresolv (which is available on most
		systems as a part of the standard libraries) and tries to
		autodetect its presence if the option is not specified.

  SHARED=yes/	Build libpci as a shared library.  Requires GCC 4.0 or newer.
  no/local	The ABI of the shared library is intended to remain backward
		compatible for a long time (we use symbol versioning to achieve
		that, like GNU libc does).  The value `local' includes the
		right directory name in the binaries, so the utilities can be
		run without installation.  This is not recommended for any
		production builds.

"make install-lib" installs the library together with its header files
for use by other programs.

When you are bored of dumping PCI registers, just use "make uninstall".


3. Getting new IDs
~~~~~~~~~~~~~~~~~~~
The database of PCI IDs (the pci.ids file) gets out of date much faster
than I release new versions of this package, so it is maintained separately.

It lives at https://pci-ids.ucw.cz/, where you can browse the database,
download the most recent pci.ids file (e.g., by running the update-ids utility)
and also submit new entries.

Alternatively, you can use `lspci -q' to query the central database
for new entries via network.

The pci.ids file is also mirrored at https://github.com/pciutils/pciids.

On Linux systems with a recent enough version of libudev, UDEV's HWDB
database is consulted when pci.ids lacks the device.


4. Getting new versions
~~~~~~~~~~~~~~~~~~~~~~~
The current version of pciutils is available at:

	https://mj.ucw.cz/sw/pciutils/

The tarball can be downloaded at the following places:

	https://mj.ucw.cz/download/linux/pci/
	https://www.kernel.org/pub/software/utils/pciutils/ (expect a couple of hours delay)

There is also a public GIT tree at:

	https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git
	https://github.com/pciutils/pciutils


5. Using the library
~~~~~~~~~~~~~~~~~~~~
So far, there is only a little documentation for the library except for the
general introduction in the pcilib(7) man page. If you want to use the
library in your programs, please follow the comments in lib/pci.h and in
the example program example.c.


6. Feedback
~~~~~~~~~~~
If you have any bug reports or suggestions, send them to the author.

If you have any new IDs, I'll be very glad to add them to the database.
Just submit them at https://pci-ids.ucw.cz/.

Announcements of new versions are sent to linux-pci@vger.kernel.org
(see http://vger.kernel.org/ for instructions).

					Have fun
							Martin