static void dpt_isa_identify (driver_t *driver, device_t parent) { device_t child; dpt_conf_t * conf; int isa_bases[] = { 0x1f0, 0x170, 0x330, 0x230, 0 }; int i; for (i = 0; isa_bases[i]; i++) { conf = dpt_pio_get_conf(isa_bases[i]); if (!conf) { if (bootverbose) device_printf(parent, "dpt: dpt_pio_get_conf(%x) failed.\n", isa_bases[i]); continue; } child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "dpt", -1); if (child == 0) { device_printf(parent, "dpt: BUS_ADD_CHILD() failed!\n"); continue; } device_set_driver(child, driver); bus_set_resource(child, SYS_RES_IOPORT, 0, isa_bases[i], 0x9); } return; }
static int dpt_eisa_probe (device_t dev) { const char * desc; u_int32_t io_base; dpt_conf_t * conf; desc = dpt_eisa_match(eisa_get_id(dev)); if (!desc) return (ENXIO); device_set_desc(dev, desc); io_base = (eisa_get_slot(dev) * EISA_SLOT_SIZE) + DPT_EISA_SLOT_OFFSET + DPT_EISA_EATA_REG_OFFSET; conf = dpt_pio_get_conf(io_base); if (!conf) { printf("dpt: dpt_pio_get_conf() failed.\n"); return (ENXIO); } eisa_add_iospace(dev, io_base, DPT_EISA_IOSIZE, RESVADDR_NONE); eisa_add_intr(dev, conf->IRQ, (conf->IRQ_TR ? EISA_TRIGGER_LEVEL : EISA_TRIGGER_EDGE)); return 0; }
static int dpt_isa_probe (device_t dev) { dpt_conf_t * conf; u_int32_t io_base; /* No pnp support */ if (isa_get_vendorid(dev)) return (ENXIO); if ((io_base = bus_get_resource_start(dev, SYS_RES_IOPORT, 0)) == 0) return (ENXIO); if (dpt_isa_valid_ioport(io_base)) ; conf = dpt_pio_get_conf(io_base); if (!conf) { printf("dpt: dpt_pio_get_conf() failed.\n"); return (ENXIO); } if (dpt_isa_valid_irq(conf->IRQ)) ; device_set_desc(dev, "ISA DPT SCSI controller"); bus_set_resource(dev, SYS_RES_IRQ, 0, conf->IRQ, 1); bus_set_resource(dev, SYS_RES_DRQ, 0, ((8 - conf->DMA_channel) & 7), 1); return 0; }