diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 2d30ce409..ffe98fa8d 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -440,7 +440,9 @@ int wpa_supplicant_conf_ap_ht(struct wpa_supplicant *wpa_s, } } - if (conf->secondary_channel) { + if (wpa_s->p2p_go_no_pri_sec_switch) { + conf->no_pri_sec_switch = 1; + } else if (conf->secondary_channel) { struct wpa_supplicant *iface; for (iface = wpa_s->global->ifaces; iface; iface = iface->next) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 0904d60ef..f8e903362 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -6895,6 +6895,7 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group, bool allow_6ghz) { struct p2p_go_neg_results params; + int selected_freq = 0; if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL) return -1; @@ -6909,12 +6910,13 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group, wpas_p2p_stop_find_oper(wpa_s); if (!wpa_s->p2p_go_do_acs) { - freq = wpas_p2p_select_go_freq(wpa_s, freq); - if (freq < 0) + selected_freq = wpas_p2p_select_go_freq(wpa_s, freq); + if (selected_freq < 0) return -1; } - if (wpas_p2p_init_go_params(wpa_s, ¶ms, freq, vht_center_freq2, + if (wpas_p2p_init_go_params(wpa_s, ¶ms, selected_freq, + vht_center_freq2, ht40, vht, max_oper_chwidth, he, edmg, NULL)) return -1; @@ -6925,6 +6927,8 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group, wpa_s = wpas_p2p_get_group_iface(wpa_s, 0, 1); if (wpa_s == NULL) return -1; + if (freq > 0) + wpa_s->p2p_go_no_pri_sec_switch = 1; wpas_start_wps_go(wpa_s, ¶ms, 0); return 0; @@ -7084,6 +7088,7 @@ int wpas_p2p_group_add_persistent(struct wpa_supplicant *wpa_s, freq = wpas_p2p_select_go_freq(wpa_s, force_freq); if (freq < 0) return -1; + wpa_s->p2p_go_no_pri_sec_switch = 1; } else { freq = wpas_p2p_select_go_freq(wpa_s, neg_freq); if (freq < 0 || diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index 6cacfe485..c169dce67 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -1156,6 +1156,7 @@ struct wpa_supplicant { unsigned int user_initiated_pd:1; unsigned int p2p_go_group_formation_completed:1; unsigned int group_formation_reported:1; + unsigned int p2p_go_no_pri_sec_switch:1; unsigned int waiting_presence_resp; int p2p_first_connection_timeout; unsigned int p2p_nfc_tag_enabled:1;