[PATCH] P2P: Skip 6GHz band directly if 6GHz P2P is disabled

Hector Jiang jianghaitao at zeku.com
Sun Aug 28 20:12:04 PDT 2022


If 6GHz is supported by the device but 6GHz P2P is disabled,
P2P invitation would fail if the GO select an operating channel
which is not the preferred channel.
The root cause is that the 5GHz and 6GHz bands are both
HOSTAPD_MODE_IEEE80211A so the 5GHz channels would be added
twice for the GC's following scanning frequency list. This will
cause the GC's following scanning failed with -EINVAL.

Signed-off-by: Hector Jiang <jianghaitao at zeku.com>
---
 wpa_supplicant/scan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index abd48edb7..871885868 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1374,6 +1374,8 @@ scan:
 		for (i = 0; i < wpa_s->hw.num_modes; i++) {
 			if (wpa_s->hw.modes[i].num_channels == 0)
 				continue;
+			if (is_6ghz_freq(wpa_s->hw.modes[i].channels[0].freq))
+				continue;
 			if (wpa_s->hw.modes[i].mode == HOSTAPD_MODE_IEEE80211G)
 				wpa_add_scan_freqs_list(
 					wpa_s, HOSTAPD_MODE_IEEE80211G,
-- 
2.25.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-P2P-Skip-6GHz-band-directly-if-6GHz-P2P-is-disabled.patch
Type: application/octet-stream
Size: 1237 bytes
Desc: 0001-P2P-Skip-6GHz-band-directly-if-6GHz-P2P-is-disabled.patch
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20220829/590fa082/attachment.obj>


More information about the Hostap mailing list