}
static struct sta_info *
-find_better_candidate(struct sta_info *si_ref, struct uevent *ev)
+find_better_candidate(struct sta_info *si_ref, struct uevent *ev, uint32_t required_criteria)
{
struct sta_info *si;
struct sta *sta = si_ref->sta;
if (is_better_candidate(si, si_ref))
continue;
+ if (!(reasons & required_criteria))
+ continue;
+
if (ev) {
ev->si_other = si;
ev->select_reasons = reasons;
goto out;
}
- if (!find_better_candidate(si, &ev))
+ if (!find_better_candidate(si, &ev, 0))
goto out;
ev.reason = UEV_REASON_BETTER_CANDIDATE;
if (current_time - si->roam_event < config.roam_scan_interval)
break;
- if (find_better_candidate(si, &ev) ||
+ if (find_better_candidate(si, &ev, (1 << UEV_SELECT_REASON_SIGNAL)) ||
si->roam_scan_done > si->roam_event) {
usteer_roam_set_state(si, ROAM_TRIGGER_SCAN_DONE, &ev);
break;
break;
case ROAM_TRIGGER_IDLE:
- if (find_better_candidate(si, &ev)) {
+ if (find_better_candidate(si, &ev, (1 << UEV_SELECT_REASON_SIGNAL))) {
usteer_roam_set_state(si, ROAM_TRIGGER_SCAN_DONE, &ev);
break;
}
break;
}
- if (find_better_candidate(si, &ev))
+ if (find_better_candidate(si, &ev, (1 << UEV_SELECT_REASON_SIGNAL)))
usteer_roam_set_state(si, ROAM_TRIGGER_WAIT_KICK, &ev);
break;
if (is_more_kickable(kick1, si))
kick1 = si;
- tmp = find_better_candidate(si, NULL);
+ tmp = find_better_candidate(si, NULL, 0);
if (!tmp)
continue;