]> mj.ucw.cz Git - pciutils.git/log
pciutils.git
3 years agoupdate-pciids: Fix spacing style
Guillem Jover [Wed, 23 Sep 2020 17:55:37 +0000 (19:55 +0200)]
update-pciids: Fix spacing style

Fix code alignment by using a hard-tab instead of 4 spaces. Add a blank
line after set -e.

3 years agoupdate-pciids: Move quiet setting after set -e
Guillem Jover [Wed, 23 Sep 2020 17:54:16 +0000 (19:54 +0200)]
update-pciids: Move quiet setting after set -e

We should set -e as the first thing to catch any errors, so move the
quiet setup after the other variables setup.

3 years agopciutils: Add decode support for RCECs
Sean V Kelley [Wed, 24 Jun 2020 22:39:40 +0000 (15:39 -0700)]
pciutils: Add decode support for RCECs

Root Complex Event Collectors provide support for terminating error
and PME messages from RCiEPs.  This patch provides basic decoding for
the lspci RCEC Endpoint Association Extended Capability. See PCIe 5.0-1,
sec 7.9.10 for further details.

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
4 years agoMerge pull request #42 from jlledom/hurd-method-fixes
Martin Mareš [Sat, 6 Jun 2020 18:03:47 +0000 (20:03 +0200)]
Merge pull request #42 from jlledom/hurd-method-fixes

Hurd: bug fixes and compile again

4 years agoHurd: bug fixes and compile again
Joan Lledó [Sat, 6 Jun 2020 17:41:19 +0000 (19:41 +0200)]
Hurd: bug fixes and compile again

4 years agoHurd: Do not identify devices during scan
Martin Mares [Sun, 31 May 2020 10:24:41 +0000 (12:24 +0200)]
Hurd: Do not identify devices during scan

Let us keep the bus scan light-weight. Whoever is interested
in device IDs, still has to call pci_fill_info(PCI_FILL_IDENT),
which handles this in generic way.

4 years agoHurd: Simplification continues
Martin Mares [Sun, 31 May 2020 10:22:53 +0000 (12:22 +0200)]
Hurd: Simplification continues

4 years agoHurd: Simplify config space read and write
Martin Mares [Sun, 31 May 2020 10:18:06 +0000 (12:18 +0200)]
Hurd: Simplify config space read and write

4 years agoHurd: Further simplification
Martin Mares [Sun, 31 May 2020 10:11:45 +0000 (12:11 +0200)]
Hurd: Further simplification

4 years agoMerge remote-tracking branch 'jlledom/hurd-fix-dev-aux'
Martin Mares [Sun, 31 May 2020 09:59:48 +0000 (11:59 +0200)]
Merge remote-tracking branch 'jlledom/hurd-fix-dev-aux'

4 years agoHURD backend should compile again
Martin Mares [Sun, 31 May 2020 09:53:28 +0000 (11:53 +0200)]
HURD backend should compile again

Fixes a bug introduced by commit 82c06b47dea5a38075ce9d56f743360bc47b4c78.

4 years agoHurd: avoid redundant checks for port validity
Joan Lledó [Sun, 31 May 2020 08:28:56 +0000 (10:28 +0200)]
Hurd: avoid redundant checks for port validity

4 years agoHURD: Use MACH_PORT_NULL to initialize the port
Joan Lledó [Sun, 31 May 2020 07:20:33 +0000 (09:20 +0200)]
HURD: Use MACH_PORT_NULL to initialize the port

4 years agoHurd: Fix multiline strings
Joan Lledó [Sun, 31 May 2020 07:15:36 +0000 (09:15 +0200)]
Hurd: Fix multiline strings

4 years agoMaintainer scripts: Fixed a typo in release.pm
Martin Mares [Sat, 30 May 2020 22:19:09 +0000 (00:19 +0200)]
Maintainer scripts: Fixed a typo in release.pm

4 years agoReleased as 3.7.0. v3.7.0
Martin Mares [Sat, 30 May 2020 22:17:56 +0000 (00:17 +0200)]
Released as 3.7.0.

