opnsense-src/sys/conf
Christos Margiolis ad677fb457 sound: Retire unit.*
The unit.* code is largely obsolete and imposes limits that are no
longer needed nowadays.

- Capping the maximum allowed soundcards in a given machine. By default,
  the limit is 512 (snd_max_u() in unit.c), and the maximum possible is
  2048 (SND_UNIT_UMAX in unit.h). It can also be tuned through the
  hw.snd.maxunit loader(8) tunable. Even though these limits are large
  enough that they should never cause problems, there is no need for
  this limit to exist in the first place.
- Capping the available device/channel types. By default, this is 32
  (snd_max_d() in unit.c). However, these types are pre-defined in
  pcm/sound.h (see SND_DEV_*), so the cap is unnecessary when we know
  that their number is constant.
- Capping the number of channels per-device. By default, the limit 1024
  (snd_max_c() in unit.c). This is probably the most problematic of the
  limits mentioned, because this limit can never be reached, as the
  maximum is hard-capped at either hw.snd.maxautovchans (16 by default),
  or SND_MAXHWCHAN and SND_MAXVCHANS.

These limtits are encoded in masks (see SND_U_MASK, SND_D_MASK,
SND_C_MASK in unit.h) and are used to construct a bitfield of the form
[dsp_unit, type, channel_unit] in snd_mkunit() which is assigned to
pcm_channel->unit.

This patch gets rid of everything unit.*-related and makes a slightly
different use of the "unit" field to only contain the channel unit
number. The channel type is stored in a new pcm_channel->type field, and
the DSP unit number need not be stored at all, since we can fetch it
from device_get_unit(pcm_channel->dev). This change has the effect that
we no longer need to impose caps on the number of soundcards,
device/channel types and per-device channels. As a result the code is
noticeably simplified and more readable.

Apart from the fact that the hw.snd.maxunit loader(8) tunable is also
retired as a side-effect of this patch, sound(4)'s behavior remains the
same.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D44912

(cherry picked from commit 25723d66369fe6786e9e4f5f77381b944755f267)
2024-05-17 21:30:25 +02:00
..
config.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
dtb.build.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
dtb.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
files sound: Retire unit.* 2024-05-17 21:30:25 +02:00
files.amd64 ice_ddp: Update package to 1.3.36.0 2024-04-24 15:14:48 -07:00
files.arm ossl: Move arm_arch.h to a common subdirectory 2024-03-29 09:53:05 -04:00
files.arm64 ice_ddp: Update package to 1.3.36.0 2024-04-24 15:14:48 -07:00
files.i386 sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
files.powerpc ice_ddp: Update package to 1.3.36.0 2024-04-24 15:14:48 -07:00
files.riscv riscv: Introduce support for APLIC interrupt controller 2024-04-18 15:09:02 -03:00
files.x86 Add atopcase, the Apple HID over SPI input driver 2023-08-20 12:53:32 +03:00
kern.mk sys: Disable -Walloc-size-larger-than for GCC 9+ 2024-01-03 09:43:48 -08:00
kern.opts.mk Enable kernel reproducible builds on stable branch 2024-05-03 15:22:16 -07:00
kern.post.mk Add the BBR and RACK stacks to the LINT kernel. 2024-01-16 10:32:07 -08:00
kern.pre.mk Fix GENERIC-KASAN kernel build for amd64 2024-04-20 12:03:25 +02:00
kmod.mk Make kldxref a bootstrap tool and use unconditionally 2024-01-18 14:30:06 -08:00
kmod.opts.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
kmod_syms.awk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
kmod_syms_prefix.awk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
ldscript.amd64 sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.arm sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.arm64 sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.i386 sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.kmod.amd64 sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ldscript.kmod.i386 sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ldscript.powerpc sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.powerpc64 sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.powerpc64le sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.powerpcspe sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ldscript.riscv sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
Makefile.amd64 sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
Makefile.arm sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
Makefile.arm64 sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
Makefile.i386 sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
Makefile.powerpc sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
Makefile.riscv sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
newvers.sh Post-14.1-branch updates 2024-05-02 23:16:57 -07:00
NOTES NOTES: Remove a double word in comment 2024-04-23 07:24:09 +02:00
options ath(4): always enable 11n 2024-04-01 23:46:10 +00:00
options.amd64 sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
options.arm sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
options.arm64 sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
options.i386 sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
options.powerpc sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
options.riscv sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
std.nodebug std.nodebug: remove DIAGNOSTIC from debug configs 2023-08-18 16:39:22 +03:00
sysent.mk sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
systags.sh sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
vdso_amd64.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
vdso_amd64_ia32.ldscript spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
WITHOUT_SOURCELESS sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
WITHOUT_SOURCELESS_HOST sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
WITHOUT_SOURCELESS_UCODE sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00