From 62612dfc1abaac91c461d3e07e3565b144faf1c4 Mon Sep 17 00:00:00 2001 From: Qiwei Cai Date: Wed, 27 Jul 2022 13:20:08 +0800 Subject: [PATCH] P2P: Use only PSC for P2P group in the 6 GHz band P2P connections in the 6 GHz band should be limited to preferred scanning channels since AP/GO discovery cannot depend on 2.4/5 GHz discovery. Signed-off-by: Jouni Malinen --- src/p2p/p2p.h | 1 + src/p2p/p2p_i.h | 1 - wpa_supplicant/p2p_supplicant.c | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 768fc106e..27bdac3bf 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -2428,5 +2428,6 @@ bool p2p_wfd_enabled(struct p2p_data *p2p); bool is_p2p_allow_6ghz(struct p2p_data *p2p); void set_p2p_allow_6ghz(struct p2p_data *p2p, bool value); int p2p_remove_6ghz_channels(struct weighted_pcl *pref_freq_list, int size); +int p2p_channel_to_freq(int op_class, int channel); #endif /* P2P_H */ diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h index 6573783fa..52f27c865 100644 --- a/src/p2p/p2p_i.h +++ b/src/p2p/p2p_i.h @@ -680,7 +680,6 @@ struct p2p_group_info { /* p2p_utils.c */ int p2p_random(char *buf, size_t len); -int p2p_channel_to_freq(int op_class, int channel); int p2p_freq_to_channel(unsigned int freq, u8 *op_class, u8 *channel); void p2p_channels_intersect(const struct p2p_channels *a, const struct p2p_channels *b, diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index ed2ccc9ca..6a1f882da 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3802,6 +3802,10 @@ static enum chan_allowed wpas_p2p_verify_channel(struct wpa_supplicant *wpa_s, int flag = 0; enum chan_allowed res, res2; + if (is_6ghz_op_class(op_class) && !is_6ghz_psc_frequency( + p2p_channel_to_freq(op_class, channel))) + return NOT_ALLOWED; + res2 = res = has_channel(wpa_s->global, mode, op_class, channel, &flag); if (bw == BW40MINUS) { if (!(flag & HOSTAPD_CHAN_HT40MINUS))