]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Consider p2p_no_go_freq for GO preferred frequency
authorSreeramya Soratkal <ssramya@codeaurora.org>
Tue, 3 Aug 2021 05:28:44 +0000 (10:58 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 26 Aug 2021 12:46:58 +0000 (15:46 +0300)
Currently while selecting a preferred frequency when no preference is
known, p2p_no_go_freq is not considered for 5 GHz and 60 GHz channels.
This results in starting GO on the channels that are configured not to
allow the local device as GO.

Use wpas_p2p_supported_freq_go api to check if the p2p_no_go_freq
configuration before selecting the preferred frequency for GO.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
wpa_supplicant/p2p_supplicant.c

index 1e70ad6d19a7187c14ded753e69eb146d5c09591..07e1101fc41bcf5aafa65cfae17c147ddd7b9ed9 100644 (file)
@@ -6268,34 +6268,26 @@ static void wpas_p2p_select_go_freq_no_pref(struct wpa_supplicant *wpa_s,
        /* try all channels in operating class 115 */
        for (i = 0; i < 4; i++) {
                params->freq = 5180 + i * 20;
-               if (!wpas_p2p_disallowed_freq(wpa_s->global, params->freq) &&
-                   freq_included(wpa_s, channels, params->freq) &&
-                   p2p_supported_freq(wpa_s->global->p2p, params->freq))
+               if (wpas_p2p_supported_freq_go(wpa_s, channels, params->freq))
                        goto out;
        }
 
        /* try all channels in operating class 124 */
        for (i = 0; i < 4; i++) {
                params->freq = 5745 + i * 20;
-               if (!wpas_p2p_disallowed_freq(wpa_s->global, params->freq) &&
-                   freq_included(wpa_s, channels, params->freq) &&
-                   p2p_supported_freq(wpa_s->global->p2p, params->freq))
+               if (wpas_p2p_supported_freq_go(wpa_s, channels, params->freq))
                        goto out;
        }
 
        /* try social channel class 180 channel 2 */
        params->freq = 58320 + 1 * 2160;
-       if (!wpas_p2p_disallowed_freq(wpa_s->global, params->freq) &&
-           freq_included(wpa_s, channels, params->freq) &&
-           p2p_supported_freq(wpa_s->global->p2p, params->freq))
+       if (wpas_p2p_supported_freq_go(wpa_s, channels, params->freq))
                goto out;
 
        /* try all channels in reg. class 180 */
        for (i = 0; i < 4; i++) {
                params->freq = 58320 + i * 2160;
-               if (!wpas_p2p_disallowed_freq(wpa_s->global, params->freq) &&
-                   freq_included(wpa_s, channels, params->freq) &&
-                   p2p_supported_freq(wpa_s->global->p2p, params->freq))
+               if (wpas_p2p_supported_freq_go(wpa_s, channels, params->freq))
                        goto out;
        }