ACS: Select current hw_mode based on the selected frequency

After receiving ACS offload results, select the current hw_mode based on
the frequency selected by the ACS algorithm. The current hw_mode will be
further used during other validation steps such as HT capability
validations, DFS validation, etc.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Ankita Bajaj 2019-11-27 19:55:49 +05:30 committed by Jouni Malinen
parent bb781c763f
commit 59e33b4a98

View file

@ -944,12 +944,20 @@ void hostapd_acs_channel_selected(struct hostapd_data *hapd,
return; return;
} }
hapd->iface->freq = acs_res->pri_freq;
if (!hapd->iface->current_mode) { if (!hapd->iface->current_mode) {
for (i = 0; i < hapd->iface->num_hw_features; i++) { for (i = 0; i < hapd->iface->num_hw_features; i++) {
struct hostapd_hw_modes *mode = struct hostapd_hw_modes *mode =
&hapd->iface->hw_features[i]; &hapd->iface->hw_features[i];
if (mode->mode == acs_res->hw_mode) { if (mode->mode == acs_res->hw_mode) {
if (hapd->iface->freq > 0 &&
!hw_get_chan(mode->mode,
hapd->iface->freq,
hapd->iface->hw_features,
hapd->iface->num_hw_features))
continue;
hapd->iface->current_mode = mode; hapd->iface->current_mode = mode;
break; break;
} }
@ -963,8 +971,6 @@ void hostapd_acs_channel_selected(struct hostapd_data *hapd,
} }
} }
hapd->iface->freq = acs_res->pri_freq;
if (!acs_res->pri_freq) { if (!acs_res->pri_freq) {
hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_WARNING, HOSTAPD_LEVEL_WARNING,