From d26b16906b2691c7f6f8162719309a191b4dc9d0 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 22 Sep 2004 22:17:45 +0000 Subject: the following patch fixes a bug preventing midi uarts that do not support interrupts on output, from writing blocks larger than MIDI_MAXWRITE bytes. tested on both kinds of devices from alex-contact@caoua.org --- sys/dev/midi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/midi.c b/sys/dev/midi.c index fb6905b0682..881f86d5a01 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.11 2004/09/21 06:03:15 brad Exp $ */ +/* $OpenBSD: midi.c,v 1.12 2004/09/22 22:17:44 deraadt Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -254,10 +254,9 @@ midi_out_do(struct midi_softc *sc) } if (!(sc->props & MIDI_PROP_OUT_INTR)) { - if (i < max) { - if (MIDIBUF_ISEMPTY(mb)) - midi_out_stop(sc); - } else + if (MIDIBUF_ISEMPTY(mb)) + midi_out_stop(sc); + else timeout_add(&sc->timeo, sc->wait); } } -- cgit v1.2.3