]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DFS: Add support for multi-BSS
authorMichal Kazior <michal.kazior@tieto.com>
Thu, 31 Oct 2013 12:51:44 +0000 (14:51 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 31 Oct 2013 13:12:17 +0000 (15:12 +0200)
If radar was detected single BSS is notified about it. This caused only
that single BSS to be stopped and restarted. However, due to nl80211
interface combinations the BSS was not started on a new channel and
other BSSes remained operating on the old channel.

The downside is that hostapd_disable_iface() causes deauth frames to be
sent. This is undesired but on the other hand it doesn't make sense to
create workarounds that imitate CSA's 'block tx'. For proper Tx
quiescing CSA should be properly implemented.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
src/ap/dfs.c
src/ap/hostapd.c

index 40b3de56f3175648911c3e207b9d3ece7fcd9a36..d6c09a000cfc31a6758e0bb8fe0e687b0d39de3e 100644 (file)
@@ -615,6 +615,10 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_data *hapd)
                                        &vht_oper_centr_freq_seg0_idx,
                                        &vht_oper_centr_freq_seg1_idx);
        if (channel) {
+               wpa_printf(MSG_DEBUG, "DFS will switch to a new channel %d",
+                          channel->chan);
+
+               hapd->iface->freq = channel->freq;
                hapd->iconf->channel = channel->chan;
                hapd->iconf->secondary_channel = secondary_channel;
                hapd->iconf->vht_oper_centr_freq_seg0_idx =
@@ -626,15 +630,24 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_data *hapd)
                wpa_printf(MSG_ERROR, "No valid channel available");
        }
 
-       if (!hapd->cac_started) {
-               wpa_printf(MSG_DEBUG, "DFS radar detected");
-               hapd->driver->stop_ap(hapd->drv_priv);
-       } else {
+       if (hapd->cac_started) {
                wpa_printf(MSG_DEBUG, "DFS radar detected during CAC");
                hapd->cac_started = 0;
+               /* FIXME: Wait for channel(s) to become available if no channel
+                * has been found */
+               hostapd_setup_interface_complete(hapd->iface, err);
+               return err;
+       }
+
+       if (err) {
+               /* FIXME: Wait for channel(s) to become available */
+               hostapd_disable_iface(hapd->iface);
+               return err;
        }
 
-       hostapd_setup_interface_complete(hapd->iface, err);
+       wpa_printf(MSG_DEBUG, "DFS radar detected");
+       hostapd_disable_iface(hapd->iface);
+       hostapd_enable_iface(hapd->iface);
        return 0;
 }
 
index 17bdeb2fc7f564e1f279e491d1b97c5c1bef4dab..26b3e89cd4a2572eef3c2871d01f3e74d0fbe0e5 100644 (file)
@@ -1153,8 +1153,6 @@ void hostapd_interface_free(struct hostapd_iface *iface)
 }
 
 
-#ifdef HOSTAPD
-
 void hostapd_interface_deinit_free(struct hostapd_iface *iface)
 {
        const struct wpa_driver_ops *driver;
@@ -1440,8 +1438,6 @@ int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf)
        return -1;
 }
 
-#endif /* HOSTAPD */
-
 
 /**
  * hostapd_new_assoc_sta - Notify that a new station associated with the AP