patch-1.3.34 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: 185
- Date:
Wed Oct 11 07:55:40 1995
- Orig file:
v1.3.33/linux/drivers/sound/gus_midi.c
- Orig date:
Tue Jul 11 10:02:52 1995
diff -u --recursive --new-file v1.3.33/linux/drivers/sound/gus_midi.c linux/drivers/sound/gus_midi.c
@@ -46,8 +46,9 @@
static volatile int qlen;
static volatile unsigned char qhead, qtail;
extern int gus_base, gus_irq, gus_dma;
+extern sound_os_info *gus_osp;
-#define GUS_MIDI_STATUS() INB(u_MidiStatus)
+#define GUS_MIDI_STATUS() inb( u_MidiStatus)
static int
gus_midi_open (int dev, int mode,
@@ -59,10 +60,10 @@
if (midi_busy)
{
printk ("GUS: Midi busy\n");
- return RET_ERROR (EBUSY);
+ return -EBUSY;
}
- OUTB (MIDI_RESET, u_MidiControl);
+ outb (MIDI_RESET, u_MidiControl);
gus_delay ();
gus_midi_control = 0;
@@ -79,7 +80,7 @@
gus_midi_control |= MIDI_ENABLE_XMIT;
}
- OUTB (gus_midi_control, u_MidiControl); /*
+ outb (gus_midi_control, u_MidiControl); /*
* Enable
*/
@@ -98,12 +99,13 @@
output_used = 1;
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
if (GUS_MIDI_STATUS () & MIDI_XMIT_EMPTY)
{
ok = 1;
- OUTB (midi_byte, u_MidiData);
+ outb (midi_byte, u_MidiData);
}
else
{
@@ -111,10 +113,10 @@
* Enable Midi xmit interrupts (again)
*/
gus_midi_control |= MIDI_ENABLE_XMIT;
- OUTB (gus_midi_control, u_MidiControl);
+ outb (gus_midi_control, u_MidiControl);
}
- RESTORE_INTR (flags);
+ restore_flags (flags);
return ok;
}
@@ -125,7 +127,7 @@
* Reset FIFO pointers, disable intrs
*/
- OUTB (MIDI_RESET, u_MidiControl);
+ outb (MIDI_RESET, u_MidiControl);
midi_busy = 0;
}
@@ -139,7 +141,8 @@
* Drain the local queue first
*/
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
while (qlen && dump_to_midi (tmp_queue[qhead]))
{
@@ -147,7 +150,7 @@
qhead++;
}
- RESTORE_INTR (flags);
+ restore_flags (flags);
/*
* Output the byte if the local queue is empty.
@@ -168,13 +171,14 @@
* Local queue full
*/
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
tmp_queue[qtail] = midi_byte;
qlen++;
qtail++;
- RESTORE_INTR (flags);
+ restore_flags (flags);
return 1;
}
@@ -192,9 +196,9 @@
}
static int
-gus_midi_ioctl (int dev, unsigned cmd, unsigned arg)
+gus_midi_ioctl (int dev, unsigned cmd, ioctl_arg arg)
{
- return RET_ERROR (EINVAL);
+ return -EINVAL;
}
static void
@@ -210,7 +214,8 @@
if (!output_used)
return 0;
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
if (qlen && dump_to_midi (tmp_queue[qhead]))
{
@@ -218,7 +223,7 @@
qhead++;
}
- RESTORE_INTR (flags);
+ restore_flags (flags);
return (qlen > 0) | !(GUS_MIDI_STATUS () & MIDI_XMIT_EMPTY);
}
@@ -255,7 +260,7 @@
return mem_start;
}
- OUTB (MIDI_RESET, u_MidiControl);
+ outb (MIDI_RESET, u_MidiControl);
std_midi_synth.midi_dev = my_dev = num_midis;
midi_devs[num_midis++] = &gus_midi_operations;
@@ -268,13 +273,14 @@
unsigned char stat, data;
unsigned long flags;
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
stat = GUS_MIDI_STATUS ();
if (stat & MIDI_RCV_FULL)
{
- data = INB (u_MidiData);
+ data = inb (u_MidiData);
if (input_opened)
midi_input_intr (my_dev, data);
}
@@ -293,18 +299,12 @@
* Disable Midi output interrupts, since no data in the buffer
*/
gus_midi_control &= ~MIDI_ENABLE_XMIT;
- OUTB (gus_midi_control, u_MidiControl);
+ outb (gus_midi_control, u_MidiControl);
}
}
-#if 0
- if (stat & MIDI_FRAME_ERR)
- printk ("GUS: Midi framing error\n");
- if (stat & MIDI_OVERRUN && input_opened)
- printk ("GUS: Midi input overrun\n");
-#endif
- RESTORE_INTR (flags);
+ restore_flags (flags);
}
#endif
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