]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ACS: Select current hw_mode based on the selected frequency
authorAnkita Bajaj <bankita@codeaurora.org>
Wed, 27 Nov 2019 14:25:49 +0000 (19:55 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 20 Dec 2019 10:45:03 +0000 (12:45 +0200)
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>
src/ap/drv_callbacks.c

index 49f4a0e36cf7a56404e71a711ebd0224fe0bf4d3..8a4b0ef6aebd9bf8868e9d7344b48459e0b79be1 100644 (file)
@@ -944,12 +944,20 @@ void hostapd_acs_channel_selected(struct hostapd_data *hapd,
                return;
        }
 
+       hapd->iface->freq = acs_res->pri_freq;
+
        if (!hapd->iface->current_mode) {
                for (i = 0; i < hapd->iface->num_hw_features; i++) {
                        struct hostapd_hw_modes *mode =
                                &hapd->iface->hw_features[i];
 
                        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;
                                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) {
                hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
                               HOSTAPD_LEVEL_WARNING,