aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pcm
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2014-06-27 16:33:43 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2014-06-27 16:33:43 +0000
commit3da1cf1e88f8448bb10c5f778ab56ff65c7a6938 (patch)
tree522e12e286a7e13608cc5ce25965451047b98773 /sys/dev/sound/pcm
parent04006eabea235d9db8c0f7e40af9e441b25638f8 (diff)
downloadsrc-3da1cf1e88f8448bb10c5f778ab56ff65c7a6938.tar.gz
src-3da1cf1e88f8448bb10c5f778ab56ff65c7a6938.zip
Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=267961
Diffstat (limited to 'sys/dev/sound/pcm')
-rw-r--r--sys/dev/sound/pcm/channel.c3
-rw-r--r--sys/dev/sound/pcm/feeder_chain.c3
-rw-r--r--sys/dev/sound/pcm/feeder_eq.c3
-rw-r--r--sys/dev/sound/pcm/feeder_rate.c3
-rw-r--r--sys/dev/sound/pcm/mixer.c3
-rw-r--r--sys/dev/sound/pcm/sound.c3
6 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 75b02d00e311..41fbee2e75ae 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -119,8 +119,7 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, CTLTYPE_INT | CTLFLAG_RW,
#endif
static int chn_vpc_autoreset = 1;
-TUNABLE_INT("hw.snd.vpc_autoreset", &chn_vpc_autoreset);
-SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autoreset, CTLFLAG_RW,
+SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autoreset, CTLFLAG_RWTUN,
&chn_vpc_autoreset, 0, "automatically reset channels volume to 0db");
static int chn_vol_0db_pcm = SND_VOL_0DB_PCM;
diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c
index 92a1cf539024..a647269dba6d 100644
--- a/sys/dev/sound/pcm/feeder_chain.c
+++ b/sys/dev/sound/pcm/feeder_chain.c
@@ -125,8 +125,7 @@ static uint32_t *feeder_chain_formats[FEEDER_CHAIN_LAST] = {
static int feeder_chain_mode = FEEDER_CHAIN_DEFAULT;
#if defined(_KERNEL) && defined(SND_DEBUG) && defined(SND_FEEDER_FULL_MULTIFORMAT)
-TUNABLE_INT("hw.snd.feeder_chain_mode", &feeder_chain_mode);
-SYSCTL_INT(_hw_snd, OID_AUTO, feeder_chain_mode, CTLFLAG_RW,
+SYSCTL_INT(_hw_snd, OID_AUTO, feeder_chain_mode, CTLFLAG_RWTUN,
&feeder_chain_mode, 0,
"feeder chain mode "
"(0=lean, 1=16bit, 2=32bit, 3=multiformat, 4=fullmultiformat)");
diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c
index dee38a386e51..b4a92c986a60 100644
--- a/sys/dev/sound/pcm/feeder_eq.c
+++ b/sys/dev/sound/pcm/feeder_eq.c
@@ -97,8 +97,7 @@ static char feeder_eq_presets[] = FEEDER_EQ_PRESETS;
SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_eq_presets, CTLFLAG_RD,
&feeder_eq_presets, 0, "compile-time eq presets");
-TUNABLE_INT("hw.snd.feeder_eq_exact_rate", &feeder_eq_exact_rate);
-SYSCTL_INT(_hw_snd, OID_AUTO, feeder_eq_exact_rate, CTLFLAG_RW,
+SYSCTL_INT(_hw_snd, OID_AUTO, feeder_eq_exact_rate, CTLFLAG_RWTUN,
&feeder_eq_exact_rate, 0, "force exact rate validation");
#endif
diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c
index cb30dd93149a..d521fd16f1c1 100644
--- a/sys/dev/sound/pcm/feeder_rate.c
+++ b/sys/dev/sound/pcm/feeder_rate.c
@@ -168,8 +168,7 @@ TUNABLE_INT("hw.snd.feeder_rate_max", &feeder_rate_max);
TUNABLE_INT("hw.snd.feeder_rate_round", &feeder_rate_round);
TUNABLE_INT("hw.snd.feeder_rate_quality", &feeder_rate_quality);
-TUNABLE_INT("hw.snd.feeder_rate_polyphase_max", &feeder_rate_polyphase_max);
-SYSCTL_INT(_hw_snd, OID_AUTO, feeder_rate_polyphase_max, CTLFLAG_RW,
+SYSCTL_INT(_hw_snd, OID_AUTO, feeder_rate_polyphase_max, CTLFLAG_RWTUN,
&feeder_rate_polyphase_max, 0, "maximum allowable polyphase entries");
static int
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 8f9a5fb3a7f3..42ddd11bbbb0 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -40,8 +40,7 @@ SND_DECLARE_FILE("$FreeBSD$");
static MALLOC_DEFINE(M_MIXER, "mixer", "mixer");
static int mixer_bypass = 1;
-TUNABLE_INT("hw.snd.vpc_mixer_bypass", &mixer_bypass);
-SYSCTL_INT(_hw_snd, OID_AUTO, vpc_mixer_bypass, CTLFLAG_RW,
+SYSCTL_INT(_hw_snd, OID_AUTO, vpc_mixer_bypass, CTLFLAG_RWTUN,
&mixer_bypass, 0,
"control channel pcm/rec volume, bypassing real mixer device");
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index a7edad5246c7..8b43879470e5 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -52,8 +52,7 @@ int snd_unit = -1;
TUNABLE_INT("hw.snd.default_unit", &snd_unit);
static int snd_unit_auto = -1;
-TUNABLE_INT("hw.snd.default_auto", &snd_unit_auto);
-SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RW,
+SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RWTUN,
&snd_unit_auto, 0, "assign default unit to a newly attached device");
int snd_maxautovchans = 16;