]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Do not allow 40 MHz co-ex PRI/SEC switch to force MCC
authorJouni Malinen <j@w1.fi>
Sun, 28 Jun 2015 15:14:58 +0000 (18:14 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 28 Jun 2015 15:14:58 +0000 (18:14 +0300)
Do not allow 40 MHz co-ex PRI/SEC switch to force us to change our PRI
channel if we have an existing connection on the selected PRI channel
since doing multi-channel concurrency is likely to cause more harm than
using different PRI/SEC selection in environment with multiple BSSes on
these two channels with mixed 20 MHz or PRI channel selection.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/ap_config.h
src/ap/hw_features.c
wpa_supplicant/ap.c

index c14eeda4bbcc7bc1becacd58f8d79fb2f76752d9..2e7c1380b8c73b926815b3d54b4da0f7ef4610f6 100644 (file)
@@ -619,6 +619,7 @@ struct hostapd_config {
        u16 ht_capab;
        int ieee80211n;
        int secondary_channel;
+       int no_pri_sec_switch;
        int require_ht;
        int obss_interval;
        u32 vht_capab;
index 28324a8ee7cc92927c8a53ea5a447d10d512c282..7cb7e88040ff2842690de986a39f1d2676999949 100644 (file)
@@ -260,8 +260,14 @@ static int ieee80211n_check_40mhz_5g(struct hostapd_iface *iface,
 
        res = check_40mhz_5g(iface->current_mode, scan_res, pri_chan, sec_chan);
 
-       if (res == 2)
-               ieee80211n_switch_pri_sec(iface);
+       if (res == 2) {
+               if (iface->conf->no_pri_sec_switch) {
+                       wpa_printf(MSG_DEBUG,
+                                  "Cannot switch PRI/SEC channels due to local constraint");
+               } else {
+                       ieee80211n_switch_pri_sec(iface);
+               }
+       }
 
        return !!res;
 }
index f3960c5ebf313ec8ac89865c05482a0ca4057332..aaea52428d9b21aebd89b299efd892f33e4fcd06 100644 (file)
@@ -142,6 +142,29 @@ void wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s,
                        }
                }
        }
+
+       if (conf->secondary_channel) {
+               struct wpa_supplicant *iface;
+
+               for (iface = wpa_s->global->ifaces; iface; iface = iface->next)
+               {
+                       if (iface == wpa_s ||
+                           iface->wpa_state < WPA_AUTHENTICATING ||
+                           (int) iface->assoc_freq != ssid->frequency)
+                               continue;
+
+                       /*
+                        * Do not allow 40 MHz co-ex PRI/SEC switch to force us
+                        * to change our PRI channel since we have an existing,
+                        * concurrent connection on that channel and doing
+                        * multi-channel concurrency is likely to cause more
+                        * harm than using different PRI/SEC selection in
+                        * environment with multiple BSSes on these two channels
+                        * with mixed 20 MHz or PRI channel selection.
+                        */
+                       conf->no_pri_sec_switch = 1;
+               }
+       }
 #endif /* CONFIG_IEEE80211N */
 }