Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Fix a problem where no Tx Empty interrupt ever ha...



details:   https://anonhg.NetBSD.org/src/rev/3d88b677f12a
branches:  trunk
changeset: 471510:3d88b677f12a
user:      scw <scw%NetBSD.org@localhost>
date:      Sat Apr 03 13:13:19 1999 +0000

description:
Fix a problem where no Tx Empty interrupt ever happened if CTS
was deasserted and we wanted to change parameters to -crtscts
This effectively stalled the transmitter since with TS_BUSY set
we only change parameters during the Tx interrupt handler.

diffstat:

 sys/dev/ic/clmpcc.c |  25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diffs (55 lines):

diff -r d9e81145ad14 -r 3d88b677f12a sys/dev/ic/clmpcc.c
--- a/sys/dev/ic/clmpcc.c       Sat Apr 03 11:57:02 1999 +0000
+++ b/sys/dev/ic/clmpcc.c       Sat Apr 03 13:13:19 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clmpcc.c,v 1.4 1999/02/21 14:01:50 scw Exp $ */
+/*     $NetBSD: clmpcc.c,v 1.5 1999/04/03 13:13:19 scw Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -817,6 +817,7 @@
        struct clmpcc_softc *sc = clmpcc_cd.cd_devs[CLMPCCUNIT(tp->t_dev)];
        struct clmpcc_chan *ch = &sc->sc_chans[CLMPCCCHAN(tp->t_dev)];
        u_char cor;
+       u_char oldch;
        int oclk, obpr;
        int iclk, ibpr;
        int s;
@@ -921,13 +922,22 @@
                ch->ch_cor5 = 0;
 
        s = splserial();
-       if ( ISCLR(ch->ch_tty->t_state, TS_BUSY) ) {
-               u_char oldch;
-               oldch = clmpcc_select_channel(sc, ch->ch_car);
+       oldch = clmpcc_select_channel(sc, ch->ch_car);
+
+       /*
+        * COR2 needs to be set immediately otherwise we might never get
+        * a Tx EMPTY interrupt to change the other parameters.
+        */
+       if ( clmpcc_rdreg(sc, CLMPCC_REG_COR2) != ch->ch_cor2 )
+               clmpcc_wrreg(sc, CLMPCC_REG_COR2, ch->ch_cor2);
+
+       if ( ISCLR(ch->ch_tty->t_state, TS_BUSY) )
                clmpcc_set_params(ch);
-               clmpcc_select_channel(sc, oldch);
-       } else
+       else
                SET(ch->ch_flags, CLMPCC_FLG_UPDATE_PARMS);
+
+       clmpcc_select_channel(sc, oldch);
+
        splx(s);
 
        return 0;
@@ -967,9 +977,6 @@
                SET(ch->ch_flags, CLMPCC_FLG_NEED_INIT);
        }
 
-       if ( clmpcc_rdreg(sc, CLMPCC_REG_COR2) != ch->ch_cor2 )
-               clmpcc_wrreg(sc, CLMPCC_REG_COR2, ch->ch_cor2);
-
        if ( clmpcc_rdreg(sc, CLMPCC_REG_COR3) != ch->ch_cor3 )
                clmpcc_wrreg(sc, CLMPCC_REG_COR3, ch->ch_cor3);
 



Home | Main Index | Thread Index | Old Index