diff options
author | andrew <andrew@FreeBSD.org> | 2016-05-16 09:15:50 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2016-05-16 09:15:50 +0000 |
commit | 61d083eeda2366298d9b85b7994e6e19405ad58d (patch) | |
tree | ffb68344d6a4eba6f36168fd0dca004f1d829d52 /share | |
parent | f1a8e245ae18e4d5cbe0a64739b2f8f092ecdcdd (diff) | |
download | FreeBSD-src-61d083eeda2366298d9b85b7994e6e19405ad58d.zip FreeBSD-src-61d083eeda2366298d9b85b7994e6e19405ad58d.tar.gz |
Re-commit r299467 having fixed the build:
Add a new get_id interface to pci and pcib. This will allow us to both
detect failures, and get different PCI IDs.
For the former the interface returns an int to signal an error. The ID is
returned at a uintptr_t * argument.
For the latter 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 the ARM GICv3
interrupt controller.
A follow up commit will be made to remove pci_get_rid.
Reviewed by: jhb, rstone (previous version)
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6239
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/Makefile | 1 | ||||
-rw-r--r-- | share/man/man9/pci.9 | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 21e8af4..2731608 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1290,6 +1290,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_find_extcap.9 \ pci.9 pci_find_htcap.9 \ pci.9 pci_find_pcie_root_port.9 \ + pci.9 pci_get_id.9 \ pci.9 pci_get_max_read_req.9 \ pci.9 pci_get_powerstate.9 \ pci.9 pci_get_vpd_ident.9 \ diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9 index 0e1024c..4b9003a 100644 --- a/share/man/man9/pci.9 +++ b/share/man/man9/pci.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 23, 2015 +.Dd May 16, 2016 .Dt PCI 9 .Os .Sh NAME @@ -43,6 +43,7 @@ .Nm pci_find_extcap , .Nm pci_find_htcap , .Nm pci_find_pcie_root_port , +.Nm pci_get_id , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -97,6 +98,8 @@ .Ft device_t .Fn pci_find_pcie_root_port "device_t dev" .Ft int +.Fn pci_get_id "device_t dev" "enum pci_id_type type" "uintptr_t *id" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -357,6 +360,18 @@ returns .Dv NULL . .Pp The +.Fn pci_get_id +function is used to read an identifier from a device. +The +.Fa type +flag is used to specify which identifier to read. +The following flags are supported: +.Bl -hang -width ".Dv PCI_ID_RID" +.It Dv PCI_ID_RID +Read the routing identifier for the device. +.El +.Pp +The .Fn pci_get_vpd_ident function is used to fetch a device's Vital Product Data .Pq VPD |