]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Use only PSC for P2P group in the 6 GHz band
authorQiwei Cai <quic_qcai@quicinc.com>
Wed, 27 Jul 2022 05:20:08 +0000 (13:20 +0800)
committerJouni Malinen <j@w1.fi>
Wed, 14 Sep 2022 20:54:20 +0000 (23:54 +0300)
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 <quic_jouni@quicinc.com>
src/p2p/p2p.h
src/p2p/p2p_i.h
wpa_supplicant/p2p_supplicant.c

index 768fc106e614ca57921c1c33ac8e2f06cfd1ac8b..27bdac3bf51ceb37aa6f7e7e4d371b10d8cf72c1 100644 (file)
@@ -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 */
index 6573783fa69b29f194488f65074c6578afcf9f3a..52f27c8656a893ab67cb2e6be8f95ee737286527 100644 (file)
@@ -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,
index ed2ccc9ca7ca26e3160b1ceb982d94e161c8c261..6a1f882da625c530ca2366fd57f118e890f6c0d6 100644 (file)
@@ -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))