4 years agoUpdated pci.ids to today's snapshot
Martin Mares [Sat, 30 May 2020 22:02:16 +0000 (00:02 +0200)]
Updated pci.ids to today's snapshot

4 years agoCXL: Capability vendor ID changed
Sean V Kelley [Tue, 26 May 2020 20:56:28 +0000 (13:56 -0700)]
CXL: Capability vendor ID changed

Update the cap-dvsec-cxl test to match the new vendor ID.

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
4 years agosysfs: Adjusted handling of PCI_FILL_IOMMU_GROUP to recent flag semantics
Martin Mares [Tue, 26 May 2020 16:13:19 +0000 (18:13 +0200)]
sysfs: Adjusted handling of PCI_FILL_IOMMU_GROUP to recent flag semantics

4 years agolspci: Print IOMMU groups with -v
Alex Xu (Hello71) [Fri, 28 Feb 2020 20:57:01 +0000 (15:57 -0500)]
lspci: Print IOMMU groups with -v

4 years agolspci: Cleaned up printing of resizable BARs
Martin Mares [Mon, 25 May 2020 13:57:39 +0000 (15:57 +0200)]
lspci: Cleaned up printing of resizable BARs

Adjusted the output to better match the rest of lspci.
Made the code more straightforward.

4 years agolspci: Decode the (virtual) resizeble BAR capability
Martin Mares [Mon, 25 May 2020 13:47:04 +0000 (15:47 +0200)]
lspci: Decode the (virtual) resizeble BAR capability

A patch by Paul Blinzer.

4 years agoLibrary: Handle domains in all back-ends
Martin Mares [Mon, 25 May 2020 13:28:33 +0000 (15:28 +0200)]
Library: Handle domains in all back-ends

Even if the back-end does not implement multiple domains, it can
be called on a device in a non-zero domain if the use obtained the
device by calling pci_get_dev() instead of scanning the bus.

In all such cases, report that 0 bytes were read/written.

4 years agoLibrary: Big cleanup of pci_fill_info()
Martin Mares [Mon, 25 May 2020 13:10:07 +0000 (15:10 +0200)]
Library: Big cleanup of pci_fill_info()

There was a lot of minor issues in the implementation of the fill_info
call-back in various back-ends. Most importantly, semantics of pci_dev->
known_fields was not formally defined and it was implemented inconsistently.

We now define known_fields as the set of fields which were already
obtained during the lifetime of the pci_dev. We never consider known
fields which are not supported by the back-end. All fields which are
unsupported by either the back-end, the OS, or the particular device,
are guaranteed to have sensible default values (0 or NULL). Also, bit
masks are always unsigned except for the signature of pci_fill_info()
which should be preferably kept stable.

All back-ends and the pci_generic_fill_info() function have been changed
to follow this semantics.

In the sysfs back-end, we read as few attributes as possible during
device initialization, so applications which use pci_get_dev() are not
slowed down unnecessarily.

In the Hurd back-end, we also respect the buscentric mode.

4 years agoCXL: Capability vendor ID changed
Martin Mares [Mon, 25 May 2020 10:35:14 +0000 (12:35 +0200)]
CXL: Capability vendor ID changed

Reported by Sean V Kelley <sean.v.kelley@linux.intel.com> on the
linux-pci list.

4 years agolspci: Generelized decoding of DVSEC extended capability
Martin Mares [Mon, 25 May 2020 10:26:07 +0000 (12:26 +0200)]
lspci: Generelized decoding of DVSEC extended capability

We decode the DVSEC capability header first. If we recognize the vendor
and ID (and the length is at least the minimum we need), we call
a specific function to interpret the rest of the capability.

4 years agoTests: cap-dvsec was superseded by cap-dvsec-cxl
Martin Mares [Mon, 25 May 2020 10:25:50 +0000 (12:25 +0200)]
Tests: cap-dvsec was superseded by cap-dvsec-cxl

