diff options
author | shawn <shawn@cvs.openbsd.org> | 1996-06-27 21:15:56 +0000 |
---|---|---|
committer | shawn <shawn@cvs.openbsd.org> | 1996-06-27 21:15:56 +0000 |
commit | 9b8458abe82eafc40a5af7d154cf1ae00f7201c8 (patch) | |
tree | e38ab70dc915fb740b5b3e09ae7833d407807560 /sys/dev/isa | |
parent | 1110f451a70507ded794d18ee2ba775b73688ccb (diff) |
new 2940 driver merged from freebsd sources 960623
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/lpt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/isa/lpt.c b/sys/dev/isa/lpt.c index 90d6554332e..851b2bcb100 100644 --- a/sys/dev/isa/lpt.c +++ b/sys/dev/isa/lpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpt.c,v 1.15 1996/06/25 20:59:05 deraadt Exp $ */ +/* $OpenBSD: lpt.c,v 1.16 1996/06/27 21:15:51 shawn Exp $ */ /* $NetBSD: lpt.c,v 1.39 1996/05/12 23:53:06 mycroft Exp $ */ /* @@ -472,20 +472,22 @@ pushbytes(sc) } else { int s; + s = spltty(); while (sc->sc_count > 0) { /* if the printer is ready for a char, give it one */ if ((sc->sc_state & LPT_OBUSY) == 0) { LPRINTF(("%s: write %d\n", sc->sc_dev.dv_xname, sc->sc_count)); - s = spltty(); (void) lptintr(sc); - splx(s); } error = tsleep((caddr_t)sc, LPTPRI | PCATCH, "lptwrite2", 0); - if (error) + if (error) { + splx(s); return error; + } } + splx(s); } return 0; } @@ -533,7 +535,8 @@ lptintr(arg) bus_chipset_tag_t bc = sc->sc_bc; bus_io_handle_t ioh = sc->sc_ioh; - if (((sc->sc_state & LPT_OPEN) == 0 && sc->sc_count == 0) || (sc->sc_flags & LPT_NOINTR)) + if (((sc->sc_state & LPT_OPEN) == 0 && sc->sc_count == 0) || + (sc->sc_flags & LPT_NOINTR)) return 0; /* is printer online and ready for output */ |