/* $OpenBSD: cy_isa.c,v 1.1 1996/07/27 07:20:05 deraadt Exp $ */ /* * cy.c * * Driver for Cyclades Cyclom-8/16/32 multiport serial cards * (currently not tested with Cyclom-32 cards) * * Timo Rossi, 1996 * * Supports both ISA and PCI Cyclom cards * * Uses CD1400 automatic CTS flow control, and * if CY_HW_RTS is defined, uses CD1400 automatic input flow control. * This requires a special cable that exchanges the RTS and DTR lines. * * Lots of debug output can be enabled by defining CY_DEBUG * Some debugging counters (number of receive/transmit interrupts etc.) * can be enabled by defining CY_DEBUG1 * * This version uses the bus_mem/io_??() stuff * * NOT TESTED !!! * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int cy_probe_isa __P((struct device *, void *, void *)); int cy_probe_common __P((int card, bus_chipset_tag_t, bus_mem_handle_t, int bustype)); void cyattach __P((struct device *, struct device *, void *)); struct cfattach cy_isa_ca = { sizeof(struct cy_softc), cy_probe_isa, cyattach }; /* * ISA probe */ int cy_probe_isa(parent, match, aux) struct device *parent; void *match, *aux; { int card = ((struct device *)match)->dv_unit; struct isa_attach_args *ia = aux; bus_chipset_tag_t bc; bus_mem_handle_t memh; if(ia->ia_irq == IRQUNK) { printf("cy%d error: interrupt not defined\n", card); return 0; } bc = ia->ia_bc; if(bus_mem_map(bc, ia->ia_maddr, 0x2000, 0, &memh) != 0) return 0; if(cy_probe_common(card, bc, memh, CY_BUSTYPE_ISA) == 0) { bus_mem_unmap(bc, memh, 0x2000); return 0; } ia->ia_iosize = 0; ia->ia_msize = 0x2000; return 1; }