History log of /freebsd-current/usr.sbin/pciconf/cap.c
Revision Date Author Comments
# 1e6db7be 09-Apr-2024 Konstantin Belousov <kib@FreeBSD.org>

pciconf(8): dump AMD IOMMU Base Capability

Reviewed by: emaste
Sponsored by: Advanced Micro Devices (AMD)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44732


# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


# e0a63d87 21-Jun-2023 Ed Maste <emaste@FreeBSD.org>

pciconf: add PCIe 5.0 and PCIe 6.0 link speeds

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40710


# 118cfb82 04-Nov-2022 Navdeep Parhar <np@FreeBSD.org>

pciconf(8): Decode ACS extended capability.

MFC after: 1 week
Sponsored by: Chelsio Communications
Reviewed by: kib@
Differential Revision: https://reviews.freebsd.org/D37271


# 2f176a2b 24-May-2021 David Bright <dab@FreeBSD.org>

pciconf: Fix up pciconf -lc output

The pciconf command fails to emit newlines when particular ecap field
values are seen. Fix them up. This has been seen on several systems at
$JOB. The documentation for PCI capabilities says that capability
type 0 should not be used once the spec for PCI capabilities was
published, but that seems more wishful-thinking than reality. pciconf
also chooses not to print fields related to field values that are
zero, but it seems several of these fields are zero on actual
hardware.

Reviewed by: vangyzen, imp, Bret Ketchum (Bret.Ketchum@dell.com)
Sponsored by: Dell EMC Isilon
Submitted by: Robert Herndon (Robert.Herndon@dell.com)
Differential Revision: https://reviews.freebsd.org/D30441


# 96128185 30-Sep-2020 Konstantin Belousov <kib@FreeBSD.org>

pciconf: print PCIe CTL max read request.

To not complicate existing parsers, the value is printed on a new
output line.

Sponsored by: Mellanox Technologies/NVIDIA Networking
MFC after: 1 week


# e1ae0ee1 20-Mar-2020 Scott Long <scottl@FreeBSD.org>

When printing out the contents of the VSEC, include the contents of the
headers. Device documentation often times give offsets relative to the
start of the entire VSEC, not just the post-header data area, so this
change makes it easier to correlate offsets.


# f1bbdf87 20-Feb-2020 Konstantin Belousov <kib@FreeBSD.org>

Print out some newly added PCIe extended capabilities and subclasses.

Taken from
https://pcisig.com/sites/default/files/files/PCI_Code-ID_r_1_11__v24_Jan_2019.pdf

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week


# 3b7a70d9 17-Feb-2020 Konstantin Belousov <kib@FreeBSD.org>

pciconf: List names of all known extended PCIe capabilities.

Some ids are redundand because the list_ecaps() function decodes them
by explicit switch case. But listing them all makes it easier to not
miss ecaps, while not changing the functionality.

Initial submission by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days


# 97faa4c4 13-Dec-2019 Scott Long <scottl@FreeBSD.org>

Add accessors for the Vendor Specific Extended Capability (VSEC)
Parse out the VSEC. If the user invokes a second -c command line option,
do a hex dump of the vendor data.

Reviewed by: imp
MFC after: 3 days
Sponsored by: Intel
Differential Revision: http://reviews.freebsd.org/D22808


# fe1c3596 12-Oct-2019 Scott Long <scottl@FreeBSD.org>

Fix the botched field ordering in the last commit. While here, fix
whitespace, and also reorder the fields so they are easier to read on
an 80 column display (the lines wrapped even before these changes).
Also fix non-standard nomenclature in the Caps code, and update the
man page.

Reported by: rpokala


# 5469a751 23-Aug-2019 Alexander Motin <mav@FreeBSD.org>

Report Clock Power Management support and status.

Since we already report ASPM, why not to go further.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.


# e1d8b631 23-Jul-2019 Andrew Gallatin <gallatin@FreeBSD.org>

pciconf: report PCI Gen4 speeds

PCIe gen4 runs at 16GT/s. Report this as
the speed of Gen4 links.

Reviewed by: imp
MFC after: 7 days
Sponsored by: Netflix


# e96d5d7b 05-Jan-2018 Warner Losh <imp@FreeBSD.org>

Remove dead code (comma is either 0 or 1 for sure, no need to test).
Close /dev/pci when we're done with it.

CID: 1007450, 1007449, 1008615, 1008614


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# a1566487 05-Aug-2016 Eric van Gyzen <vangyzen@FreeBSD.org>

Fix some logic in PCIe HotPlug; display EI status

The interpretation of the Electromechanical Interlock Status was
inverted, so we disengaged the EI if a card was inserted.
Fix it to engage the EI if a card is inserted.

