diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-04-26 11:39:13 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-04-26 11:39:13 +0000 |
commit | 159f45d1356ce898eda243994d0a0989cc983403 (patch) | |
tree | 0a0ccfc8008011a2899268fec379b7b1b6653547 | |
parent | 758e42301cb5a4b86f22da98f2dcd74de0c32aa4 (diff) | |
download | FreeBSD-src-159f45d1356ce898eda243994d0a0989cc983403.zip FreeBSD-src-159f45d1356ce898eda243994d0a0989cc983403.tar.gz |
Allow DSP basename cloning to be disabled or enabled at boot and
runtime. This is useful when implementing OSS sound stacks in
userspace via libcuse for example.
MFC after: 2 weeks
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 68204ff..5b92963 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -48,6 +48,11 @@ SYSCTL_INT(_hw_snd, OID_AUTO, compat_linux_mmap, CTLFLAG_RWTUN, &dsp_mmap_allow_prot_exec, 0, "linux mmap compatibility (-1=force disable 0=auto 1=force enable)"); +static int dsp_basename_clone = 1; +SYSCTL_INT(_hw_snd, OID_AUTO, basename_clone, CTLFLAG_RWTUN, + &dsp_basename_clone, 0, + "DSP basename cloning (0: Disable; 1: Enabled)"); + struct dsp_cdevinfo { struct pcm_channel *rdch, *wrch; struct pcm_channel *volch; @@ -2357,9 +2362,10 @@ dsp_clone(void *arg, devname = devcmp; devhw = dsp_cdevs[i].hw; devcmax = dsp_cdevs[i].max - 1; - if (strcmp(name, devcmp) == 0) - unit = snd_unit; - else if (dsp_stdclone(name, devcmp, devsep, + if (strcmp(name, devcmp) == 0) { + if (dsp_basename_clone != 0) + unit = snd_unit; + } else if (dsp_stdclone(name, devcmp, devsep, dsp_cdevs[i].use_sep, &unit, &cunit) != 0) { unit = -1; cunit = -1; |