summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2004-07-02 15:31:44 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2004-07-02 15:31:44 +0000
commita92c890fd179386f34a4d4a91993c1eedb8ae056 (patch)
tree53f37d81502aa7a7aad9b21b4c91c28a5f59e77d
parenta5a5d84784f44fe6e9e25b6ec71968e257202837 (diff)
Notes
-rw-r--r--sys/compat/linux/linux_ioctl.c4
-rw-r--r--sys/compat/linux/linux_ioctl.h1
-rw-r--r--sys/dev/sound/pcm/dsp.c10
3 files changed, 15 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index 867a13a82f42..0ee8e8e6c445 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -1799,6 +1799,10 @@ linux_ioctl_sound(struct thread *td, struct linux_ioctl_args *args)
args->cmd = SNDCTL_DSP_GETOPTR;
return (ioctl(td, (struct ioctl_args *)args));
+ case LINUX_SNDCTL_DSP_SETDUPLEX:
+ args->cmd = SNDCTL_DSP_SETDUPLEX;
+ return (ioctl(td, (struct ioctl_args *)args));
+
case LINUX_SNDCTL_DSP_GETODELAY:
args->cmd = SNDCTL_DSP_GETODELAY;
return (ioctl(td, (struct ioctl_args *)args));
diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h
index af1aac768d57..4d20ab906a53 100644
--- a/sys/compat/linux/linux_ioctl.h
+++ b/sys/compat/linux/linux_ioctl.h
@@ -254,6 +254,7 @@
#define LINUX_SNDCTL_DSP_SETTRIGGER LINUX_SNDCTL_DSP_GETTRIGGER
#define LINUX_SNDCTL_DSP_GETIPTR 0x5011
#define LINUX_SNDCTL_DSP_GETOPTR 0x5012
+#define LINUX_SNDCTL_DSP_SETDUPLEX 0x5016
#define LINUX_SNDCTL_DSP_GETODELAY 0x5017
#define LINUX_SNDCTL_SEQ_RESET 0x5100
#define LINUX_SNDCTL_SEQ_SYNC 0x5101
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 29fe27f94637..64088f95117c 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -1006,6 +1006,15 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *
}
break;
+ case SNDCTL_DSP_SETDUPLEX:
+ /*
+ * switch to full-duplex mode if card is in half-duplex
+ * mode and is able to work in full-duplex mode
+ */
+ if (rdch && wrch && (dsp_get_flags(i_dev) & SD_F_SIMPLEX))
+ dsp_set_flags(i_dev, dsp_get_flags(i_dev)^SD_F_SIMPLEX);
+ break;
+
case SNDCTL_DSP_MAPINBUF:
case SNDCTL_DSP_MAPOUTBUF:
case SNDCTL_DSP_SETSYNCRO:
@@ -1015,6 +1024,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *
case SOUND_PCM_WRITE_FILTER:
case SOUND_PCM_READ_FILTER:
/* dunno what these do, don't sound important */
+
default:
DEB(printf("default ioctl fn 0x%08lx fail\n", cmd));
ret = EINVAL;