summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2000-04-26 20:06:52 +0000
committercg <cg@FreeBSD.org>2000-04-26 20:06:52 +0000
commita0363301237e7450b90e5d8fe9242958c75bd43d (patch)
tree0ae1c8de6ea12dcc96f7b0f5762f262e5e9a889b /sys
parent25830f96c969868f7d279a9692e33dc4ef8368a2 (diff)
downloadFreeBSD-src-a0363301237e7450b90e5d8fe9242958c75bd43d.zip
FreeBSD-src-a0363301237e7450b90e5d8fe9242958c75bd43d.tar.gz
fix minor numbers for multi-channel devices
Submitted by: Alexander Matey <matey@cis.ohio-state.edu>
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sound/pcm/sound.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index f0037fe..05fde82 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 @@ nomenclature:
/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;
OpenPOWER on IntegriCloud