]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P GO: Use driver preferred frequency instead of ACS when band is specified
authorKavita Kavita <kkavita@qti.qualcomm.com>
Wed, 7 May 2025 10:08:52 +0000 (15:38 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 23 May 2025 13:04:12 +0000 (16:04 +0300)
ACS was enabled by default when the band is specified as 2 or 5 in the
"freq" parameter for P2P_GROUP_ADD control interface command. Use the
driver preferred frequency list instead of ACS when the driver preferred
frequency list is available. This allows the GO to be started more
quickly.

Signed-off-by: Kavita Kavita <kkavita@qti.qualcomm.com>
wpa_supplicant/ctrl_iface.c

index 3892df99daf9b58744af1959527815a52ade12a7..96737fb2153178b5510d724867ca16fa41d84db4 100644 (file)
@@ -7365,7 +7365,18 @@ static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
 
 #ifdef CONFIG_ACS
        if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) &&
-           (acs || freq == 2 || freq == 5)) {
+           (freq == 2 || freq == 5)) {
+               unsigned int res, size = P2P_MAX_PREF_CHANNELS;
+               struct weighted_pcl pref_freq_list[P2P_MAX_PREF_CHANNELS];
+
+               acs = 1;
+               res = wpa_drv_get_pref_freq_list(wpa_s, WPA_IF_P2P_GO,
+                                                &size, pref_freq_list);
+               if (!res && size > 0)
+                       acs = 0;
+       }
+
+       if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) && acs) {
                if (freq == 2 && wpa_s->best_24_freq <= 0) {
                        wpa_s->p2p_go_acs_band = HOSTAPD_MODE_IEEE80211G;
                        wpa_s->p2p_go_do_acs = 1;