]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Allow wpa_supplicant AP mode to use non-offloaded DFS
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 5 Mar 2015 14:20:03 +0000 (16:20 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 5 Mar 2015 15:25:13 +0000 (17:25 +0200)
This extends the hostapd-like setup of DFS-in-userspace for
wpa_supplicant AP mode operations.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c
wpa_supplicant/ap.c

index 2dce242a3170ff34a08a4e68e460f50f0c86a832..2a2ef6f186279d60f0da899e4d34263fd2ac3736 100644 (file)
@@ -4301,7 +4301,8 @@ static int wpa_driver_nl80211_ap(struct wpa_driver_nl80211_data *drv,
                return -1;
        }
 
-       if (nl80211_set_channel(drv->first_bss, &params->freq, 0)) {
+       if (params->freq.freq &&
+           nl80211_set_channel(drv->first_bss, &params->freq, 0)) {
                if (old_mode != nlmode)
                        wpa_driver_nl80211_set_mode(drv->first_bss, old_mode);
                nl80211_remove_monitor_interface(drv);
index 5950207b95cbb8792bab5caf44af0e1706ee05bf..ea5b2b4daee2d29b26f317b8b45aa8358c259ab3 100644 (file)
@@ -166,6 +166,13 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
 
        wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf);
 
+       if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) {
+               conf->ieee80211h = 1;
+               conf->ieee80211d = 1;
+               conf->country[0] = wpa_s->conf->country[0];
+               conf->country[1] = wpa_s->conf->country[1];
+       }
+
 #ifdef CONFIG_P2P
        if (conf->hw_mode == HOSTAPD_MODE_IEEE80211G &&
            (ssid->mode == WPAS_MODE_P2P_GO ||
@@ -567,6 +574,9 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
        else
                params.uapsd = -1;
 
+       if (ieee80211_is_dfs(params.freq.freq))
+               params.freq.freq = 0; /* set channel after CAC */
+
        if (wpa_drv_associate(wpa_s, &params) < 0) {
                wpa_msg(wpa_s, MSG_INFO, "Failed to start AP functionality");
                return -1;