diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-05-21 07:48:06 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-05-21 07:48:06 +0000 |
commit | 620a331d5f293822cfeae338c1e25e3ae7027965 (patch) | |
tree | 61ac766f1694c7422d61edd8c527d51b9e79187a | |
parent | 103346b78da88f8695c7ee43dbda0ac58e6db432 (diff) | |
download | FreeBSD-src-620a331d5f293822cfeae338c1e25e3ae7027965.zip FreeBSD-src-620a331d5f293822cfeae338c1e25e3ae7027965.tar.gz |
MFC r282017:
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.
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 5195da2..6a5619f 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -48,6 +48,12 @@ SYSCTL_INT(_hw_snd, OID_AUTO, compat_linux_mmap, CTLFLAG_RW, &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)"); +TUNABLE_INT("hw.snd.basename_clone", &dsp_basename_clone); + struct dsp_cdevinfo { struct pcm_channel *rdch, *wrch; struct pcm_channel *volch; @@ -2359,9 +2365,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; |