diff options
author | jhb <jhb@FreeBSD.org> | 2012-03-03 18:08:57 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-03-03 18:08:57 +0000 |
commit | db63f69541c624629331258004b800e1929a9140 (patch) | |
tree | 327afe671bfb97e2bc7f889c317c4b18da45a8e2 /sys/dev/siba | |
parent | 5794e3ef03066c06566d80796cdb60efbe337733 (diff) | |
download | FreeBSD-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/siba')
-rw-r--r-- | sys/dev/siba/siba_bwn.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/siba/siba_bwn.c b/sys/dev/siba/siba_bwn.c index 43c52bd..278ab9f 100644 --- a/sys/dev/siba/siba_bwn.c +++ b/sys/dev/siba/siba_bwn.c @@ -279,6 +279,14 @@ siba_bwn_teardown_intr(device_t dev, device_t child, struct resource *irq, } static int +siba_bwn_find_cap(device_t dev, device_t child, int capability, + int *capreg) +{ + + return (pci_find_cap(dev, capability, capreg)); +} + +static int siba_bwn_find_extcap(device_t dev, device_t child, int capability, int *capreg) { @@ -287,6 +295,14 @@ siba_bwn_find_extcap(device_t dev, device_t child, int capability, } static int +siba_bwn_find_htcap(device_t dev, device_t child, int capability, + int *capreg) +{ + + return (pci_find_htcap(dev, capability, capreg)); +} + +static int siba_bwn_alloc_msi(device_t dev, device_t child, int *count) { struct siba_bwn_softc *ssc; @@ -405,7 +421,9 @@ static device_method_t siba_bwn_methods[] = { DEVMETHOD(bus_teardown_intr, siba_bwn_teardown_intr), /* PCI interface */ + DEVMETHOD(pci_find_cap, siba_bwn_find_cap), DEVMETHOD(pci_find_extcap, siba_bwn_find_extcap), + DEVMETHOD(pci_find_htcap, siba_bwn_find_htcap), DEVMETHOD(pci_alloc_msi, siba_bwn_alloc_msi), DEVMETHOD(pci_release_msi, siba_bwn_release_msi), DEVMETHOD(pci_msi_count, siba_bwn_msi_count), |