patch-1.3.9 linux/drivers/sound/sound_switch.c

Next file: linux/drivers/sound/sound_timer.c
Previous file: linux/drivers/sound/sound_config.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.8/linux/drivers/sound/sound_switch.c linux/drivers/sound/sound_switch.c
@@ -115,7 +115,7 @@
 
   status_ptr = 0;
 
-  put_status ("Sound Driver:" SOUND_VERSION_STRING
+  put_status ("VoxWare Sound Driver:" SOUND_VERSION_STRING
 	      " (" SOUND_CONFIG_DATE " " SOUND_CONFIG_BY "@"
 	      SOUND_CONFIG_HOST "." SOUND_CONFIG_DOMAIN ")"
 	      "\n");
@@ -184,7 +184,11 @@
 	return;
     }
 
-  if (!put_status ("\nPCM devices:\n"))
+#ifdef EXCLUDE_AUDIO
+  if (!put_status ("\nAudio devices: NOT ENABLED IN CONFIG\n"))
+    return;
+#else
+  if (!put_status ("\nAudio devices:\n"))
     return;
 
   for (i = 0; i < num_audiodevs; i++)
@@ -198,7 +202,12 @@
       if (!put_status ("\n"))
 	return;
     }
+#endif
 
+#ifdef EXCLUDE_SEQUENCER
+  if (!put_status ("\nSynth devices: NOT ENABLED IN CONFIG\n"))
+    return;
+#else
   if (!put_status ("\nSynth devices:\n"))
     return;
 
@@ -213,7 +222,12 @@
       if (!put_status ("\n"))
 	return;
     }
+#endif
 
+#ifdef EXCLUDE_MIDI
+  if (!put_status ("\nMidi devices: NOT ENABLED IN CONFIG\n"))
+    return;
+#else
   if (!put_status ("\nMidi devices:\n"))
     return;
 
@@ -228,8 +242,9 @@
       if (!put_status ("\n"))
 	return;
     }
+#endif
 
-  if (!put_status ("\nMIDI Timers:\n"))
+  if (!put_status ("\nTimers:\n"))
     return;
 
   for (i = 0; i < num_sound_timers; i++)
@@ -244,12 +259,20 @@
 	return;
     }
 
-  if (!put_status ("\n"))
-    return;
-  if (!put_status_int (num_mixers, 10))
-    return;
-  if (!put_status (" mixer(s) installed\n"))
+  if (!put_status ("\nMixers:\n"))
     return;
+
+  for (i = 0; i < num_mixers; i++)
+    {
+      if (!put_status_int (i, 10))
+	return;
+      if (!put_status (": "))
+	return;
+      if (!put_status (mixer_devs[i]->name))
+	return;
+      if (!put_status ("\n"))
+	return;
+    }
 }
 
 static int
@@ -301,11 +324,6 @@
       return MIDIbuf_read (dev, file, buf, count);
 #endif
 
-#ifndef EXCLUDE_PSS
-    case SND_DEV_PSS:
-      return pss_read (dev, file, buf, count);
-#endif
-
     default:
       printk ("Sound: Undefined minor device %d\n", dev);
     }
@@ -338,11 +356,6 @@
       return MIDIbuf_write (dev, file, buf, count);
 #endif
 
-#ifndef EXCLUDE_PSS
-    case SND_DEV_PSS:
-      return pss_write (dev, file, buf, count);
-#endif
-
     default:
       return RET_ERROR (EPERM);
     }
@@ -392,13 +405,6 @@
       break;
 #endif
 
-#ifndef EXCLUDE_PSS
-    case SND_DEV_PSS:
-      if ((retval = pss_open (dev, file)) < 0)
-	return retval;
-      break;
-#endif
-
     case SND_DEV_DSP:
     case SND_DEV_DSP16:
     case SND_DEV_AUDIO:
@@ -446,12 +452,6 @@
       break;
 #endif
 
-#ifndef EXCLUDE_PSS
-    case SND_DEV_PSS:
-      pss_release (dev, file);
-      break;
-#endif
-
     case SND_DEV_DSP:
     case SND_DEV_DSP16:
     case SND_DEV_AUDIO:
@@ -472,11 +472,27 @@
 {
   DEB (printk ("sound_ioctl_sw(dev=%d, cmd=0x%x, arg=0x%x)\n", dev, cmd, arg));
 
-  if ((dev & 0x0f) != SND_DEV_CTL && num_mixers > 0)
-    if ((cmd >> 8) & 0xff == 'M')	/*
-					 * Mixer ioctl
-					 */
-      return mixer_devs[0]->ioctl (0, cmd, arg);
+  if ((cmd >> 8) & 0xff == 'M' && num_mixers > 0)	/* Mixer ioctl */
+    if ((dev & 0x0f) != SND_DEV_CTL)
+      {
+	int             dtype = dev & 0x0f;
+	int             mixdev;
+
+	switch (dtype)
+	  {
+	  case SND_DEV_DSP:
+	  case SND_DEV_DSP16:
+	  case SND_DEV_AUDIO:
+	    mixdev = audio_devs[dev >> 4]->mixer_dev;
+	    if (mixdev < 0 || mixdev >= num_mixers)
+	      return RET_ERROR (ENXIO);
+	    return mixer_devs[mixdev]->ioctl (mixdev, cmd, arg);
+	    break;
+
+	  default:
+	    return mixer_devs[0]->ioctl (0, cmd, arg);
+	  }
+      }
 
   switch (dev & 0x0f)
     {
@@ -508,12 +524,6 @@
 #ifndef EXCLUDE_MIDI
     case SND_DEV_MIDIN:
       return MIDIbuf_ioctl (dev, file, cmd, arg);
-      break;
-#endif
-
-#ifndef EXCLUDE_PSS
-    case SND_DEV_PSS:
-      return pss_ioctl (dev, file, cmd, arg);
       break;
 #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