diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-06-27 16:33:43 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-06-27 16:33:43 +0000 |
commit | bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9 (patch) | |
tree | 522e12e286a7e13608cc5ce25965451047b98773 /sys/dev/sound | |
parent | 465e750b1418c7bcbd18c4e34b36120ff51ae0fc (diff) | |
download | FreeBSD-src-bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9.zip FreeBSD-src-bd1ed65f0faa90d56aad3c8fc1b55d874d1548d9.tar.gz |
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
Diffstat (limited to 'sys/dev/sound')
-rw-r--r-- | sys/dev/sound/pcm/channel.c | 3 | ||||
-rw-r--r-- | sys/dev/sound/pcm/feeder_chain.c | 3 | ||||
-rw-r--r-- | sys/dev/sound/pcm/feeder_eq.c | 3 | ||||
-rw-r--r-- | sys/dev/sound/pcm/feeder_rate.c | 3 | ||||
-rw-r--r-- | sys/dev/sound/pcm/mixer.c | 3 | ||||
-rw-r--r-- | sys/dev/sound/pcm/sound.c | 3 | ||||
-rw-r--r-- | sys/dev/sound/usb/uaudio.c | 12 |
7 files changed, 9 insertions, 21 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 75b02d0..41fbee2 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 92a1cf5..a647269 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 dee38a3..b4a92c9 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 cb30dd9..d521fd1 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 8f9a5fb..42ddd11 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 a7edad5..8b43879 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; diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 1af8cb2..6c798cc 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -103,17 +103,11 @@ static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RW, &uaudio_debug, 0, "uaudio debug level"); - -TUNABLE_INT("hw.usb.uaudio.default_rate", &uaudio_default_rate); -SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RWTUN, &uaudio_default_rate, 0, "uaudio default sample rate"); - -TUNABLE_INT("hw.usb.uaudio.default_bits", &uaudio_default_bits); -SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RWTUN, &uaudio_default_bits, 0, "uaudio default sample bits"); - -TUNABLE_INT("hw.usb.uaudio.default_channels", &uaudio_default_channels); -SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RWTUN, &uaudio_default_channels, 0, "uaudio default sample channels"); #endif |