4 years agoTests: cap-dvsec-cxl had tabs erroneously expanded to spaces
Martin Mares [Mon, 25 May 2020 10:25:25 +0000 (12:25 +0200)]
Tests: cap-dvsec-cxl had tabs erroneously expanded to spaces

4 years agopciutils: Decode Compute eXpress Link DVSEC
Sean V Kelley [Mon, 20 Apr 2020 22:14:44 +0000 (15:14 -0700)]
pciutils: Decode Compute eXpress Link DVSEC

Compute eXpress Link[1] is a new CPU interconnect created with
workload accelerators in mind. The interconnect relies on PCIe
electrical and physical interconnect for communication via a Flex Bus
port which allows designs to choose between providing PCIe or CXL.

This patch introduces basic support for lspci decode of CXL and
builds upon the existing Designated Vendor-Specific support in
lspci through identification of a supporting CXL device using DVSEC
Vendor ID and DVSEC ID.

[1] https://www.computeexpresslink.org/

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
4 years agopciutils: Decode available DVSEC details
Sean V Kelley [Mon, 20 Apr 2020 22:14:43 +0000 (15:14 -0700)]
pciutils: Decode available DVSEC details

Instead of current generic 'unknown' output for DVSEC, decode details on
Vendor ID, Rev, etc.

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
4 years agolspci: Use commas more consistently
Bjorn Helgaas [Thu, 21 May 2020 22:40:30 +0000 (17:40 -0500)]
lspci: Use commas more consistently

General practice has been to use a comma after a multi-word item, but omit
commas between single-bit flags.  Do this more consistently.

Sample output changes:

  - LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
  + LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+

  - DevCap2: Completion Timeout: Not Supported, TimeoutDis-, NROPrPrP-, LTR+
  + DevCap2: Completion Timeout: Not Supported, TimeoutDis- NROPrPrP- LTR+

  -          10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt-, EETLPPrefix-
  +          10BitTagComp- 10BitTagReq- OBFF Not Supported, ExtFmt- EETLPPrefix-

  -          FRS-, ARIFwd-
  +          FRS- ARIFwd-

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
4 years agolspci: Decode PCIe Link Capabilities 2, expand Link Status 2
Bjorn Helgaas [Thu, 21 May 2020 22:40:29 +0000 (17:40 -0500)]
lspci: Decode PCIe Link Capabilities 2, expand Link Status 2

Decode Link Capabilities 2, which includes the Supported Link Speeds
Vector, and decode more fields of Link Status 2.

