patch-1.3.34 linux/drivers/sound/pas2_midi.c
Next file: linux/drivers/sound/pas2_mixer.c
Previous file: linux/drivers/sound/pas2_card.c
Back to the patch index
Back to the overall index
- Lines: 110
- Date:
Wed Oct 11 07:55:41 1995
- Orig file:
v1.3.33/linux/drivers/sound/pas2_midi.c
- Orig date:
Tue Jul 25 18:21:22 1995
diff -u --recursive --new-file v1.3.33/linux/drivers/sound/pas2_midi.c linux/drivers/sound/pas2_midi.c
@@ -59,7 +59,7 @@
if (midi_busy)
{
printk ("PAS2: Midi busy\n");
- return RET_ERROR (EBUSY);
+ return -EBUSY;
}
/*
@@ -68,7 +68,8 @@
pas_write (M_C_RESET_INPUT_FIFO | M_C_RESET_OUTPUT_FIFO,
MIDI_CONTROL);
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
if ((err = pas_set_intr (I_M_MIDI_IRQ_ENABLE)) < 0)
return err;
@@ -107,7 +108,7 @@
pas_write (0xff, MIDI_STATUS);
ofifo_bytes = 0;
- RESTORE_INTR (flags);
+ restore_flags (flags);
midi_busy = 1;
qlen = qhead = qtail = 0;
@@ -161,7 +162,8 @@
* Drain the local queue first
*/
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
while (qlen && dump_to_midi (tmp_queue[qhead]))
{
@@ -169,7 +171,7 @@
qhead++;
}
- RESTORE_INTR (flags);
+ restore_flags (flags);
/*
* Output the byte if the local queue is empty.
@@ -190,13 +192,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;
}
@@ -214,9 +217,9 @@
}
static int
-pas_midi_ioctl (int dev, unsigned cmd, unsigned arg)
+pas_midi_ioctl (int dev, unsigned cmd, ioctl_arg arg)
{
- return RET_ERROR (EINVAL);
+ return -EINVAL;
}
static void
@@ -228,7 +231,7 @@
static int
pas_buffer_status (int dev)
{
- return !qlen;
+ return qlen;
}
#define MIDI_SYNTH_NAME "Pro Audio Spectrum Midi"
@@ -309,7 +312,8 @@
ofifo_bytes = 0;
}
- DISABLE_INTR (flags);
+ save_flags (flags);
+ cli ();
while (qlen && dump_to_midi (tmp_queue[qhead]))
{
@@ -317,13 +321,9 @@
qhead++;
}
- RESTORE_INTR (flags);
+ restore_flags (flags);
}
-#if 0
- if (stat & M_S_FRAMING_ERROR)
- printk ("MIDI framing error\n");
-#endif
if (stat & M_S_OUTPUT_OVERRUN)
{
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