Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ata/ata-cbus.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
/* local prototypes */ | /* local prototypes */ | ||||
static void ata_cbus_intr(void *); | static void ata_cbus_intr(void *); | ||||
static int | static int | ||||
ata_cbus_probe(device_t dev) | ata_cbus_probe(device_t dev) | ||||
{ | { | ||||
struct resource *io; | struct resource *io; | ||||
int rid; | int rid; | ||||
u_long tmp; | rman_res_t tmp; | ||||
/* dont probe PnP devices */ | /* dont probe PnP devices */ | ||||
if (isa_get_vendorid(dev)) | if (isa_get_vendorid(dev)) | ||||
return (ENXIO); | return (ENXIO); | ||||
/* allocate the ioport range */ | /* allocate the ioport range */ | ||||
rid = ATA_IOADDR_RID; | rid = ATA_IOADDR_RID; | ||||
if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, | if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bus_generic_attach(dev); | bus_generic_attach(dev); | ||||
return (0); | return (0); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
ata_cbus_alloc_resource(device_t dev, device_t child, int type, int *rid, | ata_cbus_alloc_resource(device_t dev, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, | ||||
u_int flags) | |||||
{ | { | ||||
struct ata_cbus_controller *ctlr = device_get_softc(dev); | struct ata_cbus_controller *ctlr = device_get_softc(dev); | ||||
if (type == SYS_RES_IOPORT) { | if (type == SYS_RES_IOPORT) { | ||||
switch (*rid) { | switch (*rid) { | ||||
case ATA_IOADDR_RID: | case ATA_IOADDR_RID: | ||||
return ctlr->io; | return ctlr->io; | ||||
case ATA_CTLADDR_RID: | case ATA_CTLADDR_RID: | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |