NetBSD 1.0 PATCH #4 INDEX DESCRIPTION ----- ----------- patch_04 Fix timeout handling bug in i386 parallel port driver. Affects: src/sys/arch/i386/isa/lpt.c diff -c src/sys/arch/i386/isa/lpt.c:1.22 src/sys/arch/i386/isa/lpt.c:1.22.2.1 *** src/sys/arch/i386/isa/lpt.c:1.22 Wed Nov 23 01:11:59 1994 --- src/sys/arch/i386/isa/lpt.c Wed Nov 23 01:12:00 1994 *************** *** 46,52 **** * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * $Id: lpt.c,v 1.22 1994/06/16 01:08:21 mycroft Exp $ */ /* --- 46,52 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * $Id: lpt.c,v 1.22.2.1 1994/11/23 06:27:25 cgd Exp $ */ /* *************** *** 125,131 **** static int notready __P((u_char, struct lpt_softc *)); #endif ! static void lptout __P((void *arg)); static int pushbytes __P((struct lpt_softc *)); /* --- 125,131 ---- static int notready __P((u_char, struct lpt_softc *)); #endif ! static void lptwakeup __P((void *arg)); static int pushbytes __P((struct lpt_softc *)); /* *************** *** 332,338 **** sc->sc_inbuf = geteblk(LPT_BSIZE); sc->sc_count = 0; sc->sc_state = LPT_OPEN; ! lptout(sc); lprintf("%s: opened\n", sc->sc_dev.dv_xname); return 0; --- 332,340 ---- sc->sc_inbuf = geteblk(LPT_BSIZE); sc->sc_count = 0; sc->sc_state = LPT_OPEN; ! ! if ((sc->sc_flags & LPT_NOINTR) == 0) ! lptwakeup(sc); lprintf("%s: opened\n", sc->sc_dev.dv_xname); return 0; *************** *** 362,382 **** #endif void ! lptout(arg) void *arg; { ! struct lpt_softc *sc; int s; - sc = (struct lpt_softc *)arg; - if (sc->sc_flags & LPT_NOINTR) - return; - s = spltty(); lptintr(sc); splx(s); ! timeout(lptout, sc, STEP); } /* --- 364,380 ---- #endif void ! lptwakeup(arg) void *arg; { ! struct lpt_softc *sc = arg; int s; s = spltty(); lptintr(sc); splx(s); ! timeout(lptwakeup, sc, STEP); } /* *************** *** 392,397 **** --- 390,398 ---- if (sc->sc_count) (void) pushbytes(sc); + + if ((sc->sc_flags & LPT_NOINTR) == 0) + untimeout(lptwakeup, sc); outb(iobase + lpt_control, LPC_NINIT); sc->sc_state = 0;