summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/vga_pci.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-03-03 18:08:57 +0000
committerjhb <jhb@FreeBSD.org>2012-03-03 18:08:57 +0000
commitdb63f69541c624629331258004b800e1929a9140 (patch)
tree327afe671bfb97e2bc7f889c317c4b18da45a8e2 /sys/dev/pci/vga_pci.c
parent5794e3ef03066c06566d80796cdb60efbe337733 (diff)
downloadFreeBSD-src-db63f69541c624629331258004b800e1929a9140.zip
FreeBSD-src-db63f69541c624629331258004b800e1929a9140.tar.gz
Expand the set of APIs available for locating PCI capabilities:
- pci_find_extcap() is repurposed to be used for fetching PCI-express extended capabilities (PCIZ_* constants in <dev/pci/pcireg.h>). - pci_find_htcap() can be used to locate a specific HyperTransport capability (PCIM_HTCAP_* constants in <dev/pci/pcireg.h>). - Cache the starting location of the PCI-express capability for PCI-express devices in PCI device ivars.
Diffstat (limited to 'sys/dev/pci/vga_pci.c')
-rw-r--r--sys/dev/pci/vga_pci.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index cb1f8c1..fc96848 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -314,6 +314,14 @@ vga_pci_assign_interrupt(device_t dev, device_t child)
}
static int
+vga_pci_find_cap(device_t dev, device_t child, int capability,
+ int *capreg)
+{
+
+ return (pci_find_cap(dev, capability, capreg));
+}
+
+static int
vga_pci_find_extcap(device_t dev, device_t child, int capability,
int *capreg)
{
@@ -322,6 +330,14 @@ vga_pci_find_extcap(device_t dev, device_t child, int capability,
}
static int
+vga_pci_find_htcap(device_t dev, device_t child, int capability,
+ int *capreg)
+{
+
+ return (pci_find_htcap(dev, capability, capreg));
+}
+
+static int
vga_pci_alloc_msi(device_t dev, device_t child, int *count)
{
struct vga_pci_softc *sc;
@@ -422,7 +438,9 @@ static device_method_t vga_pci_methods[] = {
DEVMETHOD(pci_get_powerstate, vga_pci_get_powerstate),
DEVMETHOD(pci_set_powerstate, vga_pci_set_powerstate),
DEVMETHOD(pci_assign_interrupt, vga_pci_assign_interrupt),
+ DEVMETHOD(pci_find_cap, vga_pci_find_cap),
DEVMETHOD(pci_find_extcap, vga_pci_find_extcap),
+ DEVMETHOD(pci_find_htcap, vga_pci_find_htcap),
DEVMETHOD(pci_alloc_msi, vga_pci_alloc_msi),
DEVMETHOD(pci_alloc_msix, vga_pci_alloc_msix),
DEVMETHOD(pci_remap_msix, vga_pci_remap_msix),
OpenPOWER on IntegriCloud