sound: implement OSS_GETVERSION.
authorAlexander Polakov <polachok@gmail.com>
Fri, 2 Apr 2010 20:23:00 +0000 (00:23 +0400)
committerAlexander Polakov <polachok@gmail.com>
Sat, 17 Apr 2010 12:10:04 +0000 (16:10 +0400)
 It's required by some software, emulators/qemu to mention.

 Obtained-from: FreeBSD

sys/dev/sound/pcm/mixer.c
sys/sys/soundcard.h

index a8f1184..8047e3e 100644 (file)
@@ -683,6 +683,12 @@ mixer_ioctl(struct dev_ioctl_args *ap)
                return EBADF;
        }
 
+       if (cmd == OSS_GETVERSION) {
+               arg = SOUND_VERSION;
+               snd_mtxunlock(m->lock);
+               return 0;
+       }
+
        if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) {
                if (j == SOUND_MIXER_RECSRC)
                        ret = mixer_setrecsrc(m, *arg_i);
index 8c07c79..1bc34fe 100644 (file)
@@ -1092,6 +1092,9 @@ typedef struct mixer_info {
 
 #define SOUND_MIXER_INFO               _IOR('M', 101, mixer_info)
 
+/* Some apps require this */
+#define OSS_GETVERSION                 _IOR ('M', 118, int)
+
 #define LEFT_CHN       0
 #define RIGHT_CHN      1