When displaying the slot capabilites/status with pciconf:

- We inverted the sense of the Power Controller Control bit,
saying the power was off when it was really on (according to
this bit). Fix that.

- Display the status of the Electromechanical Interlock:
EI(engaged)
EI(disengaged)

Reviewed by: jhb
MFC after: 3 days
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D7426


# 0b035149 01-Apr-2016 John Baldwin <jhb@FreeBSD.org>

Output information about PCI-e devices with slots.

In particular this includes additional information on HotPlug capable
slots.


# c36c6e72 01-Apr-2016 John Baldwin <jhb@FreeBSD.org>

Various updates to the PCI-express capability output.

- Group the output so that it follows the capability register set more
closely. The first line now contains device information and the
second line contains link information. As a result, ARI status is now
output on the first line, and the link width is moved down to the second
line of link information.
- Only read the DEVICE_CAP2 register to check for ARI if the capability
version is >= 2.
- Don't output any link information if the link capability and status
registers are zero.
- Label the MSI interrupt index value as "MSI" instead of "IRQ".


# 733191a5 26-Feb-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

pciconf: Silence a GCC warning.

Fix the build on sparc64 and powerpc.

Taken from: wma


# 98179b62 26-Feb-2016 Wojciech Macek <wma@FreeBSD.org>

Change format string in pciconf EA to jx

Fix compilation error introduced by r296081


# a2862b11 26-Feb-2016 Wojciech Macek <wma@FreeBSD.org>

Add support for Enhanced Allocation in pciconf

* Modified pciconf to print EA capability structure
* Added register description to pcireg.h

Obtained from: Semihalf
Sponsored by: Cavium
Approved by: cognet (mentor)
Reviewed by: jhb
Differential revision: https://reviews.freebsd.org/D5440


# 873e155c 18-Feb-2016 Stefan Eßer <se@FreeBSD.org>

Use __unused instead of casting to void to silence the unused parameter
warning.

Fix the indentation of 2 lines to conform with the style of this file.

Submitted by: jhb


# a4ed9e4f 18-Feb-2016 Stefan Eßer <se@FreeBSD.org>

Make WARNS=6 safe.

Tested with Clang 3.7.1, GCC 4.2.1 and GCC 4.8.5 on amd64.


# 34f2f73c 05-Nov-2015 John Baldwin <jhb@FreeBSD.org>

Note if relaxed ordering or no snoop is enabled for each PCI-express device.

MFC after: 1 week


# 7fdbba5e 28-Feb-2015 Ryan Stone <rstone@FreeBSD.org>

Teach pciconf how to dump out SR-IOV capability

Differential Revision: https://reviews.freebsd.org/D1639
Reviewed by: jhb
MFC after: 1 month
Sponsored by: Sandvine Inc.


# 4cf825f6 01-Apr-2014 Ryan Stone <rstone@FreeBSD.org>

Print status of ARI capability in pciconf -c

Teach pciconf how to print out the status (enabled/disabled) of the ARI
capability on PCI Root Complexes and Downstream Ports.

MFC after: 2 months
Sponsored by: Sandvine Inc.


# 43a716a6 18-Jul-2013 Jung-uk Kim <jkim@FreeBSD.org>

Decode PCIe ASPM capability and status.


# 5d6787cf 17-May-2013 Konstantin Belousov <kib@FreeBSD.org>

Decode new HT 3.00 and 3.10 capabilities.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week


# 609933c6 01-Feb-2013 Neel Natu <neel@FreeBSD.org>

Display MSI-X table and PBA offsets when displaying information about MSI-X
capability.

Reviewed by: jhb, jimharris (initial version)


# ff473561 25-Oct-2012 Jim Harris <jimharris@FreeBSD.org>

For PCI Express capability, if max link width is greater than zero, print
the current and max link speed.

Sponsored by: Intel
Discussed with: jhb
MFC after: 1 week


# db85bb04 19-Oct-2012 Warner Losh <imp@FreeBSD.org>

Indent ecaps the same way we indent caps.

MFC after: 3 days


# 389c8bd5 18-Sep-2012 Gavin Atkinson <gavin@FreeBSD.org>

Align the PCI Express #defines with the style used for the PCI-X
#defines. This also has the advantage that it makes the names more
compact, iand also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.

This is a mostly mechanical rename:
s/PCIR_EXPRESS_/PCIER_/g
s/PCIM_EXP_/PCIEM_/g
s/PCIM_LINK_/PCIEM_LINK_/g

When this is MFC'd, #defines will be added for the old names to assist
out-of-tree drivers.

Discussed with: jhb
MFC after: 1 week


# 60149b5c 13-Sep-2012 John Baldwin <jhb@FreeBSD.org>

