Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/aha/aha_isa.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
aha->dev = dev; | aha->dev = dev; | ||||
/* Check isapnp ids */ | /* Check isapnp ids */ | ||||
if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO) | if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO) | ||||
return (ENXIO); | return (ENXIO); | ||||
port_rid = 0; | port_rid = 0; | ||||
aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, | aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, | ||||
0ul, ~0ul, AHA_NREGS, RF_ACTIVE); | 0, ~0, AHA_NREGS, RF_ACTIVE); | ||||
if (aha->port == NULL) | if (aha->port == NULL) | ||||
return (ENXIO); | return (ENXIO); | ||||
port_start = rman_get_start(aha->port); | port_start = rman_get_start(aha->port); | ||||
aha_alloc(aha); | aha_alloc(aha); | ||||
/* See if there is really a card present */ | /* See if there is really a card present */ | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
aha_isa_attach(device_t dev) | aha_isa_attach(device_t dev) | ||||
{ | { | ||||
struct aha_softc *aha = device_get_softc(dev); | struct aha_softc *aha = device_get_softc(dev); | ||||
int error = ENOMEM; | int error = ENOMEM; | ||||
aha->dev = dev; | aha->dev = dev; | ||||
aha->portrid = 0; | aha->portrid = 0; | ||||
aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &aha->portrid, | aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &aha->portrid, | ||||
0ul, ~0ul, AHA_NREGS, RF_ACTIVE); | 0, ~0, AHA_NREGS, RF_ACTIVE); | ||||
if (!aha->port) { | if (!aha->port) { | ||||
device_printf(dev, "Unable to allocate I/O ports\n"); | device_printf(dev, "Unable to allocate I/O ports\n"); | ||||
goto fail; | goto fail; | ||||
} | } | ||||
aha->irqrid = 0; | aha->irqrid = 0; | ||||
aha->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &aha->irqrid, | aha->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &aha->irqrid, | ||||
RF_ACTIVE); | RF_ACTIVE); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |