summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pci_if.m
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2016-05-11 17:07:29 +0000
committerandrew <andrew@FreeBSD.org>2016-05-11 17:07:29 +0000
commit5685cc375d21d790be35070ebd5b39d6fc119767 (patch)
treeafff2f04742ffb12b2ce76615e50923c5cff12c5 /sys/dev/pci/pci_if.m
parent3109740c43a0c3799249f3fc316212a523d1c643 (diff)
downloadFreeBSD-src-5685cc375d21d790be35070ebd5b39d6fc119767.zip
FreeBSD-src-5685cc375d21d790be35070ebd5b39d6fc119767.tar.gz
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 Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6239
Diffstat (limited to 'sys/dev/pci/pci_if.m')
-rw-r--r--sys/dev/pci/pci_if.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/pci_if.m b/sys/dev/pci/pci_if.m
index da80305..9b4b660 100644
--- a/sys/dev/pci/pci_if.m
+++ b/sys/dev/pci/pci_if.m
@@ -27,6 +27,7 @@
#
#include <sys/bus.h>
+#include <dev/pci/pcivar.h>
INTERFACE pci;
@@ -208,9 +209,11 @@ METHOD int msix_table_bar {
device_t child;
} DEFAULT null_msix_bar;
-METHOD uint16_t get_rid {
+METHOD int get_id {
device_t dev;
device_t child;
+ enum pci_id_type type;
+ uintptr_t *id;
};
METHOD struct pci_devinfo * alloc_devinfo {
OpenPOWER on IntegriCloud