- Denote PCI-e endpoints that support FLR.
- Make parsing of PCI-e extended capabilities assume that future version
numbers are backwards compatible.
- Add new AER error descriptions.
- Add descriptions for more PCI-e extended capabilities.

MFC after: 1 week


# c4edfee4 05-Sep-2012 Gavin Atkinson <gavin@FreeBSD.org>

- If the PCIe "SLOT" flag is set, include this in the capability output
- Fix printing of PCIe interrupt number, the shift was incorrect.

MFC after: 1 week


# b6de0055 01-Jun-2012 John Baldwin <jhb@FreeBSD.org>

Add a new -e flag to pciconf(8)'s list mode to display PCI error details.
Currently this dumps the status of any error bits in the PCI status register
and PCI-express device status register. It also lists any errors indicated
by version 1 of PCI-express Advanced Error Reporting (AER).

MFC after: 1 week


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 770e4c5b 16-Sep-2010 John Baldwin <jhb@FreeBSD.org>

Only attempt to list extended capabilities for devices that have a
PCI-express capabilities. Non-PCI-express PCI devices may simply ignore
the upper bits in a config register address effectively aliasing the
device ID register to 0x100 rather than returning 0xFFFFFFFF. Previously
the code relied on these reads returning 0xFFFFFFFF.

MFC after: 3 days


# 64393db3 09-Sep-2010 John Baldwin <jhb@FreeBSD.org>

- Use 'sta' to hold the PCIR_STATUS register value instead of 'cmd' when
walking the capability list.
- Use constants for PCI header types instead of magic numbers.

MFC after: 1 week


# 79c2de35 08-Sep-2010 John Baldwin <jhb@FreeBSD.org>

- Add register definitions related to extended capability IDs in
PCI-express. I used PCIZ_* for ID constants (plain capability IDs use
PCIY_*).
- Add register definitions for the Advanced Error Reporting, Virtual
Channels, and Device Serial Number extended capabilities.
- Teach pciconf -c to list extended as well as plain capabilities. Adds
more detailed parsing for AER, VC, and device serial numbers.

MFC after: 2 weeks


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# a28b3fc7 17-Apr-2009 John Baldwin <jhb@FreeBSD.org>

- Add a few more register defintions for the PCI express capability
registers.
- Cleanup PCI-X capability printf to not leave a dangling "supports" for
some PCI-X bridges.
- Display additional PCI express details including the negotiated and max
link width and the actual and maximum supported max payload.

MFC after: 1 month


# f8dacb04 15-Feb-2009 Alexander Motin <mav@FreeBSD.org>

Tune output to remove trailing space.

Submitted by: Christoph Mallon


# 8e6f99f6 15-Feb-2009 Alexander Motin <mav@FreeBSD.org>

Add SATA and PCI Advanced Features capabilities reporting.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 305274ce 12-Nov-2007 John Birrell <jb@FreeBSD.org>

Include agpreg.h from it's new location.


# cbf96402 31-Oct-2007 John Baldwin <jhb@FreeBSD.org>

Update copyright attribution.

MFC after: 3 days


# 4d6c5bef 27-Oct-2007 John Baldwin <jhb@FreeBSD.org>

Missed in the previous commit to this file:
Actually support the new HT capability type from HT 2.00b.

MFC after: 3 days


# d68b1825 25-Apr-2007 John Baldwin <jhb@FreeBSD.org>

- HT 2.00b added a new flag to the MSI mapping HT capability to indicate
that the MSI mapping window is fixed at 0xfee00000 and the capability
does not include two more dwords used to program the address. Supporting
this mostly results in quieting spurious warnings during boot about
non-default MSI mapping windows.
- HT 2.00b also added a new HT capability type, so support that in pciconf.

MFC after: 3 days
Tested by: jmg


# 8866f04e 02-Feb-2007 John Baldwin <jhb@FreeBSD.org>

- Teach pciconf(8) to list the PCI capabilities supported by each device
via a new -c flag to be used with -l. Some simple parsing code is
present for the following capabilities: Power Management, AGP, VPD,
MSI, PCI-X, HyperTransport, Vendor-specific, EHCI Debug Port, PCI-PCI
bridge subvendor ID, PCI-express, and MSI-X.
- Fix a few warnings in pciconf.c.
- Update some cruft in pciconf(8):
- PCI 2.1 is no longer a revolutionary standard, and subvendor ID's are
fairly common at this point, so reflect that.
- Header type 2 is used for PCI-CardBus bridges.
- Describe the -v option for -l after completing the basic -l description
instead of disrupting the flow in the middle.

Reviewed by: imp (partially)
MFC after: 1 week