summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/rc.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-07-31 18:29:51 +0000
committerbde <bde@FreeBSD.org>1995-07-31 18:29:51 +0000
commit105a5302c8d514bac00d9a43e536c2d1cf348e7f (patch)
tree26124f1c54e97a50cf900004855d0d8008f3b9da /sys/i386/isa/rc.c
parent8169a9d300540831666cae03b26a062efb5e28c2 (diff)
downloadFreeBSD-src-105a5302c8d514bac00d9a43e536c2d1cf348e7f.zip
FreeBSD-src-105a5302c8d514bac00d9a43e536c2d1cf348e7f.tar.gz
Improve input flow control.
Use input buffer watermarks of TTYHOG-512 (high) and (high)*7/8 (low) instead of TTYHOG/2 (high) and TTYHOG/5 (low) to agree with some drivers. 512 is magic and some things depended on TTYHOG/2 >= TTYHOG-512 to work; now they depend on the 512 magic not changing and TTYHOG-512 being significantly larger than 0. This should be handled in ttsetwater(). Separate the decision about whether to do input flow control from doing it. ttyblock() now just starts input flow control (hardware and/or software) and there is a new function ttyunblock() to stop it. The decisions are the same except for the watermark changes and allowing for input expansion for PARMRK. When flushing input, try harder at first to send a start character if required, but give up if the first attempt fails. cy.c, rc.c, sio.c: Simplify: let ttyinput() handle input flow control if it is not being bypassed. Use ttyblock() to start flow control otherwise. rc.c: Use same input flow control test as elsewhere: test in a more efficient order and start flow control at >= highwater instead of at > highwater.
Diffstat (limited to 'sys/i386/isa/rc.c')
-rw-r--r--sys/i386/isa/rc.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index ec93d68..1e9f666 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -664,24 +664,12 @@ repeat:
if (icnt <= 0 || !(tp->t_state & TS_ISOPEN))
goto done1;
- if ( linesw[tp->t_line].l_rint == ttyinput
- && ((rc->rc_flags & RC_RTSFLOW) || (tp->t_iflag & IXOFF))
- && !(tp->t_state & TS_TBLOCK)
- && (tp->t_rawq.c_cc + icnt) > RB_I_HIGH_WATER) {
- int queue_full = 0;
-
- if ((tp->t_iflag & IXOFF) &&
- tp->t_cc[VSTOP] != _POSIX_VDISABLE &&
- (queue_full = putc(tp->t_cc[VSTOP], &tp->t_outq)) == 0 ||
- (rc->rc_flags & RC_RTSFLOW)) {
- tp->t_state |= TS_TBLOCK;
- ttstart(tp);
- if (queue_full) /* try again */
- tp->t_state &= ~TS_TBLOCK;
- }
- }
if ( (tp->t_state & TS_CAN_BYPASS_L_RINT)
&& !(tp->t_state & TS_LOCAL)) {
+ if ((tp->t_rawq.c_cc + icnt) >= RB_I_HIGH_WATER
+ && ((rc->rc_flags & RC_RTSFLOW) || (tp->t_iflag & IXOFF))
+ && !(tp->t_state & TS_TBLOCK))
+ ttyblock(tp);
tk_nin += icnt;
tk_rawcc += icnt;
tp->t_rawcc += icnt;
OpenPOWER on IntegriCloud