diff options
author | eivind <eivind@FreeBSD.org> | 1998-04-23 00:06:43 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1998-04-23 00:06:43 +0000 |
commit | 1c00798cb4d98d25579054686b8540a1f4c38463 (patch) | |
tree | 32e9f778134a7ed47c5ae3fa52ed5daa4f97f541 /sys/i386/isa/sound | |
parent | 3135dafcdb738769c4887a245db5c82b7edb7b4b (diff) | |
download | FreeBSD-src-1c00798cb4d98d25579054686b8540a1f4c38463.zip FreeBSD-src-1c00798cb4d98d25579054686b8540a1f4c38463.tar.gz |
Add devfs support.
Submitted by: somebody whose name escapes me :-(
Diffstat (limited to 'sys/i386/isa/sound')
-rw-r--r-- | sys/i386/isa/sound/soundcard.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/sys/i386/isa/sound/soundcard.c b/sys/i386/isa/sound/soundcard.c index cfc8ce5..ffbb8f6 100644 --- a/sys/i386/isa/sound/soundcard.c +++ b/sys/i386/isa/sound/soundcard.c @@ -26,8 +26,12 @@ * SUCH DAMAGE. * */ +#include "opt_devfs.h" #include <i386/isa/sound/sound_config.h> +#ifdef DEVFS +#include <sys/devfsext.h> +#endif /* DEVFS */ #if NSND > 0 /* from "snd.h" */ #include <vm/vm.h> @@ -446,8 +450,34 @@ sndattach(struct isa_device * dev) dev = makedev(CDEV_MAJOR, 0); cdevsw_add(&dev, &snd_cdevsw, NULL); } - - +#ifdef DEVFS + if (dev->id_driver == &opldriver) + devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_SEQ, + DV_CHR, UID_ROOT, GID_WHEEL, 0666, + "sequencer%n", dev->id_unit); + else if (dev->id_driver == &mpudriver || dev->id_driver == &sbmididriver || + dev->id_driver == &uartdriver) + devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_MIDIN, + DV_CHR, UID_ROOT, GID_WHEEL, 0666, + "midi%n", dev->id_unit); + else { + devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP, + DV_CHR, UID_ROOT, GID_WHEEL, 0666, + "dsp%n", dev->id_unit); + devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_DSP16, + DV_CHR, UID_ROOT, GID_WHEEL, 0666, + "dspW%n", dev->id_unit); + devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_AUDIO, + DV_CHR, UID_ROOT, GID_WHEEL, 0666, + "audio%n", dev->id_unit); + devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_CTL, + DV_CHR, UID_ROOT, GID_WHEEL, 0666, + "mixer%n", dev->id_unit); + devfs_add_devswf(&snd_cdevsw, (dev->id_unit << 4) | SND_DEV_STATUS, + DV_CHR, UID_ROOT, GID_WHEEL, 0666, + "sndstat%n", dev->id_unit); + } +#endif /* DEVFS */ return TRUE; } |