Allow P2P CSA from 5GHz to 2.4GHz band
IEEE80211-2020 specification section 11.8.8 doesn't
restrict switching to a channel which is not in the
same band as 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 5GHz channel to
2.4GHz channel.
Bug: 207671411
Test: Manual - Establish WFD connection in 5GHz. Update the regulatory
information by marking all the 5GHz channels as NO_IR. Verified
that P2P GO is able to move to 2.4GHz channel
Change-Id: I50ed32d7e11e6e0d2e6d56b34ce3b325fd1956f2
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index c8f2e5c..3c395e9 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -9730,9 +9730,12 @@
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 ||
+ conf->hw_mode != HOSTAPD_MODE_IEEE80211G)) {
+ wpa_dbg(wpa_s, MSG_INFO,
+ "P2P CSA: CSA from Hardware mode %d to %d is not supported",
+ wpa_s->ap_iface->current_mode->mode, conf->hw_mode);
ret = -1;
goto out;
}