Yong, Jonathan [Tue, 10 May 2016 03:15:55 +0000 (03:15 +0000)]
lspci: Decode Precision Time Measurement capabiltity
Section 7.32 Precision Time Management (or Measurement) from the
PCI Express Base 3.1 specification is an optional Extended Capability
for discovering and controlling the distribution of a PTM Hierarchy.
Signed-off-by: Yong, Jonathan <jonathan.yong@intel.com>
Bjorn Helgaas [Thu, 10 Dec 2015 19:50:01 +0000 (13:50 -0600)]
lspci: Decode DevCap SlotPowerLimit for all components with Upstream Ports
The SlotPowerLimit in the Slot Capability indicates how much power the slot
can supply to a downstream device. A Root Port or Switch Downstream Port
communicates the limit via a Set_Slot_Power_Limit Message on the link. The
component on the other end of the link copies the limit from the message to
the Captured Slot Power Limit in its Device Capability [see PCIe r3.0, sec
2.2.8.5].
The Captured SlotPowerLimit is relevant for all devices on the downstream
end of a Link. This includes Endpoints and Bridges as well as
Switch Upstream Ports.
Decode the DevCap Captured SlotPowerLimit for Endpoints and Bridges as well
as Switch Upstream Ports.
Martin Mares [Mon, 14 Sep 2015 15:43:04 +0000 (17:43 +0200)]
Sysfs: Read failures of optional attributes are not fatal
Ameya Palande reported that with some kernels, reads of such
attributes fail on some hardware. He suggested to ignore read
failures completely, but I decided to turn the errors into
warnings in such cases. At least, the user will know that something
fishy is going on.
Martin Mares [Mon, 14 Sep 2015 15:00:28 +0000 (17:00 +0200)]
NUMA node scanning is now done in an ABI-compatible way
The numa_node field was moved to the end of the public part of
struct pci_dev. As usually, it has to be requested using the
PCI_FILL_NUMA_NODE and pci_fill_info() is versioned.
Matthew Wilcox [Wed, 22 Apr 2015 20:27:21 +0000 (16:27 -0400)]
Report NUMA node in lspci -v
In multi-socket systems, it's useful to see which node a particular
PCI device belongs to. Linux provides this information through sysfs,
but some users don't like poking through sysfs themselves to find it,
and it's pretty straightforward to report it in lspci.
I should note that when there is no NUMA node for a particular device,
Linux reports -1. I've chosen to continue that convention in pciutils,
and simply omit the information if the device does not belong to a NUMA
node (eg on single-socket systems, or devices which are not preferentially
attached to a particular node, like Nehalem-based systems).
Martin Mares [Sun, 2 Nov 2014 11:11:05 +0000 (12:11 +0100)]
Backward ABI compatibility for new filters and pci_fill_info
This is tricky, because we have to translate between old and new
format of struct pci_filter. At least, I added several RFU fields
so this hopefully won't have to happen again soon.
Matthew Wilcox [Tue, 30 Sep 2014 18:02:52 +0000 (14:02 -0400)]
lspci: Add ability to filter by class code
Extend the 'filter by device ID' functionality to allow optional
specification of a device ID. For example, to list all USB controllers
in the system made by Intel, specify:
lspci -d 8086::0c03
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Martin Mares [Sun, 2 Nov 2014 10:23:20 +0000 (11:23 +0100)]
Clean up man pages
We do not call .IX as it's not defined in mandoc.
Ellipsis at the end of line is protected by \&.
Inspired by Debian patches for the following bugs:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674708
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=675087
Martin Mares [Sat, 1 Nov 2014 17:38:08 +0000 (18:38 +0100)]
Rewritten support for UDEV's HWDB
HWDB is now handled in a way very similar to the DNS resolver.
The interface lives in a separate source file (lib/names-hwdb.c),
results of lookups are cached. Use of HWDB can be disabled either
by passing PCI_LOOKUP_NO_HWDB or by setting the hwdb.disabled
configuration parameter.
Also, there should be no more leaks of libudev's structures.
Tom Gundersen [Mon, 30 Dec 2013 18:59:53 +0000 (19:59 +0100)]
libpci: pci_id_lookup - add udev/hwdb support
This lets you select hwdb support at compile time.
hwdb is an efficient hardware database shipped with recent versions of udev. It contains
among other sources pci.ids so querying hwdb rather than reading pci.ids directly should give
the same result.
Ideally Linux distros using udev could stop shipping pci.ids, but use hwdb as the only source
of this information, which this patch allows.
Richard Yao [Mon, 20 Oct 2014 03:13:06 +0000 (23:13 -0400)]
Fix building shared libraries on Darwin
The original patch by Apple did not support building shared libraries on
Darwin. This corrects that oversight. It also fixes a few other
miscellaneous issues like incorrect platform detection and the lack of
an entry in the README file.
Richard Yao [Mon, 20 Oct 2014 03:13:05 +0000 (23:13 -0400)]
Import initial Darwin Support from Apple
Apple published a patch that adds Darwin support to pciutils. It is not
complete, but it does not appear to cause a build failure on other
platforms. For the sake of attribution purposes, it is being kept
separate from additional changes to make pciutils build properly on
Darwin.
This patch differs slightly from Apple's original patch by omitting the
Makefile.rej that Apple had incorrectly included in the patch that it
placed on its server.
lspci: Correct Root Capabilities "CRS Software Visibility" bit
lspci incorrectly tests bit 4, not bit 0, for "CRS Software Visibility" in
the Root Capabilities register, so it shows "RootCap: CRSVisible-" even for
devices that do support Software Visibility.
Use the correct definition for PCI_EXP_RTCAP_CRSVIS.
Thomas Renninger [Tue, 28 Jan 2014 07:51:02 +0000 (08:51 +0100)]
lspci: Show device name as exported by BIOS (sysfs label attribute) (V2)
The Device name of a PCI or PCI Express device under OS may be exported via
ACPI _DSM function with function index 7.
This allows to connect a described PCI device in the platform documentation
or as labeled on the chassis with PCI devices shown via lspci.
The kernel already exports this string through sysfs under a PCI device through
the "label" sysfs attribute.
This patch reads the device name if available and shows it to the user.
Real world examples:
Device Name: "USB HS EHCI Controller #2 #3"
Device Name: "USB HS EHCI Controller #1"
Device Name: "SATA Controller #1"
Device Name: "Onboard LAN #1"
Device Name: "Onboard LAN #2"
Device Name: "Onboard Video (PILOT-3)"
Compare with PCI Firmware Spec v3.1 chapter 4.6.7 and
ACPI spec v5.0 chapter 9.14.1
The DeviceName is not shown by default, but starting from first verbose
parameter (-v).
V2: - Free label string if allocated
- Enhance changelog
Signed-off-by: Thomas Renninger <trenn@suse.de> CC: linux-pci@vger.kernel.org
lspci: Decode PCIe LnkCtl "Read Completion Boundary" for PCIe-to-PCI bridges
The PCIe spec (r3.0, Table 7-16) says the Read Completion Boundary is valid
for Root Ports, Endpoints, and Bridges. I only added decoding for PCIe-to-
PCI/PCI-X bridges because the RCB of a Bridge indicates the RCB of the
upstream Root Port, so I don't think it makes sense for PCI-to-PCIe
bridges.
lspci: Clarify "PCIe-to-PCI/PCI-X" desc and Bridge Retry Config Enable
The PCI_EXP_TYPE_PCI_BRIDGE type is a PCIe to PCI/PCI-X bridge, so be a bit
more complete in the comment and printed device type. Also, per PCIe spec
r3.0, Table 7-14, the PCIe Device Control "Bridge Configuration Retry
Enable" bit only applies to PCIe-to-PCI/PCI-X bridges; it does not apply to
PCI-to-PCIe bridges.
lspci: Decode PCIe DevCap "Acceptable Latencies" only for Endpoints
The PCIe Device Capabilities "Endpoint L0s Acceptable Latency" and
"Endpoint L1 Acceptable Latency" are defined only for Endpoint functions,
so don't display them unless this is an endpoint.
lspci: Label PCIe LnkCap "L0s Exit Latency" as "L0s", not "L0"
The PCIe Link Capabilities "L0s Exit Latency" is the latency to exit
L0s, not L0, so label it "L0s" instead of "L0". This matches the
way we label the Device Capabilities "Endpoint L0s Acceptable Latency"
field as "Latency L0s". This also adds "Exit" to the description to
help distinguish it from the "Acceptable Latency" fields in the
Device Capabilities register.
Bjorn Helgaas [Wed, 28 Aug 2013 19:08:34 +0000 (13:08 -0600)]
lspci: Decode PCIe Link registers only for devices with links
Root Complex Integrated Endpoints and Root Complex Event Collectors do not
have links and are not permitted to implement Link or Link 2 registers,
per PCIe spec r3.0, sec 1.3.2.3. Decoding them is useless and misleading.
Bjorn Helgaas [Fri, 17 May 2013 19:48:19 +0000 (13:48 -0600)]
lspci: Fully decode ASPM support from Link Capabilities
The ASPM Support field in Link Capabilities is two bits, and all four
possible encodings are defined as of PCIe spec r3.0. Previously, lspci
only decoded values 1, 2, and 3. This adds 0, so lspci will show "ASPM
not supported" instead of "ASPM unknown".
Martin Mares [Fri, 19 Apr 2013 11:33:52 +0000 (13:33 +0200)]
lspci: Better filtering of duplicate kernel module names
It was implemented only for reading modules.pcimap, but it turned out
that it is necessary for libkmod, too, so we have switched to a common
implementation.
Kevin Pyle [Tue, 31 Jan 2012 15:50:43 +0000 (10:50 -0500)]
install: split out pcilib install to a dedicated target
The "install" target manages one set of files, and the "install-pcilib"
target manages a different set. They both install the pci library though
so if you try to run `make -j install install-pcilib`, things randomly
fail. So split out the commonly installed files into a dedicated target.
Marek Cruz [Tue, 31 Jan 2012 15:50:47 +0000 (10:50 -0500)]
lib/configure: match all freebsd os's
When using targets like "i686-pc-freebsd7.1", the configure script fails
to match for the freebsd target because it only expects "freebsd". Add
a glob to match all freebsd targets.