staticint major = CONFIG_SND_MAJOR; int snd_major;
EXPORT_SYMBOL(snd_major);
staticint cards_limit = 1;
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards.");
MODULE_LICENSE("GPL");
module_param(major, int, 0444);
MODULE_PARM_DESC(major, "Major # for sound driver.");
module_param(cards_limit, int, 0444);
MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards.");
MODULE_ALIAS_CHARDEV_MAJOR(CONFIG_SND_MAJOR);
/* this one holds the actual max. card number currently available. *asdefault,it'sidenticalwithcards_limitoption.whenmore *modulesareloadedmanually,thislimitnumberincreases,too.
*/ int snd_ecards_limit;
EXPORT_SYMBOL(snd_ecards_limit);
#ifdef CONFIG_SND_DYNAMIC_MINORS staticint snd_find_free_minor(int type, struct snd_card *card, int dev)
{ int minor;
/* static minors for module auto loading */ if (type == SNDRV_DEVICE_TYPE_SEQUENCER) return SNDRV_MINOR_SEQUENCER; if (type == SNDRV_DEVICE_TYPE_TIMER) return SNDRV_MINOR_TIMER;
for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) { /* skip static minors still used for module auto loading */ if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL) continue; if (minor == SNDRV_MINOR_SEQUENCER ||
minor == SNDRV_MINOR_TIMER) continue; if (!snd_minors[minor]) return minor;
} return -EBUSY;
} #else staticint snd_find_free_minor(int type, struct snd_card *card, int dev)
{ int minor;
switch (type) { case SNDRV_DEVICE_TYPE_SEQUENCER: case SNDRV_DEVICE_TYPE_TIMER:
minor = type; break; case SNDRV_DEVICE_TYPE_CONTROL: if (snd_BUG_ON(!card)) return -EINVAL;
minor = SNDRV_MINOR(card->number, type); break; case SNDRV_DEVICE_TYPE_HWDEP: case SNDRV_DEVICE_TYPE_RAWMIDI: case SNDRV_DEVICE_TYPE_PCM_PLAYBACK: case SNDRV_DEVICE_TYPE_PCM_CAPTURE: case SNDRV_DEVICE_TYPE_COMPRESS: if (snd_BUG_ON(!card)) return -EINVAL;
minor = SNDRV_MINOR(card->number, type + dev); break; default: return -EINVAL;
} if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OS_MINORS)) return -EINVAL; if (snd_minors[minor]) return -EBUSY; return minor;
} #endif
/** *snd_register_device-RegistertheALSAdevicefileforthecard *@type:thedevicetype,SNDRV_DEVICE_TYPE_XXX *@card:thecardinstance *@dev:thedeviceindex *@f_ops:thefileoperations *@private_data:userpointerforf_ops->open() *@device:thedevicetoregister * *RegistersanALSAdevicefileforthegivencard. *Theoperatorshavetobesetinregparameter. * *Return:Zeroifsuccessful,oranegativeerrorcodeonfailure.
*/ int snd_register_device(int type, struct snd_card *card, int dev, conststruct file_operations *f_ops, void *private_data, struct device *device)
{ int minor; int err = 0; struct snd_minor *preg;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.