]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Allow P2P CSA from 5 GHz to 2.4 GHz band
authorSunil <sunilravi@google.com>
Tue, 19 Jul 2022 22:04:39 +0000 (22:04 +0000)
committerJouni Malinen <j@w1.fi>
Thu, 22 Sep 2022 21:29:24 +0000 (00:29 +0300)
IEEE Std 802.11-2020, 11.8.8 (Selecting and advertising a new channel)
doesn't restrict switching to a channel which is not in the same band as
the current band. But at the same time, there are some issues in
switching between the 2.4/5 GHz bands and the 6 GHz band. So limit the
check to consider the critical use case of switching from a 5 GHz channel
to a 2.4 GHz channel.

Signed-off-by: Sunil Ravi <sunilravi@google.com>
wpa_supplicant/p2p_supplicant.c

index cb78a30d9096ff1f0f79ea756968babb61c7f323..f6252b1aaa53fe4b1f2a5ac970038823adc96479 100644 (file)
@@ -9667,9 +9667,15 @@ static int wpas_p2p_move_go_csa(struct wpa_supplicant *wpa_s)
                goto out;
        }
 
-       if (conf->hw_mode != wpa_s->ap_iface->current_mode->mode) {
-               wpa_dbg(wpa_s, MSG_DEBUG,
-                       "P2P CSA: CSA to a different band is not supported");
+       if (conf->hw_mode != wpa_s->ap_iface->current_mode->mode &&
+           (wpa_s->ap_iface->current_mode->mode != HOSTAPD_MODE_IEEE80211A ||
+            is_6ghz_freq(wpa_s->ap_iface->freq) ||
+            conf->hw_mode != HOSTAPD_MODE_IEEE80211G)) {
+               wpa_dbg(wpa_s, MSG_INFO,
+                       "P2P CSA: CSA from hardware mode %d%s to %d is not supported",
+                       wpa_s->ap_iface->current_mode->mode,
+                       is_6ghz_freq(wpa_s->ap_iface->freq) ? " (6 GHz)" : "",
+                       conf->hw_mode);
                ret = -1;
                goto out;
        }