aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci/pcib_if.m
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2016-05-16 09:15:50 +0000
committerAndrew Turner <andrew@FreeBSD.org>2016-05-16 09:15:50 +0000
commitd7be980dbe6961abce6b3e12de0391cbad295f95 (patch)
treeffb68344d6a4eba6f36168fd0dca004f1d829d52 /sys/dev/pci/pcib_if.m
parent3fc155dc64bd967aebcde25b51c4210d870718b9 (diff)
downloadsrc-d7be980dbe6961abce6b3e12de0391cbad295f95.tar.gz
src-d7be980dbe6961abce6b3e12de0391cbad295f95.zip
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
Notes
Notes: svn path=/head/; revision=299929
Diffstat (limited to 'sys/dev/pci/pcib_if.m')
-rw-r--r--sys/dev/pci/pcib_if.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/pcib_if.m b/sys/dev/pci/pcib_if.m
index 6fdc0f42518e..530744a2f14f 100644
--- a/sys/dev/pci/pcib_if.m
+++ b/sys/dev/pci/pcib_if.m
@@ -48,6 +48,10 @@ CODE {
}
};
+HEADER {
+ #include "pci_if.h"
+};
+
#
# Return the number of slots on the attached PCI bus.
#
@@ -175,10 +179,12 @@ METHOD int power_for_sleep {
#
# Return the PCI Routing Identifier (RID) for the device.
#
-METHOD uint16_t get_rid {
+METHOD int get_id {
device_t pcib;
device_t dev;
-} DEFAULT pcib_get_rid;
+ enum pci_id_type type;
+ uintptr_t *id;
+} DEFAULT pcib_get_id;
#
# Enable Alternative RID Interpretation if both the downstream port (pcib)