summaryrefslogtreecommitdiff
path: root/sys/dev/pcmcia/com_pcmcia.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-08-02 12:19:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-08-02 12:19:27 +0000
commitfde97e89177fcc4c053c2e7f5c6f3b047e73d2c0 (patch)
tree5b49ffbd1a32cca04df54f14b7bfcdd08304f2ea /sys/dev/pcmcia/com_pcmcia.c
parentfe1130822ba2906b4cb487c90b4d6055c81250a5 (diff)
Initialize timeouts correctly, match isa com; fixes panics in
PR #3732 and #3881 (although more issues remain).
Diffstat (limited to 'sys/dev/pcmcia/com_pcmcia.c')
-rw-r--r--sys/dev/pcmcia/com_pcmcia.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/pcmcia/com_pcmcia.c b/sys/dev/pcmcia/com_pcmcia.c
index 5cd783e0495..6da0eee0f26 100644
--- a/sys/dev/pcmcia/com_pcmcia.c
+++ b/sys/dev/pcmcia/com_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_pcmcia.c,v 1.37 2004/01/27 17:34:42 deraadt Exp $ */
+/* $OpenBSD: com_pcmcia.c,v 1.38 2004/08/02 12:19:26 miod Exp $ */
/* $NetBSD: com_pcmcia.c,v 1.15 1998/08/22 17:47:58 msaitoh Exp $ */
/*
@@ -568,4 +568,20 @@ com_pcmcia_attach2(sc)
bus_space_write_1(iot, ioh, com_fifo, FIFO_RCV_RST | FIFO_XMT_RST);
(void)bus_space_read_1(iot, ioh, com_data);
bus_space_write_1(iot, ioh, com_fifo, 0);
+
+ sc->sc_mcr = 0;
+ bus_space_write_1(iot, ioh, com_mcr, sc->sc_mcr);
+
+ timeout_set(&sc->sc_diag_tmo, comdiag, sc);
+ timeout_set(&sc->sc_dtr_tmo, com_raisedtr, sc);
+
+#if NCOM > 0
+#ifdef __HAVE_GENERIC_SOFT_INTERRUPTS
+ sc->sc_si = softintr_establish(IPL_TTY, comsoft, sc);
+ if (sc->sc_si == NULL)
+ panic("%s: can't establish soft interrupt.", sc->sc_dev.dv_xname);
+#else
+ timeout_set(&sc->sc_comsoft_tmo, comsoft, sc);
+#endif
+#endif
}