remote_update_interval remote_node_timeout\
min_connect_snr min_snr signal_diff_threshold \
initial_connect_delay roam_process_timeout\
- roam_kick_delay roam_scan_tries \
+ roam_kick_delay roam_scan_tries roam_scan_timeout \
roam_scan_snr roam_scan_interval \
roam_trigger_snr roam_trigger_interval \
load_kick_threshold load_kick_delay load_kick_min_clients \
usteer_event(ev);
}
+static void
+usteer_roam_sm_start_scan(struct sta_info *si, struct uevent *ev)
+{
+ /* Start scanning in case we are not timeout-constrained or timeout has expired */
+ if (config.roam_scan_timeout &&
+ current_time > si->roam_scan_timeout_start + config.roam_scan_timeout) {
+ usteer_roam_set_state(si, ROAM_TRIGGER_SCAN, ev);
+ return;
+ }
+
+ /* We are currently in scan timeout / cooldown.
+ * Check if we are in ROAM_TRIGGER_IDLE state and enter this stateif not.
+ */
+ if (si->roam_state == ROAM_TRIGGER_IDLE)
+ return;
+
+ /* Enter idle state */
+ usteer_roam_set_state(si, ROAM_TRIGGER_IDLE, ev);
+}
+
static bool
usteer_roam_trigger_sm(struct sta_info *si)
{
break;
}
- if (config.roam_scan_tries &&
- si->roam_tries >= config.roam_scan_tries) {
- usteer_roam_set_state(si, ROAM_TRIGGER_WAIT_KICK, &ev);
+ if (config.roam_scan_tries && si->roam_tries >= config.roam_scan_tries) {
+ if (!config.roam_scan_timeout) {
+ /* Prepare to kick client */
+ usteer_roam_set_state(si, ROAM_TRIGGER_WAIT_KICK, &ev);
+ } else {
+ /* Kick in scan timeout */
+ si->roam_scan_timeout_start = current_time;
+ usteer_roam_set_state(si, ROAM_TRIGGER_IDLE, &ev);
+ }
break;
}
usteer_ubus_trigger_client_scan(si);
- usteer_roam_set_state(si, ROAM_TRIGGER_SCAN, &ev);
+ usteer_roam_sm_start_scan(si, &ev);
break;
case ROAM_TRIGGER_IDLE:
break;
}
- usteer_roam_set_state(si, ROAM_TRIGGER_SCAN, &ev);
+ usteer_roam_sm_start_scan(si, &ev);
break;
case ROAM_TRIGGER_SCAN_DONE:
/* Check for stale scan results, kick back to SCAN state if necessary */
if (current_time - si->roam_scan_done > 2 * config.roam_scan_interval) {
- usteer_roam_set_state(si, ROAM_TRIGGER_SCAN, &ev);
+ usteer_roam_sm_start_scan(si, &ev);
break;
}
_cfg(U32, roam_process_timeout), \
_cfg(I32, roam_scan_snr), \
_cfg(U32, roam_scan_tries), \
+ _cfg(U32, roam_scan_timeout), \
_cfg(U32, roam_scan_interval), \
_cfg(I32, roam_trigger_snr), \
_cfg(U32, roam_trigger_interval), \