summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/envy.c
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2012-03-30 08:18:19 +0000
committerratchov <ratchov@openbsd.org>2012-03-30 08:18:19 +0000
commitf3db5e0d9a7a9960945de6cf4010a0ea22c67aef (patch)
treed603e0e7ffe29e4c24ac606b090bf900e03205c0 /sys/dev/pci/envy.c
parenttweak FILES and HISTORY; (diff)
downloadwireguard-openbsd-f3db5e0d9a7a9960945de6cf4010a0ea22c67aef.tar.xz
wireguard-openbsd-f3db5e0d9a7a9960945de6cf4010a0ea22c67aef.zip
If the MIDI UART is not ready for output, don't spin at IPL_CLOCK;
just return and make the midi(4) driver retry later. UART buffers are large enough for this, except eap(4) which uses interrupts for output. help from and ok jsg@
Diffstat (limited to 'sys/dev/pci/envy.c')
-rw-r--r--sys/dev/pci/envy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pci/envy.c b/sys/dev/pci/envy.c
index cc7ea390719..86428bfc29b 100644
--- a/sys/dev/pci/envy.c
+++ b/sys/dev/pci/envy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: envy.c,v 1.50 2011/04/27 07:01:33 ratchov Exp $ */
+/* $OpenBSD: envy.c,v 1.51 2012/03/30 08:18:19 ratchov Exp $ */
/*
* Copyright (c) 2007 Alexandre Ratchov <alex@caoua.org>
*
@@ -2390,10 +2390,13 @@ int
envy_midi_output(void *self, int data)
{
struct envy_softc *sc = (struct envy_softc *)self;
+ int st;
- envy_midi_wait(sc);
+ st = envy_ccs_read(sc, ENVY_CCS_MIDISTAT0);
+ if (st & ENVY_MIDISTAT_OBUSY(sc))
+ return 0;
envy_ccs_write(sc, ENVY_CCS_MIDIDATA0, data);
- return 0;
+ return 1;
}
void