The test case (data from https://bugzilla.kernel.org/show_bug.cgi?id=206837
comment #21) includes a Thunderbolt Downstream Port that advertises
2.5-8GT/s support in Link Capabilities 2.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
4 years agoMaint: Reorganization of my directory structure
Martin Mares [Sun, 29 Mar 2020 20:38:35 +0000 (22:38 +0200)]
Maint: Reorganization of my directory structure

4 years agoHurd: Fix minor indentation problems
Joan Lledó [Sun, 22 Mar 2020 11:04:45 +0000 (12:04 +0100)]
Hurd: Fix minor indentation problems

4 years agoHurd: Fix bug: pci_get_dev() and dev->aux
Joan Lledó [Sun, 22 Mar 2020 10:51:39 +0000 (11:51 +0100)]
Hurd: Fix bug: pci_get_dev() and dev->aux

Allow clients to read and write from a device w/o a bus scan

4 years agosetpci: Added an option to skip the bus scan if possible
Martin Mares [Sun, 23 Feb 2020 15:44:41 +0000 (16:44 +0100)]
setpci: Added an option to skip the bus scan if possible

4 years agopci.h: Explain pci_dev->aux
Martin Mares [Sun, 23 Feb 2020 15:44:31 +0000 (16:44 +0100)]
pci.h: Explain pci_dev->aux

4 years agoReleased version 3.6.4. v3.6.4
Martin Mares [Sat, 25 Jan 2020 19:28:42 +0000 (20:28 +0100)]
Released version 3.6.4.

4 years agoVPD: When printing item IDs, escape non-ASCII characters
Martin Mares [Sat, 25 Jan 2020 19:42:03 +0000 (20:42 +0100)]
VPD: When printing item IDs, escape non-ASCII characters

4 years agoNew access method: Hurd via RPCs
Joan Lledó [Sat, 30 Nov 2019 12:13:25 +0000 (13:13 +0100)]
New access method: Hurd via RPCs

A new module for the Hurd that accesses PCI bus using available RPCs.

4 years agoMakefile: Fixed bugs in distclean v3.6.3
Martin Mares [Wed, 22 Jan 2020 10:42:19 +0000 (11:42 +0100)]
Makefile: Fixed bugs in distclean

This will be the real 3.6.3.

4 years agopciutils.lsm: Updated primary site
Martin Mares [Wed, 22 Jan 2020 10:32:14 +0000 (11:32 +0100)]
pciutils.lsm: Updated primary site

4 years agoReleased as 3.6.3
Martin Mares [Wed, 22 Jan 2020 10:29:26 +0000 (11:29 +0100)]
Released as 3.6.3

4 years agoUpdated pci.ids to today's snapshot.
Martin Mares [Wed, 22 Jan 2020 10:28:25 +0000 (11:28 +0100)]
Updated pci.ids to today's snapshot.

4 years agoChangeLog for 3.6.3
Martin Mares [Wed, 22 Jan 2020 10:27:40 +0000 (11:27 +0100)]
ChangeLog for 3.6.3

4 years agoFixed buffer overflows in ls-tree.c
Martin Mares [Wed, 22 Jan 2020 08:49:18 +0000 (09:49 +0100)]
Fixed buffer overflows in ls-tree.c

As reported in GitHub issue #24, tree dumping mode can smash the stack
if the hierarchy of buses is too deep.

Increased line buffer size to 1024 and switched to use of snprintf
everywhere, so that in the worst case, the line is truncated.

As snprintf can be problematic on obscure platforms, I wrapped it
in tree_printf(), so that we can add #ifdefs should problems arise.

4 years agoCleaned up dumping of expansion ROM regions
Martin Mares [Wed, 22 Jan 2020 08:23:27 +0000 (09:23 +0100)]
Cleaned up dumping of expansion ROM regions

"[virtual]" and "[enhanced]" are now printed after the base address
along with other flags.

4 years agoCleaned up dumping of I/O and memory regions
Martin Mares [Wed, 22 Jan 2020 08:15:29 +0000 (09:15 +0100)]
Cleaned up dumping of I/O and memory regions

Originally, I wanted to fix a bug, which caused 64-bit addresses
with their lower 32 bits zero to be reported as virtual regions.
However, it turned out that the whole function is quite messy,
so I rewrote it.

Also, we now print "[virtual]" and "[enhanced]" after the base address
along other modifiers.

4 years agoMan page: Multiple Module attributes can occur in -vmm format
Martin Mares [Tue, 21 Jan 2020 23:01:52 +0000 (00:01 +0100)]
Man page: Multiple Module attributes can occur in -vmm format

4 years agoAdded a man page for pci.ids
Martin Mares [Tue, 21 Jan 2020 22:56:47 +0000 (23:56 +0100)]
Added a man page for pci.ids

4 years agoVerbosity of Secondary PCI Express cap should not depend on device type
Martin Mares [Tue, 21 Jan 2020 22:07:25 +0000 (23:07 +0100)]
Verbosity of Secondary PCI Express cap should not depend on device type

4 years agonames-net: Avoid buffer overflow warnings by newer gcc
Martin Mares [Tue, 21 Jan 2020 20:51:39 +0000 (21:51 +0100)]
names-net: Avoid buffer overflow warnings by newer gcc

4 years agolspci: Change output for bridge with empty range to "[disabled]"
Kelsey Skunberg [Wed, 19 Jun 2019 16:48:58 +0000 (10:48 -0600)]
lspci: Change output for bridge with empty range to "[disabled]"

Change output displayed for memory behind bridge when the range is
empty to be consistent between each verbosity level. Replace "None" and
"[empty]" with "[disabled]". Old and new output examples listed below
for each verbosity level.

Show_range() is not called unless verbose == true. No output given
unless a verbose argument is provided.

OLD output for -v and -vv which uses "None" and -vvv uses "[empty]":

  Memory behind bridge: None                          # lspci -v
  Memory behind bridge: None                          # lspci -vv
  Memory behind bridge: 0000e000-0000efff [empty]     # lspci -vvv

NEW output for -v, -vv, and -vvv to use "[disabled]":

  Memory behind bridge: [disabled]                       # lspci -v
  Memory behind bridge: [disabled]                       # lspci -vv
  Memory behind bridge: 0000e000-0000efff [disabled]     # lspci -vvv

Advantage is consistent output regardless of verbosity level chosen and
to simplify the code.

Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
4 years agolspci: Remove unnecessary !verbose check in show_range()
Kelsey Skunberg [Wed, 19 Jun 2019 16:48:57 +0000 (10:48 -0600)]
lspci: Remove unnecessary !verbose check in show_range()

Remove 'if (!verbose)' code in show_range() due to not being called.
show_range() will only be called when verbose is true. Additional call
to check for verbosity within show_range() is dead code.

!verbose was used so nothing would print if the range behind a bridge
had a base > limit and verbose == false. Since show_range() will not be
called when verbose == false, not printing bridge information is
still accomplished.

Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
4 years agolspci: Include -vvv option in help
Kelsey Skunberg [Wed, 19 Jun 2019 16:48:56 +0000 (10:48 -0600)]
lspci: Include -vvv option in help

Include -vvv in help message.

Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
4 years agolspci: Reorder Express Root Complex registers to Cap, Ctl, Sta
Bjorn Helgaas [Fri, 17 May 2019 18:40:22 +0000 (13:40 -0500)]
lspci: Reorder Express Root Complex registers to Cap, Ctl, Sta

Registers in the PCI Express Capability come in sets of three (Capability,
Control, Status), and we typically print them in that order.  The Root
Complex-related registers were an exception: we printed them in the
(Control, Capability, Status) order.

Decode the RootCap, RootCtl, and RootSta registers in the usual order.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
4 years agoUpdated pci.ids to today's snapshot
Martin Mares [Wed, 30 Oct 2019 17:31:13 +0000 (18:31 +0100)]
Updated pci.ids to today's snapshot

This includes clarified copyright statement.

4 years agoSwitched to a new primary distribution site
Martin Mares [Thu, 26 Sep 2019 15:38:37 +0000 (17:38 +0200)]
Switched to a new primary distribution site

5 years agolspci: Add PCIe 5.0 data rate (32 GT/s) support
Gustavo Pimentel [Tue, 4 Jun 2019 16:24:46 +0000 (18:24 +0200)]
lspci: Add PCIe 5.0 data rate (32 GT/s) support

This enables "lspci" to show PCIe 5.0 data rate (32 GT/s) properly
according to the contents in register PCI_EXP_LNKCAP, PCI_EXP_LNKSTA
and PCI_EXP_LNKCTL2.

Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
5 years agolspci: Decode all defined fields in the Device Capabilities 2 register
Frederick Lawler [Fri, 22 Feb 2019 05:13:26 +0000 (23:13 -0600)]
lspci: Decode all defined fields in the Device Capabilities 2 register

Decode all defined fields in the Device Capabilities 2 register.

The difference from "lspci -vv" output now looks like this:

-               DevCap2: Completion Timeout: Range ABC, TimeoutDis+, LTR+, OBFF Not Supported ARIFwd+
+               DevCap2: Completion Timeout: Range ABC, TimeoutDis+, NROPrPrP-, LTR+
+                        10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt-, EETLPPrefix-
+                        EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
+                        FRS-, LN System CLS Not Supported, TPHComp-, ExtTPHComp-, ARIFwd+

Signed-off-by: Frederick Lawler <fred@fredlawl.com>
5 years agoSet PCI_HAVE_64BIT_ADDRESS for NetBSD.
Masanobu SAITOH [Fri, 25 Jan 2019 03:06:06 +0000 (12:06 +0900)]
Set PCI_HAVE_64BIT_ADDRESS for NetBSD.

5 years agolspci: Fix extra newline if L1.2 is not supported.
Vinson Lee [Wed, 2 Jan 2019 19:39:17 +0000 (19:39 +0000)]
lspci: Fix extra newline if L1.2 is not supported.

Fixes: fb17077dc378 ("Cleaned up the previous patch")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
5 years agoFixed memory initialization bug in previous commit
Martin Mares [Wed, 13 Feb 2019 09:01:30 +0000 (10:01 +0100)]
Fixed memory initialization bug in previous commit

5 years agoLibrary: The list of capabilities is ordered properly
Martin Mares [Mon, 31 Dec 2018 14:28:25 +0000 (15:28 +0100)]
Library: The list of capabilities is ordered properly

Ordering of our cached list of capabilities now respects the original
order in the device's configuration space.

5 years ago"Function-Level Reset" device capability is displayed for RCiEP
Martin Mares [Mon, 31 Dec 2018 14:21:36 +0000 (15:21 +0100)]
"Function-Level Reset" device capability is displayed for RCiEP

According to discussion in GitHub PR #8, Root complex integrated
endpoints also support FLR.

5 years agoCosmetic cleanups of the previous commit
Martin Mares [Mon, 31 Dec 2018 14:15:09 +0000 (15:15 +0100)]
Cosmetic cleanups of the previous commit

5 years agolspci: Add support for Secondary PCI Express Extended Capability
Basavaraja M S [Mon, 19 Nov 2018 07:15:08 +0000 (07:15 +0000)]
lspci: Add support for Secondary PCI Express Extended Capability

Signed-off-by: Basavaraja M S <basavam@cadence.com>
5 years agoFix solaris build
Andrew Stormont [Mon, 13 Aug 2018 13:39:16 +0000 (14:39 +0100)]
Fix solaris build

5 years agoREADME.Windows: Replaced broken link to winio
Martin Mares [Mon, 31 Dec 2018 14:07:12 +0000 (15:07 +0100)]
README.Windows: Replaced broken link to winio

New URLs suggested by GitHub PR #20.

5 years agosetpci: Add capability names
Bjorn Helgaas [Tue, 6 Nov 2018 21:52:38 +0000 (15:52 -0600)]
setpci: Add capability names

Add capability names for all the capabilities known to lspci.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
5 years agolspci: Decode Multicast Extended Capability
Bjorn Helgaas [Tue, 6 Nov 2018 21:52:31 +0000 (15:52 -0600)]
lspci: Decode Multicast Extended Capability

Decode the Multicast Extended Capability described in PCIe r4.0, sec
7.9.11.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
5 years agosetpci: Pluralize 'capability' in error if needed
Daniel Schaefer [Tue, 16 Oct 2018 19:00:33 +0000 (21:00 +0200)]
setpci: Pluralize 'capability' in error if needed

5 years agoCaps: fixed silly bug introduced in d7d9e30534eb55145e7033018ee945b09de6928a
Martin Mares [Mon, 12 Nov 2018 21:22:16 +0000 (22:22 +0100)]
Caps: fixed silly bug introduced in d7d9e30534eb55145e7033018ee945b09de6928a

5 years agoAdd a couple of missing va_end's
Michal Hlavinka [Tue, 16 Oct 2018 16:25:32 +0000 (18:25 +0200)]
Add a couple of missing va_end's

Found by Coverity scan.

5 years agoFix device_class calculatoin for non-root FreeBSD users
Oleksandr Tymoshenko [Sun, 19 Aug 2018 19:48:07 +0000 (12:48 -0700)]
Fix device_class calculatoin for non-root FreeBSD users

libpci uses PCIOCGETCONF for non-privileged access to /dev/pci
and calculates device_class value based on pc_class/pc_subclass
fields expecting the former to be higher 8 bits of the target value.
0f3d0ca73ecedaba180bf4607bb57fb8abe6d405 errorneously swapped
order of class/subclass during calculations.

Signed-off-by: Oleksandr Tymoshenko <gonzo@bluezbox.com>
5 years agolspci: Allow -s with -t to show a subtree
Gera Kazakov [Tue, 18 Sep 2018 23:51:07 +0000 (17:51 -0600)]
lspci: Allow -s with -t to show a subtree

5 years agoCleaned up pci_find_cap_nr()
Martin Mares [Sun, 14 Oct 2018 20:53:52 +0000 (22:53 +0200)]
Cleaned up pci_find_cap_nr()

The cap_number is always set to the total number of capability instances
found, regardless of whether a match was found or not.

5 years agoEnable setpci to target n-th capability of id
Daniel Schaefer [Sun, 14 Oct 2018 20:48:57 +0000 (22:48 +0200)]
Enable setpci to target n-th capability of id

Because a capability can exist multiple times with the same id,
there needs to be a way to target a specific one. Instead of
the current behaviour which always targets the first one.
Now you can optionally add `@number` (e.g `@1`) after the width to
choose which one to target.

5 years agolibpci is now able to find a specific instance of a capability
Daniel Schaefer [Sun, 14 Oct 2018 20:47:53 +0000 (22:47 +0200)]
libpci is now able to find a specific instance of a capability

5 years agoDocs: Prefer https
Martin Mares [Sun, 14 Oct 2018 20:37:31 +0000 (22:37 +0200)]
Docs: Prefer https

Suggested by Milan Kral.

5 years agoupdate-pciids: Download pci.ids over HTTPS
Martin Mares [Sun, 14 Oct 2018 20:36:13 +0000 (22:36 +0200)]
update-pciids: Download pci.ids over HTTPS

5 years agoPrint Root complex related registers on RCEC, too
Masanobu SAITOH [Thu, 4 Oct 2018 08:33:21 +0000 (17:33 +0900)]
Print Root complex related registers on RCEC, too

PCIe spec says root ports and root complex event collectors must implement
root CAP, STAT and CTRL registers, so call cap_express_root() not only for
PCI_EXP_TYPE_ROOT_PORT but also for PCI_EXP_TYPE_ROOT_EC.

5 years agoReleased as 3.6.2 v3.6.2
Martin Mares [Sun, 12 Aug 2018 10:59:26 +0000 (12:59 +0200)]
Released as 3.6.2

5 years agoUpdated pci.ids to today's snapshot
Martin Mares [Sun, 12 Aug 2018 10:57:13 +0000 (12:57 +0200)]
Updated pci.ids to today's snapshot

5 years agoAdded test cases for topology computation
Martin Mares [Sun, 12 Aug 2018 10:47:25 +0000 (12:47 +0200)]
Added test cases for topology computation

Contributed by Matthew Wilcox

5 years agoTopology now works in combination with filters
Martin Mares [Sun, 12 Aug 2018 09:24:06 +0000 (11:24 +0200)]
Topology now works in combination with filters

If bus topology is needed, we scan all devices regardless of filters,
and apply the filters later when showing devices.

Also, we forbid several impossible combinations of options: tree mode
with filters, bus mapping mode with anything requiring topology.

5 years agoTree: Detect bridges properly
Martin Mares [Sun, 12 Aug 2018 09:13:05 +0000 (11:13 +0200)]
Tree: Detect bridges properly

Previously, only PCI_CLASS_BRIDGE_PCI was considered, which excluded
CardBus bridges. We now accept anything of the base class "bridge"
with the proper header type.

Also added a bunch of debugging messages.

5 years agoAdded an option for displaying bus paths
Martin Mares [Fri, 10 Aug 2018 10:28:49 +0000 (12:28 +0200)]
Added an option for displaying bus paths

Originally implemented by Matthew Wilcox as a stand-alone feature.
I modified it to make use of bus topology calculated by ls-tree.c.

5 years agoGeneralized topology computation in ls-tree.c
Martin Mares [Fri, 10 Aug 2018 10:11:39 +0000 (12:11 +0200)]
Generalized topology computation in ls-tree.c

The topology tree is now independent of the plain device list
and it can be traversed in both top-to-bottom and bottom-to-top
directions.

5 years agoReleased as 3.6.1 v3.6.1
Martin Mares [Thu, 12 Jul 2018 12:02:43 +0000 (14:02 +0200)]
Released as 3.6.1

5 years agoSysfs: fixed sysfs_deref_link()
Martin Mares [Thu, 12 Jul 2018 11:59:52 +0000 (13:59 +0200)]
Sysfs: fixed sysfs_deref_link()

The function canonicalize_file_name() is GLIBC-specific, use realpath()
instead, which is available also on MUSL libc.

Also, it leaked memory.

6 years agomaint/release: Perl does not have "." in @INC any longer
Martin Mares [Sat, 30 Jun 2018 21:56:10 +0000 (23:56 +0200)]
maint/release: Perl does not have "." in @INC any longer

6 years agoReleased as 3.6.0 v3.6.0
Martin Mares [Sat, 30 Jun 2018 21:54:30 +0000 (23:54 +0200)]
Released as 3.6.0

6 years agoUpdated pci.ids to today's snapshot
Martin Mares [Sat, 30 Jun 2018 21:42:12 +0000 (23:42 +0200)]
Updated pci.ids to today's snapshot

6 years agoConvert other string properties to the generic mechanism
Martin Mares [Tue, 26 Jun 2018 10:14:18 +0000 (12:14 +0200)]
Convert other string properties to the generic mechanism

This removes the need of explicit memory management and fixes
PCI_FILL_RESCAN.

To keep backward compatibility, I am keeping the raw pointers
in struct pci_dev, but they point inside the pci_property instead
of separately allocated memory.

6 years agoCreated a generic interface for device properties
Martin Mares [Tue, 26 Jun 2018 10:08:37 +0000 (12:08 +0200)]
Created a generic interface for device properties

Introduction of device tree node properties broke library ABI.

I gave up on creating new symbol versions whenever we add a new
device property, so I introduced a generic property interface
with which new string properties can be added while keeping ABI
compatibility.

6 years agoAdd device-tree node path to the verbose output
Oliver O'Halloran [Tue, 15 May 2018 05:39:05 +0000 (15:39 +1000)]
Add device-tree node path to the verbose output

Adds the path of the device-tree node of a PCI device to the lspci -v
output, like so:

0021:00:00.0 PCI bridge: IBM Device 03dc (prog-if 00 [Normal decode])
DT Node: /sys/firmware/devicetree/base/pciex@3fffe41100000/pci@0

This is added as a generic property to struct pci_device and populated
by the sysfs backend. Other platforms may find it useful though.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
6 years agopciutils: add tags\TAGS generation
Viktor Prutyanov [Thu, 22 Mar 2018 16:51:37 +0000 (19:51 +0300)]
pciutils: add tags\TAGS generation

This patch adds 'ctags' and 'TAGS' targets to Makefile

Signed-off-by: Viktor Prutyanov <viktor.prutyanov@virtuozzo.com>
6 years agoVPD: Cleanup
Martin Mares [Tue, 19 Jun 2018 09:44:42 +0000 (11:44 +0200)]
VPD: Cleanup

6 years agopciutils: Add decoding of vendor specific VPD fields
return.0 [Mon, 18 Jun 2018 22:00:31 +0000 (17:00 -0500)]
pciutils: Add decoding of vendor specific VPD fields

IBM has defined several VPD fields that are not part of the PCI
spec, but are frequently used on embedded and pluggable pcie
adapters.

Since these fields are "Unknown", they are listed in hex
and less readable.

This patch adds commonly used vendor specific VPD keywords
described in "Table 160. LoPAPR VPD Fields" of the Linux on Power
Architecture Platform Reference (LoPAPR).

Signed-off-by: John Walthour <return.0@me.com>