Implement OSS_SOUND_MIXER_INFO.

This commit is contained in:
augustss 1999-11-17 00:06:38 +00:00
parent 41a71bdc48
commit d37a1f8e3b
2 changed files with 30 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ossaudio.c,v 1.29 1999/08/22 13:43:10 kleink Exp $ */
/* $NetBSD: ossaudio.c,v 1.30 1999/11/17 00:06:38 augustss Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -639,6 +639,8 @@ oss_ioctl_mixer(p, uap, retval)
u_long com;
struct audiodevinfo *di;
mixer_ctrl_t mc;
struct oss_mixer_info omi;
struct audio_device adev;
int idat;
int i;
int error;
@ -671,6 +673,15 @@ oss_ioctl_mixer(p, uap, retval)
ioctlf = fp->f_ops->fo_ioctl;
switch (com) {
case OSS_SOUND_MIXER_INFO:
case OSS_SOUND_OLD_MIXER_INFO:
error = ioctlf(fp, AUDIO_GETDEV, (caddr_t)&adev, p);
if (error)
return (error);
omi.modify_counter = 1;
strncpy(omi.id, adev.name, sizeof omi.id);
strncpy(omi.name, adev.name, sizeof omi.name);
return copyout(&omi, SCARG(uap, data), OSS_IOCTL_SIZE(com));
case OSS_SOUND_MIXER_READ_RECSRC:
if (di->source == -1) {
error = EINVAL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ossaudiovar.h,v 1.6 1999/04/13 20:31:32 augustss Exp $ */
/* $NetBSD: ossaudiovar.h,v 1.7 1999/11/17 00:06:39 augustss Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -50,6 +50,8 @@ struct oss_sys_ioctl_args {
#define _OSS_IOW(x,y,t) _OSS_IOCTL(OSS_IOC_IN, x, y, sizeof(t))
#define _OSS_IOWR(x,y,t) _OSS_IOCTL(OSS_IOC_INOUT, x, y, sizeof(t))
#define OSS_IOCTL_SIZE(x) (((x) >> 16) & OSS_IOCPARM_MASK)
#define OSS_SNDCTL_DSP_RESET _OSS_IO ('P', 0)
#define OSS_SNDCTL_DSP_SYNC _OSS_IO ('P', 1)
#define OSS_SNDCTL_DSP_SPEED _OSS_IOWR('P', 2, int)
@ -147,6 +149,21 @@ struct oss_sys_ioctl_args {
#define OSS_SOUND_MIXER_WRITE_RECSRC OSS_MIXER_WRITE(OSS_SOUND_MIXER_RECSRC)
#define OSS_SOUND_MIXER_WRITE_R_RECSRC OSS_MIXER_WRITE_R(OSS_SOUND_MIXER_RECSRC)
struct oss_mixer_info {
char id[16];
char name[32];
int modify_counter;
int fillers[10];
};
struct oss_old_mixer_info {
char id[16];
char name[32];
};
#define OSS_SOUND_MIXER_INFO _OSS_IOR('M', 101, struct oss_mixer_info)
#define OSS_SOUND_OLD_MIXER_INFO _OSS_IOR('M', 101, struct oss_old_mixer_info)
#define OSS_GET_DEV(com) ((com) & 0xff)
struct oss_audio_buf_info {