Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cy/cy_isa.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
cy_addr iobase; | cy_addr iobase; | ||||
int error, mem_rid; | int error, mem_rid; | ||||
if (isa_get_logicalid(dev) != 0) /* skip PnP probes */ | if (isa_get_logicalid(dev) != 0) /* skip PnP probes */ | ||||
return (ENXIO); | return (ENXIO); | ||||
mem_rid = 0; | mem_rid = 0; | ||||
mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, | mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, | ||||
0ul, ~0ul, 0ul, RF_ACTIVE); | 0, ~0, 0, RF_ACTIVE); | ||||
if (mem_res == NULL) { | if (mem_res == NULL) { | ||||
device_printf(dev, "ioport resource allocation failed\n"); | device_printf(dev, "ioport resource allocation failed\n"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
iobase = rman_get_virtual(mem_res); | iobase = rman_get_virtual(mem_res); | ||||
/* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */ | /* Cyclom-16Y hardware reset (Cyclom-8Ys don't care) */ | ||||
cy_inb(iobase, CY16_RESET, 0); /* XXX? */ | cy_inb(iobase, CY16_RESET, 0); /* XXX? */ | ||||
Show All 15 Lines | |||||
void *irq_cookie, *vaddr, *vsc; | void *irq_cookie, *vaddr, *vsc; | ||||
int irq_rid, mem_rid; | int irq_rid, mem_rid; | ||||
irq_res = NULL; | irq_res = NULL; | ||||
mem_res = NULL; | mem_res = NULL; | ||||
mem_rid = 0; | mem_rid = 0; | ||||
mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, | mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &mem_rid, | ||||
0ul, ~0ul, 0ul, RF_ACTIVE); | 0, ~0, 0, RF_ACTIVE); | ||||
if (mem_res == NULL) { | if (mem_res == NULL) { | ||||
device_printf(dev, "memory resource allocation failed\n"); | device_printf(dev, "memory resource allocation failed\n"); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
vaddr = rman_get_virtual(mem_res); | vaddr = rman_get_virtual(mem_res); | ||||
vsc = cyattach_common(vaddr, 0); | vsc = cyattach_common(vaddr, 0); | ||||
if (vsc == NULL) { | if (vsc == NULL) { | ||||
device_printf(dev, "no ports found!\n"); | device_printf(dev, "no ports found!\n"); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
irq_rid = 0; | irq_rid = 0; | ||||
irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0ul, ~0ul, 0ul, | irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, 0, ~0, 0, | ||||
RF_SHAREABLE | RF_ACTIVE); | RF_SHAREABLE | RF_ACTIVE); | ||||
if (irq_res == NULL) { | if (irq_res == NULL) { | ||||
device_printf(dev, "interrupt resource allocation failed\n"); | device_printf(dev, "interrupt resource allocation failed\n"); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY, | if (bus_setup_intr(dev, irq_res, INTR_TYPE_TTY, | ||||
cyintr, NULL, vsc, &irq_cookie) != 0) { | cyintr, NULL, vsc, &irq_cookie) != 0) { | ||||
device_printf(dev, "interrupt setup failed\n"); | device_printf(dev, "interrupt setup failed\n"); | ||||
Show All 12 Lines |