diff options
author | gjb <gjb@FreeBSD.org> | 2016-04-16 02:32:12 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2016-04-16 02:32:12 +0000 |
commit | 6549ef7d128d37c0dfff87f6c1c189b42ed3e1ef (patch) | |
tree | a8871301d693c6d33d43cd3171b1ee4783fec0e4 /sys/powerpc/ofw/ofw_pcibus.c | |
parent | ae096a53a90aee9859587d48d5a0279567abb413 (diff) | |
parent | 35691f7a6f04cec368d8636543bca596e870faf3 (diff) | |
download | FreeBSD-src-6549ef7d128d37c0dfff87f6c1c189b42ed3e1ef.zip FreeBSD-src-6549ef7d128d37c0dfff87f6c1c189b42ed3e1ef.tar.gz |
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/powerpc/ofw/ofw_pcibus.c')
-rw-r--r-- | sys/powerpc/ofw/ofw_pcibus.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c index 4ce6e73..01e2343 100644 --- a/sys/powerpc/ofw/ofw_pcibus.c +++ b/sys/powerpc/ofw/ofw_pcibus.c @@ -59,6 +59,7 @@ typedef uint32_t ofw_pci_intr_t; /* Methods */ static device_probe_t ofw_pcibus_probe; static device_attach_t ofw_pcibus_attach; +static pci_alloc_devinfo_t ofw_pcibus_alloc_devinfo; static pci_assign_interrupt_t ofw_pcibus_assign_interrupt; static ofw_bus_get_devinfo_t ofw_pcibus_get_devinfo; static bus_child_deleted_t ofw_pcibus_child_deleted; @@ -78,6 +79,7 @@ static device_method_t ofw_pcibus_methods[] = { DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method), /* PCI interface */ + DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo), DEVMETHOD(pci_assign_interrupt, ofw_pcibus_assign_interrupt), /* ofw_bus interface */ @@ -144,6 +146,15 @@ ofw_pcibus_attach(device_t dev) return (bus_generic_attach(dev)); } +struct pci_devinfo * +ofw_pcibus_alloc_devinfo(device_t dev) +{ + struct ofw_pcibus_devinfo *dinfo; + + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + return (&dinfo->opd_dinfo); +} + static void ofw_pcibus_enum_devtree(device_t dev, u_int domain, u_int busno) { @@ -185,8 +196,8 @@ ofw_pcibus_enum_devtree(device_t dev, u_int domain, u_int busno) * to the PCI bus. */ - dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib, - domain, busno, slot, func, sizeof(*dinfo)); + dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib, dev, + domain, busno, slot, func); if (dinfo == NULL) continue; if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != @@ -244,7 +255,7 @@ ofw_pcibus_enum_bus(device_t dev, u_int domain, u_int busno) continue; dinfo = (struct ofw_pcibus_devinfo *)pci_read_device( - pcib, domain, busno, s, f, sizeof(*dinfo)); + pcib, dev, domain, busno, s, f); if (dinfo == NULL) continue; |