summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-02-28 23:21:33 +0000
committerache <ache@FreeBSD.org>1995-02-28 23:21:33 +0000
commite33e8dd4a86cd33fe28b83d7b83ac323d854106d (patch)
treec376a3f03eee0290d6e281188b37fa7c97afe120 /sys
parent8bcefcd5f8f192f2fb67a89ce624ada3fc1ea920 (diff)
downloadFreeBSD-src-e33e8dd4a86cd33fe28b83d7b83ac323d854106d.zip
FreeBSD-src-e33e8dd4a86cd33fe28b83d7b83ac323d854106d.tar.gz
Workaround IXOFF bug when output queue is full && RTS control is on
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sio/sio.c8
-rw-r--r--sys/i386/isa/sio.c8
-rw-r--r--sys/isa/sio.c8
-rw-r--r--sys/kern/tty.c20
4 files changed, 34 insertions, 10 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index e5115e8..1d8bf01 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.68 1995/02/26 02:30:18 bde Exp $
+ * $Id: sio.c,v 1.69 1995/02/28 00:20:54 pst Exp $
*/
#include "sio.h"
@@ -1531,12 +1531,16 @@ repeat:
* Only have it in standard one now.
*/
&& linesw[tp->t_line].l_rint == ttyinput) {
+ int queue_full = 0;
+
if ((tp->t_iflag & IXOFF) &&
tp->t_cc[VSTOP] != _POSIX_VDISABLE &&
- putc(tp->t_cc[VSTOP], &tp->t_outq) == 0 ||
+ (queue_full = putc(tp->t_cc[VSTOP], &tp->t_outq)) == 0 ||
(com->state & CS_RTS_IFLOW)) {
tp->t_state |= TS_TBLOCK;
ttstart(tp);
+ if (queue_full) /* try again */
+ tp->t_state &= ~TS_TBLOCK;
}
}
/*
diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c
index e5115e8..1d8bf01 100644
--- a/sys/i386/isa/sio.c
+++ b/sys/i386/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.68 1995/02/26 02:30:18 bde Exp $
+ * $Id: sio.c,v 1.69 1995/02/28 00:20:54 pst Exp $
*/
#include "sio.h"
@@ -1531,12 +1531,16 @@ repeat:
* Only have it in standard one now.
*/
&& linesw[tp->t_line].l_rint == ttyinput) {
+ int queue_full = 0;
+
if ((tp->t_iflag & IXOFF) &&
tp->t_cc[VSTOP] != _POSIX_VDISABLE &&
- putc(tp->t_cc[VSTOP], &tp->t_outq) == 0 ||
+ (queue_full = putc(tp->t_cc[VSTOP], &tp->t_outq)) == 0 ||
(com->state & CS_RTS_IFLOW)) {
tp->t_state |= TS_TBLOCK;
ttstart(tp);
+ if (queue_full) /* try again */
+ tp->t_state &= ~TS_TBLOCK;
}
}
/*
diff --git a/sys/isa/sio.c b/sys/isa/sio.c
index e5115e8..1d8bf01 100644
--- a/sys/isa/sio.c
+++ b/sys/isa/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.68 1995/02/26 02:30:18 bde Exp $
+ * $Id: sio.c,v 1.69 1995/02/28 00:20:54 pst Exp $
*/
#include "sio.h"
@@ -1531,12 +1531,16 @@ repeat:
* Only have it in standard one now.
*/
&& linesw[tp->t_line].l_rint == ttyinput) {
+ int queue_full = 0;
+
if ((tp->t_iflag & IXOFF) &&
tp->t_cc[VSTOP] != _POSIX_VDISABLE &&
- putc(tp->t_cc[VSTOP], &tp->t_outq) == 0 ||
+ (queue_full = putc(tp->t_cc[VSTOP], &tp->t_outq)) == 0 ||
(com->state & CS_RTS_IFLOW)) {
tp->t_state |= TS_TBLOCK;
ttstart(tp);
+ if (queue_full) /* try again */
+ tp->t_state &= ~TS_TBLOCK;
}
}
/*
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 2020d7d..9edf66a 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
- * $Id: tty.c,v 1.33 1995/02/27 19:47:31 ugen Exp $
+ * $Id: tty.c,v 1.34 1995/02/28 00:21:03 pst Exp $
*/
#include "snp.h"
@@ -1098,12 +1098,16 @@ ttyflush(tp, rw)
}
if ((rw & FREAD) &&
ISSET(tp->t_state, TS_TBLOCK) && tp->t_rawq.c_cc < TTYHOG/5) {
+ int queue_full = 0;
+
if (ISSET(tp->t_iflag, IXOFF) &&
tp->t_cc[VSTART] != _POSIX_VDISABLE &&
- putc(tp->t_cc[VSTART], &tp->t_outq) == 0 ||
+ (queue_full = putc(tp->t_cc[VSTART], &tp->t_outq)) == 0 ||
ISSET(tp->t_cflag, CRTS_IFLOW)) {
CLR(tp->t_state, TS_TBLOCK);
ttstart(tp);
+ if (queue_full) /* try again */
+ SET(tp->t_state, TS_TBLOCK);
}
}
splx(s);
@@ -1137,12 +1141,16 @@ ttyblock(tp)
if (total >= TTYHOG / 2 &&
!ISSET(tp->t_state, TS_TBLOCK) &&
(!ISSET(tp->t_lflag, ICANON) || tp->t_canq.c_cc > 0)) {
+ int queue_full = 0;
+
if (ISSET(tp->t_iflag, IXOFF) &&
tp->t_cc[VSTOP] != _POSIX_VDISABLE &&
- putc(tp->t_cc[VSTOP], &tp->t_outq) == 0 ||
+ (queue_full = putc(tp->t_cc[VSTOP], &tp->t_outq)) == 0 ||
ISSET(tp->t_cflag, CRTS_IFLOW)) {
SET(tp->t_state, TS_TBLOCK);
ttstart(tp);
+ if (queue_full) /* try again */
+ CLR(tp->t_state, TS_TBLOCK);
}
}
}
@@ -1531,12 +1539,16 @@ read:
*/
s = spltty();
if (ISSET(tp->t_state, TS_TBLOCK) && tp->t_rawq.c_cc < TTYHOG/5) {
+ int queue_full = 0;
+
if (ISSET(tp->t_iflag, IXOFF) &&
cc[VSTART] != _POSIX_VDISABLE &&
- putc(cc[VSTART], &tp->t_outq) == 0 ||
+ (queue_full = putc(cc[VSTART], &tp->t_outq)) == 0 ||
ISSET(tp->t_cflag, CRTS_IFLOW)) {
CLR(tp->t_state, TS_TBLOCK);
ttstart(tp);
+ if (queue_full) /* try again */
+ SET(tp->t_state, TS_TBLOCK);
}
}
splx(s);
OpenPOWER on IntegriCloud