@@ -20,7 +20,24 @@
void usteer_band_steering_sta_update(struct sta_info *si)
{
- if (si->signal < usteer_snr_to_signal(si->node, config.band_steering_min_snr))
+ if (si->connected == STA_NOT_CONNECTED) {
+ if (si->band_steering.signal_threshold != NO_SIGNAL) {
+ si->band_steering.signal_threshold = NO_SIGNAL;
+ }
+ return;
+ }
+ if (si->connected != STA_NOT_CONNECTED && si->band_steering.signal_threshold == NO_SIGNAL) {
+ si->band_steering.signal_threshold = si->signal;
+ MSG(DEBUG, "band steering station " MAC_ADDR_FMT " (%s) set threshold (signal threshold %u)\n", MAC_ADDR_DATA(si->sta->addr), usteer_node_name(si->node), si->band_steering.signal_threshold);
+ return;
+ }
+
+ /* Adapt signal threshold to actual signal quality */
+ if (si->signal < si->band_steering.signal_threshold) {
+ si->band_steering.signal_threshold--;
+ MSG(DEBUG, "band steering station " MAC_ADDR_FMT " (%s) reduce threshold (signal: %d, signal threshold: %u)\n", MAC_ADDR_DATA(si->sta->addr), usteer_node_name(si->node), si->signal, si->band_steering.signal_threshold);
+ }
+ if (si->signal < usteer_snr_to_signal(si->node, config.band_steering_min_snr) || si->signal < si->band_steering.signal_threshold + config.band_steering_signal_threshold)
si->band_steering.below_snr = true;
}
@@ -101,6 +101,7 @@ void usteer_init_defaults(void)
config.band_steering_interval = 120000;
config.band_steering_min_snr = -60;
+ config.band_steering_signal_threshold = 5;
config.link_measurement_interval = 30000;
@@ -128,6 +128,10 @@ config usteer
# steered to a higher frequency band
#option band_steering_min_snr -60
+ # Difference that the signal must be better compared to signal was on connection to node.
+ # Avoids conflicts between roaming and band-steering policies.
+ # option band_steering_signal_threshold 5
+
# Interval (ms) the device is sent a link-measurement request to help assess
# the bi-directional link quality. Setting the interval to 0 disables link-measurements.
#option link_measurement_interval 30000
@@ -83,9 +83,9 @@ uci_usteer() {
min_connect_snr min_snr min_snr_kick_delay signal_diff_threshold \
initial_connect_delay steer_reject_timeout roam_process_timeout\
roam_kick_delay roam_scan_tries roam_scan_timeout \
- roam_scan_snr roam_scan_interval \
- roam_trigger_snr roam_trigger_interval \
- band_steering_interval band_steering_min_snr link_measurement_interval \
+ roam_scan_snr roam_scan_interval roam_trigger_snr roam_trigger_interval \
+ link_measurement_interval \
+ band_steering_interval band_steering_min_snr band_steering_signal_threshold \
load_kick_threshold load_kick_delay load_kick_min_clients \
load_kick_reason_code
do
@@ -191,6 +191,7 @@ struct usteer_config {
uint32_t band_steering_interval;
int32_t band_steering_min_snr;
+ uint32_t band_steering_signal_threshold;
uint32_t link_measurement_interval;
@@ -265,6 +266,7 @@ struct sta_info {
struct {
bool below_snr;
+ int signal_threshold;
} band_steering;
uint64_t kick_time;
Avoid ping-pong between bands by adding a dynamic signal threshold. If 5Ghz band is below roaming threshold (e.g. -70) and 2,4Ghz over band-steering threshold (e.g. -50) this adds a dynamic threshold depends on the signal level when station has connected. It adapts to worser signal slowly. - band_steering: added dynamic signal threshold - main: added config option Signed-off-by: Nils Hendrik Rottgardt <n.rottgardt@gmail.com> --- band_steering.c | 19 ++++++++++++++++++- main.c | 1 + openwrt/usteer/files/etc/config/usteer | 4 ++++ openwrt/usteer/files/etc/init.d/usteer | 6 +++--- usteer.h | 2 ++ 5 files changed, 28 insertions(+), 4 deletions(-)