Page MenuHomeFreeBSD

Create a get_id pci and pcib interface.
ClosedPublic

Authored by andrew on May 6 2016, 12:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 20, 2:34 AM
Unknown Object (File)
Sat, Jan 18, 5:34 PM
Unknown Object (File)
Thu, Jan 9, 3:57 AM
Unknown Object (File)
Wed, Jan 8, 9:27 AM
Unknown Object (File)
Mon, Jan 6, 5:19 PM
Unknown Object (File)
Mon, Jan 6, 7:14 AM
Unknown Object (File)
Tue, Dec 31, 1:00 AM
Unknown Object (File)
Fri, Dec 27, 7:41 AM
Subscribers

Details

Summary

Add a new get_id interfae to pci and pcib. This will allow us to:

  1. Detect failures.
  2. Get different PCI IDs.

For 1. the interface returns an int to signal an error. The ID is
returned at a uintptr_t * argument.

For 2. there is a type argument that allows selecting the ID type.
This only specifies a single type, however a MSI type will be added
to handle the need to find the ID the hardware passes to hte GICv3
interrupt controller.

D6227 will be updated to work with this interface.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew retitled this revision from to Create a get_id pci and pcib interface..
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: jhb, wma.
andrew added a subscriber: emaste.

Fix the return type for pcib_get_id

Fix the check in pcib_get_id

I was going to suggest just naming the new methods 'get_rid' as well, but it does seem like we MFC'd get_rid to stable/10 which is unfortunate. OTOH, I doubt very few things use the API in 10 as SRIOV wasn't MFC'd to 10. I'd rather just fix the API and not support the old one if we can at all help it.

sys/dev/pci/pcivar.h
274 ↗(On Diff #16132)

I would suggest using an enum as I used for bus_get_cpus(), it's a bit nicer in the debugger.

andrew edited edge metadata.

Fix the build, enum pci_id_type needs to be defined before pci_if.h

share/man/man9/pci.9
371 ↗(On Diff #16149)

it actually stands for "routing identifier"

jhb edited edge metadata.
jhb added inline comments.
share/man/man9/pci.9
101 ↗(On Diff #16149)

The enum needs a variable name ("enum pci_id_type type" or some such)

371 ↗(On Diff #16149)

Oops, my fault. I gave andrew the wrong answer on IRC.

This revision is now accepted and ready to land.May 10 2016, 10:21 PM
andrew edited edge metadata.

Fix the manpage

This revision now requires review to proceed.May 11 2016, 10:56 AM
rstone edited edge metadata.
This revision is now accepted and ready to land.May 11 2016, 3:32 PM
This revision was automatically updated to reflect the committed changes.