patch-1.3.34 linux/drivers/sound/sb_midi.c

Next file: linux/drivers/sound/sb_mixer.c
Previous file: linux/drivers/sound/sb_dsp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.33/linux/drivers/sound/sb_midi.c linux/drivers/sound/sb_midi.c
@@ -61,6 +61,8 @@
 int             input_opened = 0;
 static int      my_dev;
 
+extern sound_os_info *sb_osp;
+
 void            (*midi_input_intr) (int dev, unsigned char data);
 
 static int
@@ -74,31 +76,31 @@
   if (!sb_dsp_ok)
     {
       printk ("SB Error: MIDI hardware not installed\n");
-      return RET_ERROR (ENXIO);
+      return -ENXIO;
     }
 
   if (sb_midi_busy)
-    return RET_ERROR (EBUSY);
+    return -EBUSY;
 
   if (mode != OPEN_WRITE && !sb_duplex_midi)
     {
       if (num_midis == 1)
 	printk ("SoundBlaster: Midi input not currently supported\n");
-      return RET_ERROR (EPERM);
+      return -EPERM;
     }
 
   sb_midi_mode = NORMAL_MIDI;
   if (mode != OPEN_WRITE)
     {
       if (sb_dsp_busy || sb_intr_active)
-	return RET_ERROR (EBUSY);
+	return -EBUSY;
       sb_midi_mode = UART_MIDI;
     }
 
   if (sb_dsp_highspeed)
     {
       printk ("SB Error: Midi output not possible during stereo or high speed audio\n");
-      return RET_ERROR (EBUSY);
+      return -EBUSY;
     }
 
   if (sb_midi_mode == UART_MIDI)
@@ -108,8 +110,8 @@
       sb_reset_dsp ();
 
       if (!sb_dsp_command (0x35))
-	return RET_ERROR (EIO);	/*
-				 * Enter the UART mode
+	return -EIO;		/*
+				   * Enter the UART mode
 				 */
       sb_intr_active = 1;
 
@@ -151,12 +153,13 @@
 
   if (sb_midi_mode == NORMAL_MIDI)
     {
-      DISABLE_INTR (flags);
+      save_flags (flags);
+      cli ();
       if (sb_dsp_command (0x38))
 	sb_dsp_command (midi_byte);
       else
 	printk ("SB Error: Unable to send a MIDI byte\n");
-      RESTORE_INTR (flags);
+      restore_flags (flags);
     }
   else
     sb_dsp_command (midi_byte);	/*
@@ -172,7 +175,7 @@
   if (sb_midi_mode != UART_MIDI)
     {
       printk ("SoundBlaster: MIDI input not implemented.\n");
-      return RET_ERROR (EPERM);
+      return -EPERM;
     }
   return 0;
 }
@@ -189,9 +192,9 @@
 }
 
 static int
-sb_midi_ioctl (int dev, unsigned cmd, unsigned arg)
+sb_midi_ioctl (int dev, unsigned cmd, ioctl_arg arg)
 {
-  return RET_ERROR (EPERM);
+  return -EPERM;
 }
 
 void
@@ -200,13 +203,14 @@
   unsigned long   flags;
   unsigned char   data;
 
-  DISABLE_INTR (flags);
+  save_flags (flags);
+  cli ();
 
-  data = INB (DSP_READ);
+  data = inb (DSP_READ);
   if (input_opened)
     midi_input_intr (my_dev, data);
 
-  RESTORE_INTR (flags);
+  restore_flags (flags);
 }
 
 #define MIDI_SYNTH_NAME	"SoundBlaster Midi"

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