From dd1863690ad7dca5c049e5e10a23e38538b283a0 Mon Sep 17 00:00:00 2001 From: Cameron Grant Date: Wed, 26 Apr 2000 20:06:52 +0000 Subject: [PATCH] fix minor numbers for multi-channel devices Submitted by: Alexander Matey --- sys/dev/sound/pcm/sound.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index f0037fedcf98..05fde821d2d8 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -59,14 +59,15 @@ static struct cdevsw snd_cdevsw = { /* bmaj */ -1 }; -/* PROPOSAL: +/* +PROPOSAL: each unit needs: status, mixer, dsp, dspW, audio, sequencer, midi-in, seq2, sndproc = 9 devices dspW and audio are deprecated. dsp needs min 64 channels, will give it 256 -minor = (unit << 12) + (dev << 8) + channel -currently minor = (channel << 8) + (unit << 4) + dev +minor = (unit << 20) + (dev << 16) + channel +currently minor = (channel << 16) + (unit << 4) + dev nomenclature: /dev/pcmX/dsp.(0..255) @@ -75,16 +76,13 @@ currently minor = (channel << 8) + (unit << 4) + dev /dev/pcmX/status /dev/pcmX/mixer [etc.] - -currently: -minor = (channel << 8) + (unit << 4) + dev */ #define PCMMINOR(x) (minor(x)) -#define PCMCHAN(x) ((PCMMINOR(x) & 0x0000ff00) >> 8) +#define PCMCHAN(x) ((PCMMINOR(x) & 0x0000ff00) >> 16) #define PCMUNIT(x) ((PCMMINOR(x) & 0x000000f0) >> 4) #define PCMDEV(x) (PCMMINOR(x) & 0x0000000f) -#define PCMMKMINOR(u, d, c) ((((c) & 0xff) << 8) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) +#define PCMMKMINOR(u, d, c) ((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) static devclass_t pcm_devclass;