Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pccbb/pccbb_pci.c
Show First 20 Lines • Show All 797 Lines • ▼ Show 20 Lines | cbb_pci_alloc_resource(device_t bus, device_t child, int type, int *rid, | ||||
if (type == PCI_RES_BUS) | if (type == PCI_RES_BUS) | ||||
return (pcib_alloc_subbus(&sc->bus, child, rid, start, end, | return (pcib_alloc_subbus(&sc->bus, child, rid, start, end, | ||||
count, flags)); | count, flags)); | ||||
return (cbb_alloc_resource(bus, child, type, rid, start, end, count, | return (cbb_alloc_resource(bus, child, type, rid, start, end, count, | ||||
flags)); | flags)); | ||||
} | } | ||||
static int | static int | ||||
cbb_pci_adjust_resource(device_t bus, device_t child, int type, | cbb_pci_adjust_resource(device_t bus, device_t child, | ||||
struct resource *r, rman_res_t start, rman_res_t end) | struct resource *r, rman_res_t start, rman_res_t end) | ||||
{ | { | ||||
struct cbb_softc *sc; | struct cbb_softc *sc; | ||||
sc = device_get_softc(bus); | sc = device_get_softc(bus); | ||||
if (type == PCI_RES_BUS) { | if (rman_get_type(r) == PCI_RES_BUS) { | ||||
if (!rman_is_region_manager(r, &sc->bus.rman)) | if (!rman_is_region_manager(r, &sc->bus.rman)) | ||||
return (EINVAL); | return (EINVAL); | ||||
return (rman_adjust_resource(r, start, end)); | return (rman_adjust_resource(r, start, end)); | ||||
} | } | ||||
return (bus_generic_adjust_resource(bus, child, type, r, start, end)); | return (bus_generic_adjust_resource(bus, child, r, start, end)); | ||||
} | } | ||||
static int | static int | ||||
cbb_pci_release_resource(device_t bus, device_t child, int type, int rid, | cbb_pci_release_resource(device_t bus, device_t child, int type, int rid, | ||||
struct resource *r) | struct resource *r) | ||||
{ | { | ||||
struct cbb_softc *sc; | struct cbb_softc *sc; | ||||
int error; | int error; | ||||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |