Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ofw/ofw_pcib.c
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
| #define PCI_INTR_PINS 4 | #define PCI_INTR_PINS 4 | ||||
| /* | /* | ||||
| * bus interface. | * bus interface. | ||||
| */ | */ | ||||
| static struct rman *ofw_pcib_get_rman(device_t, int, u_int); | static struct rman *ofw_pcib_get_rman(device_t, int, u_int); | ||||
| static struct resource * ofw_pcib_alloc_resource(device_t, device_t, | static struct resource * ofw_pcib_alloc_resource(device_t, device_t, | ||||
| int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); | int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
| static int ofw_pcib_release_resource(device_t, device_t, int, int, | static int ofw_pcib_release_resource(device_t, device_t, struct resource *); | ||||
| struct resource *); | |||||
| static int ofw_pcib_activate_resource(device_t, device_t, struct resource *); | static int ofw_pcib_activate_resource(device_t, device_t, struct resource *); | ||||
| static int ofw_pcib_deactivate_resource(device_t, device_t, struct resource *); | static int ofw_pcib_deactivate_resource(device_t, device_t, struct resource *); | ||||
| static int ofw_pcib_adjust_resource(device_t, device_t, | static int ofw_pcib_adjust_resource(device_t, device_t, | ||||
| struct resource *, rman_res_t, rman_res_t); | struct resource *, rman_res_t, rman_res_t); | ||||
| static int ofw_pcib_map_resource(device_t, device_t, struct resource *, | static int ofw_pcib_map_resource(device_t, device_t, struct resource *, | ||||
| struct resource_map_request *, struct resource_map *); | struct resource_map_request *, struct resource_map *); | ||||
| static int ofw_pcib_unmap_resource(device_t, device_t, struct resource *, | static int ofw_pcib_unmap_resource(device_t, device_t, struct resource *, | ||||
| struct resource_map *); | struct resource_map *); | ||||
| ▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | return (bus_generic_rman_alloc_resource(bus, child, type, rid, | ||||
| start, end, count, flags)); | start, end, count, flags)); | ||||
| default: | default: | ||||
| return (bus_generic_alloc_resource(bus, child, type, rid, | return (bus_generic_alloc_resource(bus, child, type, rid, | ||||
| start, end, count, flags)); | start, end, count, flags)); | ||||
| } | } | ||||
| } | } | ||||
| static int | static int | ||||
| ofw_pcib_release_resource(device_t bus, device_t child, int type, int rid, | ofw_pcib_release_resource(device_t bus, device_t child, struct resource *res) | ||||
| struct resource *res) | |||||
| { | { | ||||
| #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | ||||
| struct ofw_pci_softc *sc; | struct ofw_pci_softc *sc; | ||||
| sc = device_get_softc(bus); | sc = device_get_softc(bus); | ||||
| #endif | #endif | ||||
| switch (type) { | switch (rman_get_type(res)) { | ||||
| #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | #if defined(NEW_PCIB) && defined(PCI_RES_BUS) | ||||
| case PCI_RES_BUS: | case PCI_RES_BUS: | ||||
| return (pci_domain_release_bus(sc->sc_pci_domain, child, rid, | return (pci_domain_release_bus(sc->sc_pci_domain, child, res)); | ||||
| res)); | |||||
| #endif | #endif | ||||
| case SYS_RES_MEMORY: | case SYS_RES_MEMORY: | ||||
| case SYS_RES_IOPORT: | case SYS_RES_IOPORT: | ||||
| return (bus_generic_rman_release_resource(bus, child, type, rid, | return (bus_generic_rman_release_resource(bus, child, res)); | ||||
| res)); | |||||
| default: | default: | ||||
| return (bus_generic_release_resource(bus, child, type, rid, | return (bus_generic_release_resource(bus, child, res)); | ||||
| res)); | |||||
| } | } | ||||
| } | } | ||||
| static int | static int | ||||
| ofw_pcib_translate_resource(device_t bus, int type, rman_res_t start, | ofw_pcib_translate_resource(device_t bus, int type, rman_res_t start, | ||||
| rman_res_t *newstart) | rman_res_t *newstart) | ||||
| { | { | ||||
| struct ofw_pci_softc *sc; | struct ofw_pci_softc *sc; | ||||
| ▲ Show 20 Lines • Show All 275 Lines • Show Last 20 Lines | |||||