#include <linux/init.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/string.h>
#include <linux/module.h>
#include <linux/compat.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/control.h>
#include <sound/info.h>
#include <sound/mixer_oss.h>
#include <linux/soundcard.h>
#define OSS_ALSAEMULVER …
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS_SNDRV_MINOR(…);
static int snd_mixer_oss_open(struct inode *inode, struct file *file)
{ … }
static int snd_mixer_oss_release(struct inode *inode, struct file *file)
{ … }
static int snd_mixer_oss_info(struct snd_mixer_oss_file *fmixer,
mixer_info __user *_info)
{ … }
static int snd_mixer_oss_info_obsolete(struct snd_mixer_oss_file *fmixer,
_old_mixer_info __user *_info)
{ … }
static int snd_mixer_oss_caps(struct snd_mixer_oss_file *fmixer)
{ … }
static int snd_mixer_oss_devmask(struct snd_mixer_oss_file *fmixer)
{ … }
static int snd_mixer_oss_stereodevs(struct snd_mixer_oss_file *fmixer)
{ … }
static int snd_mixer_oss_recmask(struct snd_mixer_oss_file *fmixer)
{ … }
static int snd_mixer_oss_get_recsrc(struct snd_mixer_oss_file *fmixer)
{ … }
static int snd_mixer_oss_set_recsrc(struct snd_mixer_oss_file *fmixer, int recsrc)
{ … }
static int snd_mixer_oss_get_volume(struct snd_mixer_oss_file *fmixer, int slot)
{ … }
static int snd_mixer_oss_set_volume(struct snd_mixer_oss_file *fmixer,
int slot, int volume)
{ … }
static int snd_mixer_oss_ioctl1(struct snd_mixer_oss_file *fmixer, unsigned int cmd, unsigned long arg)
{ … }
static long snd_mixer_oss_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ … }
int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_COMPAT
static long snd_mixer_oss_ioctl_compat(struct file *file, unsigned int cmd,
unsigned long arg)
{ … }
#else
#define snd_mixer_oss_ioctl_compat …
#endif
static const struct file_operations snd_mixer_oss_f_ops = …;
static long snd_mixer_oss_conv(long val, long omin, long omax, long nmin, long nmax)
{ … }
static long snd_mixer_oss_conv1(long val, long min, long max, int *old)
{ … }
static long snd_mixer_oss_conv2(long val, long min, long max)
{ … }
#if 0
static void snd_mixer_oss_recsrce_set(struct snd_card *card, int slot)
{
struct snd_mixer_oss *mixer = card->mixer_oss;
if (mixer)
mixer->mask_recsrc |= 1 << slot;
}
static int snd_mixer_oss_recsrce_get(struct snd_card *card, int slot)
{
struct snd_mixer_oss *mixer = card->mixer_oss;
if (mixer && (mixer->mask_recsrc & (1 << slot)))
return 1;
return 0;
}
#endif
#define SNDRV_MIXER_OSS_SIGNATURE …
#define SNDRV_MIXER_OSS_ITEM_GLOBAL …
#define SNDRV_MIXER_OSS_ITEM_GSWITCH …
#define SNDRV_MIXER_OSS_ITEM_GROUTE …
#define SNDRV_MIXER_OSS_ITEM_GVOLUME …
#define SNDRV_MIXER_OSS_ITEM_PSWITCH …
#define SNDRV_MIXER_OSS_ITEM_PROUTE …
#define SNDRV_MIXER_OSS_ITEM_PVOLUME …
#define SNDRV_MIXER_OSS_ITEM_CSWITCH …
#define SNDRV_MIXER_OSS_ITEM_CROUTE …
#define SNDRV_MIXER_OSS_ITEM_CVOLUME …
#define SNDRV_MIXER_OSS_ITEM_CAPTURE …
#define SNDRV_MIXER_OSS_ITEM_COUNT …
#define SNDRV_MIXER_OSS_PRESENT_GLOBAL …
#define SNDRV_MIXER_OSS_PRESENT_GSWITCH …
#define SNDRV_MIXER_OSS_PRESENT_GROUTE …
#define SNDRV_MIXER_OSS_PRESENT_GVOLUME …
#define SNDRV_MIXER_OSS_PRESENT_PSWITCH …
#define SNDRV_MIXER_OSS_PRESENT_PROUTE …
#define SNDRV_MIXER_OSS_PRESENT_PVOLUME …
#define SNDRV_MIXER_OSS_PRESENT_CSWITCH …
#define SNDRV_MIXER_OSS_PRESENT_CROUTE …
#define SNDRV_MIXER_OSS_PRESENT_CVOLUME …
#define SNDRV_MIXER_OSS_PRESENT_CAPTURE …
struct slot { … };
#define ID_UNKNOWN …
static struct snd_kcontrol *snd_mixer_oss_test_id(struct snd_mixer_oss *mixer, const char *name, int index)
{ … }
static void snd_mixer_oss_get_volume1_vol(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
unsigned int numid,
int *left, int *right)
{ … }
static void snd_mixer_oss_get_volume1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
unsigned int numid,
int *left, int *right,
int route)
{ … }
static int snd_mixer_oss_get_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *left, int *right)
{ … }
static void snd_mixer_oss_put_volume1_vol(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
unsigned int numid,
int left, int right)
{ … }
static void snd_mixer_oss_put_volume1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
unsigned int numid,
int left, int right,
int route)
{ … }
static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int left, int right)
{ … }
static int snd_mixer_oss_get_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *active)
{ … }
static int snd_mixer_oss_get_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *active)
{ … }
static int snd_mixer_oss_put_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int active)
{ … }
static int snd_mixer_oss_put_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int active)
{ … }
static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned int *active_index)
{ … }
static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned int active_index)
{ … }
struct snd_mixer_oss_assign_table { … };
static int snd_mixer_oss_build_test(struct snd_mixer_oss *mixer, struct slot *slot, const char *name, int index, int item)
{ … }
static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn)
{ … }
static void mixer_slot_clear(struct snd_mixer_oss_slot *rslot)
{ … }
static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer,
const struct snd_mixer_oss_assign_table *ptr,
struct slot *slot)
{ … }
static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer,
const struct snd_mixer_oss_assign_table *ptr,
int ptr_allocated, int replace_old)
{ … }
#ifdef CONFIG_SND_PROC_FS
#define MIXER_VOL(name) …
static const char * const oss_mixer_names[SNDRV_OSS_MAX_MIXERS] = …;
static void snd_mixer_oss_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ … }
static void snd_mixer_oss_proc_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ … }
static void snd_mixer_oss_proc_init(struct snd_mixer_oss *mixer)
{ … }
static void snd_mixer_oss_proc_done(struct snd_mixer_oss *mixer)
{ … }
#else
#define snd_mixer_oss_proc_init …
#define snd_mixer_oss_proc_done …
#endif
static void snd_mixer_oss_build(struct snd_mixer_oss *mixer)
{ … }
static int snd_mixer_oss_free1(void *private)
{ … }
static int snd_mixer_oss_notify_handler(struct snd_card *card, int cmd)
{ … }
static int __init alsa_mixer_oss_init(void)
{ … }
static void __exit alsa_mixer_oss_exit(void)
{ … }
module_init(…) …
module_exit(…)