Page MenuHomeFreeBSD

Add helper methods for PCI-e register access.
ClosedPublic

Authored by jhb on Nov 5 2015, 8:19 PM.
Tags
None
Referenced Files
F122495894: D4088.id9970.diff
Sat, Jul 5, 6:58 PM
Unknown Object (File)
Tue, Jul 1, 3:50 PM
Unknown Object (File)
Wed, Jun 18, 4:38 PM
Unknown Object (File)
Wed, Jun 18, 11:04 AM
Unknown Object (File)
Wed, Jun 18, 7:12 AM
Unknown Object (File)
Jun 1 2025, 12:46 PM
Unknown Object (File)
Jun 1 2025, 10:35 AM
Unknown Object (File)
May 23 2025, 2:30 AM
Subscribers
None

Details

Summary

Add helper routines for PCI device drivers to read, write, and modify
PCI-Express capability registers (that is, PCI config registers in the
standard PCI config space belonging to the PCI-Express capability
register set).

Note that all of the current PCI-e registers are either 16 or 32-bits,
so only widths of 2 or 4 bytes are supported.

Also, there is not an existing pci_adjust_config() similar to
pcie_adjust_config(). I could add that in a separate commit if it
would be useful.

Test Plan
  • I use these in a pending change to cxgbe(4), however these are generally useful. We can probably remove some duplicated code in various drivers that uses pci_find_cap() followed by raw pci_read/write_config.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1040
Build 1043: arc lint + arc unit

Event Timeline

jhb retitled this revision from to Add helper methods for PCI-e register access..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: imp.

This looks fine to me.

This revision was automatically updated to reflect the committed changes.