From 019508faee467a2e74783e3b034895d120f7165b Mon Sep 17 00:00:00 2001 From: mjacob Date: Sat, 21 Mar 1998 23:26:15 +0000 Subject: Well, I don't have a Cyclades board, but I needed the alpha kernels to compile. I made the changes that seemed to make sense tracking the shift from TS_WOPEN to tp->t_wopen- but they may be wrong. I wasn't subscribed to tech-kern so I missed the discussion, and C. Hannum was not particularly enlightening. Sorry if this isn't quite right. --- sys/dev/ic/cy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys') diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c index 4e4beee2055..8b54feda4fc 100644 --- a/sys/dev/ic/cy.c +++ b/sys/dev/ic/cy.c @@ -1,4 +1,4 @@ -/* $NetBSD: cy.c,v 1.8 1998/01/12 09:23:20 thorpej Exp $ */ +/* $NetBSD: cy.c,v 1.9 1998/03/21 23:26:15 mjacob Exp $ */ /* * cy.c @@ -257,8 +257,7 @@ cyopen(dev, flag, mode, p) tp->t_param = cyparam; tp->t_dev = dev; - if (!ISSET(tp->t_state, TS_ISOPEN)) { - SET(tp->t_state, TS_WOPEN); + if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) { ttychars(tp); tp->t_iflag = TTYDEF_IFLAG; tp->t_oflag = TTYDEF_OFLAG; @@ -338,9 +337,10 @@ cyopen(dev, flag, mode, p) if (!ISSET(flag, O_NONBLOCK)) { while (!ISSET(tp->t_cflag, CLOCAL) && !ISSET(tp->t_state, TS_CARR_ON)) { - SET(tp->t_state, TS_WOPEN); + tp->t_wopen++; error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH, "cydcd", 0); + tp->t_wopen--; if (error != 0) { splx(s); return error; @@ -919,7 +919,7 @@ cy_poll(arg) port++) { cy = &sc->sc_ports[port]; if ((tp = cy->cy_tty) == NULL || cy->cy_ibuf == NULL || - !ISSET(tp->t_state, TS_ISOPEN | TS_WOPEN)) + !ISSET(tp->t_state, TS_ISOPEN) || tp->t_wopen == 0) continue; /* -- cgit