Release 4.11 sound/core/info_oss.c
/*
* Information interface for ALSA driver
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/string.h>
#include <linux/export.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/info.h>
#include <linux/utsname.h>
#include <linux/mutex.h>
/*
* OSS compatible part
*/
static DEFINE_MUTEX(strings);
static char *snd_sndstat_strings[SNDRV_CARDS][SNDRV_OSS_INFO_DEV_COUNT];
int snd_oss_info_register(int dev, int num, char *string)
{
char *x;
if (snd_BUG_ON(dev < 0 || dev >= SNDRV_OSS_INFO_DEV_COUNT))
return -ENXIO;
if (snd_BUG_ON(num < 0 || num >= SNDRV_CARDS))
return -ENXIO;
mutex_lock(&strings);
if (string == NULL) {
if ((x = snd_sndstat_strings[num][dev]) != NULL) {
kfree(x);
x = NULL;
}
} else {
x = kstrdup(string, GFP_KERNEL);
if (x == NULL) {
mutex_unlock(&strings);
return -ENOMEM;
}
}
snd_sndstat_strings[num][dev] = x;
mutex_unlock(&strings);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jaroslav Kysela | 111 | 77.62% | 1 | 25.00% |
Takashi Iwai | 28 | 19.58% | 1 | 25.00% |
Ingo Molnar | 3 | 2.10% | 1 | 25.00% |
Paulo Marques | 1 | 0.70% | 1 | 25.00% |
Total | 143 | 100.00% | 4 | 100.00% |
EXPORT_SYMBOL(snd_oss_info_register);
static int snd_sndstat_show_strings(struct snd_info_buffer *buf, char *id, int dev)
{
int idx, ok = -1;
char *str;
snd_iprintf(buf, "\n%s:", id);
mutex_lock(&strings);
for (idx = 0; idx < SNDRV_CARDS; idx++) {
str = snd_sndstat_strings[idx][dev];
if (str) {
if (ok < 0) {
snd_iprintf(buf, "\n");
ok++;
}
snd_iprintf(buf, "%i: %s\n", idx, str);
}
}
mutex_unlock(&strings);
if (ok < 0)
snd_iprintf(buf, " NOT ENABLED IN CONFIG\n");
return ok;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jaroslav Kysela | 123 | 96.85% | 1 | 33.33% |
Takashi Iwai | 2 | 1.57% | 1 | 33.33% |
Ingo Molnar | 2 | 1.57% | 1 | 33.33% |
Total | 127 | 100.00% | 3 | 100.00% |
static void snd_sndstat_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
snd_iprintf(buffer, "Sound Driver:3.8.1a-980706 (ALSA emulation code)\n");
snd_iprintf(buffer, "Kernel: %s %s %s %s %s\n",
init_utsname()->sysname,
init_utsname()->nodename,
init_utsname()->release,
init_utsname()->version,
init_utsname()->machine);
snd_iprintf(buffer, "Config options: 0\n");
snd_iprintf(buffer, "\nInstalled drivers: \n");
snd_iprintf(buffer, "Type 10: ALSA emulation\n");
snd_iprintf(buffer, "\nCard config: \n");
snd_card_info_read_oss(buffer);
snd_sndstat_show_strings(buffer, "Audio devices", SNDRV_OSS_INFO_DEV_AUDIO);
snd_sndstat_show_strings(buffer, "Synth devices", SNDRV_OSS_INFO_DEV_SYNTH);
snd_sndstat_show_strings(buffer, "Midi devices", SNDRV_OSS_INFO_DEV_MIDI);
snd_sndstat_show_strings(buffer, "Timers", SNDRV_OSS_INFO_DEV_TIMERS);
snd_sndstat_show_strings(buffer, "Mixers", SNDRV_OSS_INFO_DEV_MIXERS);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jaroslav Kysela | 114 | 85.71% | 2 | 50.00% |
Serge E. Hallyn | 15 | 11.28% | 1 | 25.00% |
Takashi Iwai | 4 | 3.01% | 1 | 25.00% |
Total | 133 | 100.00% | 4 | 100.00% |
int __init snd_info_minor_register(void)
{
struct snd_info_entry *entry;
memset(snd_sndstat_strings, 0, sizeof(snd_sndstat_strings));
entry = snd_info_create_module_entry(THIS_MODULE, "sndstat",
snd_oss_root);
if (!entry)
return -ENOMEM;
entry->c.text.read = snd_sndstat_proc_read;
return snd_info_register(entry); /* freed in error path */
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jaroslav Kysela | 48 | 77.42% | 2 | 50.00% |
Takashi Iwai | 14 | 22.58% | 2 | 50.00% |
Total | 62 | 100.00% | 4 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jaroslav Kysela | 432 | 83.72% | 5 | 38.46% |
Takashi Iwai | 53 | 10.27% | 4 | 30.77% |
Serge E. Hallyn | 15 | 2.91% | 1 | 7.69% |
Ingo Molnar | 9 | 1.74% | 1 | 7.69% |
Paulo Marques | 4 | 0.78% | 1 | 7.69% |
Paul Gortmaker | 3 | 0.58% | 1 | 7.69% |
Total | 516 | 100.00% | 13 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.