diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index 20737bfaa938..1bca887390ee 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.10 1995/07/22 01:29:58 bde Exp $ + * $Id: cy.c,v 1.11 1995/07/22 16:44:46 bde Exp $ */ #include "cy.h" @@ -184,7 +184,7 @@ * The following com and tty flags correspond closely: * CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and * siostop()) - * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop()) + * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart()) * CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam()) * CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam()) * TS_FLUSH is not used. @@ -1642,7 +1642,7 @@ siopoll() || tp->t_cc[VSTART] == tp->t_cc[VSTOP])) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + comstart(tp); } } else { do { @@ -2140,12 +2140,8 @@ siostop(tp, rw) int rw; { struct com_s *com; - cy_addr iobase; - int unit; - unit = DEV_TO_UNIT(tp->t_dev); - com = com_addr(unit); - iobase = com->iobase; + com = com_addr(DEV_TO_UNIT(tp->t_dev)); disable_intr(); if (rw & FWRITE) { com->obufs[0].l_queued = FALSE; @@ -2159,23 +2155,8 @@ siostop(tp, rw) com_events -= (com->iptr - com->ibuf); com->iptr = com->ibuf; } - if (tp->t_state & TS_TTSTOP) { - com->state &= ~CS_TTGO; - if (com->intr_enable & CD1400_SRER_TXRDY) { - cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN); - cd_outb(iobase, CD1400_SRER, - com->intr_enable &= ~CD1400_SRER_TXRDY); - } - } else { - com->state |= CS_TTGO; - if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY) - && !(com->intr_enable & CD1400_SRER_TXRDY)) { - cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN); - cd_outb(iobase, CD1400_SRER, - com->intr_enable |= CD1400_SRER_TXRDY); - } - } enable_intr(); + comstart(tp); /* XXX should clear h/w fifos too. */ } diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index 20737bfaa938..1bca887390ee 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.10 1995/07/22 01:29:58 bde Exp $ + * $Id: cy.c,v 1.11 1995/07/22 16:44:46 bde Exp $ */ #include "cy.h" @@ -184,7 +184,7 @@ * The following com and tty flags correspond closely: * CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and * siostop()) - * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop()) + * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart()) * CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam()) * CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam()) * TS_FLUSH is not used. @@ -1642,7 +1642,7 @@ siopoll() || tp->t_cc[VSTART] == tp->t_cc[VSTOP])) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + comstart(tp); } } else { do { @@ -2140,12 +2140,8 @@ siostop(tp, rw) int rw; { struct com_s *com; - cy_addr iobase; - int unit; - unit = DEV_TO_UNIT(tp->t_dev); - com = com_addr(unit); - iobase = com->iobase; + com = com_addr(DEV_TO_UNIT(tp->t_dev)); disable_intr(); if (rw & FWRITE) { com->obufs[0].l_queued = FALSE; @@ -2159,23 +2155,8 @@ siostop(tp, rw) com_events -= (com->iptr - com->ibuf); com->iptr = com->ibuf; } - if (tp->t_state & TS_TTSTOP) { - com->state &= ~CS_TTGO; - if (com->intr_enable & CD1400_SRER_TXRDY) { - cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN); - cd_outb(iobase, CD1400_SRER, - com->intr_enable &= ~CD1400_SRER_TXRDY); - } - } else { - com->state |= CS_TTGO; - if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY) - && !(com->intr_enable & CD1400_SRER_TXRDY)) { - cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN); - cd_outb(iobase, CD1400_SRER, - com->intr_enable |= CD1400_SRER_TXRDY); - } - } enable_intr(); + comstart(tp); /* XXX should clear h/w fifos too. */ } diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c index 07e02640dd00..e496a48401a1 100644 --- a/sys/dev/rc/rc.c +++ b/sys/dev/rc/rc.c @@ -693,7 +693,7 @@ void rcpoll() || (tp->t_cc[VSTART] == tp->t_cc[VSTOP]))) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + rc_start(tp); } } else { for (; tptr < eptr; tptr++) @@ -1468,6 +1468,7 @@ rc_discard_output(rc) rc->rc_optr = rc->rc_obufend; rc->rc_tp->t_state &= ~TS_BUSY; enable_intr(); + ttwwakeup(rc->rc_tp); } static void diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index fd30f74e32ab..93469e05491b 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.104 1995/07/22 01:30:02 bde Exp $ + * $Id: sio.c,v 1.105 1995/07/22 16:44:50 bde Exp $ */ #include "sio.h" @@ -114,7 +114,7 @@ * The following com and tty flags correspond closely: * CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and * siostop()) - * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop()) + * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart()) * CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam()) * CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam()) * TS_FLUSH is not used. @@ -1591,7 +1591,7 @@ siopoll() || tp->t_cc[VSTART] == tp->t_cc[VSTOP])) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + comstart(tp); } } else { do { @@ -1886,11 +1886,8 @@ siostop(tp, rw) com_events -= (com->iptr - com->ibuf); com->iptr = com->ibuf; } - if (tp->t_state & TS_TTSTOP) - com->state &= ~CS_TTGO; - else - com->state |= CS_TTGO; enable_intr(); + comstart(tp); /* XXX should clear h/w fifos too. */ } diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c index 20737bfaa938..1bca887390ee 100644 --- a/sys/i386/isa/cy.c +++ b/sys/i386/isa/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.10 1995/07/22 01:29:58 bde Exp $ + * $Id: cy.c,v 1.11 1995/07/22 16:44:46 bde Exp $ */ #include "cy.h" @@ -184,7 +184,7 @@ * The following com and tty flags correspond closely: * CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and * siostop()) - * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop()) + * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart()) * CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam()) * CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam()) * TS_FLUSH is not used. @@ -1642,7 +1642,7 @@ siopoll() || tp->t_cc[VSTART] == tp->t_cc[VSTOP])) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + comstart(tp); } } else { do { @@ -2140,12 +2140,8 @@ siostop(tp, rw) int rw; { struct com_s *com; - cy_addr iobase; - int unit; - unit = DEV_TO_UNIT(tp->t_dev); - com = com_addr(unit); - iobase = com->iobase; + com = com_addr(DEV_TO_UNIT(tp->t_dev)); disable_intr(); if (rw & FWRITE) { com->obufs[0].l_queued = FALSE; @@ -2159,23 +2155,8 @@ siostop(tp, rw) com_events -= (com->iptr - com->ibuf); com->iptr = com->ibuf; } - if (tp->t_state & TS_TTSTOP) { - com->state &= ~CS_TTGO; - if (com->intr_enable & CD1400_SRER_TXRDY) { - cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN); - cd_outb(iobase, CD1400_SRER, - com->intr_enable &= ~CD1400_SRER_TXRDY); - } - } else { - com->state |= CS_TTGO; - if (com->state >= (CS_BUSY | CS_TTGO | CS_ODEVREADY) - && !(com->intr_enable & CD1400_SRER_TXRDY)) { - cd_outb(iobase, CD1400_CAR, unit & CD1400_CAR_CHAN); - cd_outb(iobase, CD1400_SRER, - com->intr_enable |= CD1400_SRER_TXRDY); - } - } enable_intr(); + comstart(tp); /* XXX should clear h/w fifos too. */ } diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c index 07e02640dd00..e496a48401a1 100644 --- a/sys/i386/isa/rc.c +++ b/sys/i386/isa/rc.c @@ -693,7 +693,7 @@ void rcpoll() || (tp->t_cc[VSTART] == tp->t_cc[VSTOP]))) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + rc_start(tp); } } else { for (; tptr < eptr; tptr++) @@ -1468,6 +1468,7 @@ rc_discard_output(rc) rc->rc_optr = rc->rc_obufend; rc->rc_tp->t_state &= ~TS_BUSY; enable_intr(); + ttwwakeup(rc->rc_tp); } static void diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c index fd30f74e32ab..93469e05491b 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.104 1995/07/22 01:30:02 bde Exp $ + * $Id: sio.c,v 1.105 1995/07/22 16:44:50 bde Exp $ */ #include "sio.h" @@ -114,7 +114,7 @@ * The following com and tty flags correspond closely: * CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and * siostop()) - * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop()) + * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart()) * CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam()) * CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam()) * TS_FLUSH is not used. @@ -1591,7 +1591,7 @@ siopoll() || tp->t_cc[VSTART] == tp->t_cc[VSTOP])) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + comstart(tp); } } else { do { @@ -1886,11 +1886,8 @@ siostop(tp, rw) com_events -= (com->iptr - com->ibuf); com->iptr = com->ibuf; } - if (tp->t_state & TS_TTSTOP) - com->state &= ~CS_TTGO; - else - com->state |= CS_TTGO; enable_intr(); + comstart(tp); /* XXX should clear h/w fifos too. */ } diff --git a/sys/isa/sio.c b/sys/isa/sio.c index fd30f74e32ab..93469e05491b 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.104 1995/07/22 01:30:02 bde Exp $ + * $Id: sio.c,v 1.105 1995/07/22 16:44:50 bde Exp $ */ #include "sio.h" @@ -114,7 +114,7 @@ * The following com and tty flags correspond closely: * CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and * siostop()) - * CS_TTGO = ~TS_TTSTOP (maintained by comstart() and siostop()) + * CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart()) * CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam()) * CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam()) * TS_FLUSH is not used. @@ -1591,7 +1591,7 @@ siopoll() || tp->t_cc[VSTART] == tp->t_cc[VSTOP])) { tp->t_state &= ~TS_TTSTOP; tp->t_lflag &= ~FLUSHO; - ttstart(tp); + comstart(tp); } } else { do { @@ -1886,11 +1886,8 @@ siostop(tp, rw) com_events -= (com->iptr - com->ibuf); com->iptr = com->ibuf; } - if (tp->t_state & TS_TTSTOP) - com->state &= ~CS_TTGO; - else - com->state |= CS_TTGO; enable_intr(); + comstart(tp); /* XXX should clear h/w fifos too. */ }