patch-1.3.63 linux/drivers/sound/gus_midi.c
Next file: linux/drivers/sound/gus_vol.c
Previous file: linux/drivers/sound/gus_card.c
Back to the patch index
Back to the overall index
- Lines: 65
- Date:
Sat Feb 10 22:04:42 1996
- Orig file:
v1.3.62/linux/drivers/sound/gus_midi.c
- Orig date:
Tue Jan 23 21:15:45 1996
diff -u --recursive --new-file v1.3.62/linux/drivers/sound/gus_midi.c linux/drivers/sound/gus_midi.c
@@ -2,8 +2,9 @@
* sound/gus2_midi.c
*
* The low level driver for the GUS Midi Interface.
- *
- * Copyright by Hannu Savolainen 1993
+ */
+/*
+ * Copyright by Hannu Savolainen 1993-1996
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -24,8 +25,9 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
*/
+#include <linux/config.h>
+
#include "sound_config.h"
@@ -44,9 +46,13 @@
static volatile int qlen;
static volatile unsigned char qhead, qtail;
extern int gus_base, gus_irq, gus_dma;
-extern sound_os_info *gus_osp;
+extern int *gus_osp;
-#define GUS_MIDI_STATUS() inb( u_MidiStatus)
+static int
+GUS_MIDI_STATUS (void)
+{
+ return inb (u_MidiStatus);
+}
static int
gus_midi_open (int dev, int mode,
@@ -188,7 +194,7 @@
}
static int
-gus_midi_ioctl (int dev, unsigned cmd, ioctl_arg arg)
+gus_midi_ioctl (int dev, unsigned cmd, caddr_t arg)
{
return -EINVAL;
}
@@ -262,13 +268,14 @@
void
gus_midi_interrupt (int dummy)
{
- unsigned char stat, data;
+ volatile unsigned char stat, data;
unsigned long flags;
+ int timeout = 10;
save_flags (flags);
cli ();
- while ((stat = GUS_MIDI_STATUS ()) & (MIDI_RCV_FULL | MIDI_XMIT_EMPTY))
+ while (timeout-- > 0 && (stat = GUS_MIDI_STATUS ()) & (MIDI_RCV_FULL | MIDI_XMIT_EMPTY))
{
if (stat & MIDI_RCV_FULL)
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this