P2P: Disable pri/sec channel switch for GO with forced frequency

When wpa_supplicant receives a request to start a P2P group owner on a
fixed frequency with bandwidth wider than 20 MHz, wpa_supplicant scans
for neighboring BSSs prior to starting the GO. This is done to switch
the primary/secondary channels if there are any other networks which are
operating on the same secondary channel. Though this logic is defined
for 20/40 MHz coexistence and might improve throughput, there are P2P
use cases where this logic causes problem:

1. The file transfer use case takes time to start the file transfer or
   even fails when the 20/40 coex scan repeatedly fails due to an
   ongoing externally triggered scan happening in the system.
2. wpa_supplicant overrides the channel which is selected by the
   application based on the best channel it derived by looking into
   the channel conditions. This degrades the expected throughput.
3. Latency sensitive applications experience long time to
   start the group owner which gives a bad user experience.

So do not allow 40 MHz co-ex PRI/SEC switch to force a change to
Autonomous GO PRI channel when the P2P group add is called with a forced
frequency.

Test: Tested autonomous GO and confirmed from the logs that
P2P GO is not triggering 20/40 coex scan.

Signed-off-by: Sunil Ravi <sunilravi@google.com>
This commit is contained in:
Sunil Ravi 2022-10-03 00:53:41 +00:00 committed by Jouni Malinen
parent 88a0ab87a2
commit b18d957593
3 changed files with 12 additions and 4 deletions

View file

@ -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; struct wpa_supplicant *iface;
for (iface = wpa_s->global->ifaces; iface; iface = iface->next) for (iface = wpa_s->global->ifaces; iface; iface = iface->next)

View file

@ -6895,6 +6895,7 @@ int wpas_p2p_group_add(struct wpa_supplicant *wpa_s, int persistent_group,
bool allow_6ghz) bool allow_6ghz)
{ {
struct p2p_go_neg_results params; struct p2p_go_neg_results params;
int selected_freq = 0;
if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL) if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
return -1; 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); wpas_p2p_stop_find_oper(wpa_s);
if (!wpa_s->p2p_go_do_acs) { if (!wpa_s->p2p_go_do_acs) {
freq = wpas_p2p_select_go_freq(wpa_s, freq); selected_freq = wpas_p2p_select_go_freq(wpa_s, freq);
if (freq < 0) if (selected_freq < 0)
return -1; return -1;
} }
if (wpas_p2p_init_go_params(wpa_s, &params, freq, vht_center_freq2, if (wpas_p2p_init_go_params(wpa_s, &params, selected_freq,
vht_center_freq2,
ht40, vht, max_oper_chwidth, he, edmg, ht40, vht, max_oper_chwidth, he, edmg,
NULL)) NULL))
return -1; 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); wpa_s = wpas_p2p_get_group_iface(wpa_s, 0, 1);
if (wpa_s == NULL) if (wpa_s == NULL)
return -1; return -1;
if (freq > 0)
wpa_s->p2p_go_no_pri_sec_switch = 1;
wpas_start_wps_go(wpa_s, &params, 0); wpas_start_wps_go(wpa_s, &params, 0);
return 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); freq = wpas_p2p_select_go_freq(wpa_s, force_freq);
if (freq < 0) if (freq < 0)
return -1; return -1;
wpa_s->p2p_go_no_pri_sec_switch = 1;
} else { } else {
freq = wpas_p2p_select_go_freq(wpa_s, neg_freq); freq = wpas_p2p_select_go_freq(wpa_s, neg_freq);
if (freq < 0 || if (freq < 0 ||

View file

@ -1156,6 +1156,7 @@ struct wpa_supplicant {
unsigned int user_initiated_pd:1; unsigned int user_initiated_pd:1;
unsigned int p2p_go_group_formation_completed:1; unsigned int p2p_go_group_formation_completed:1;
unsigned int group_formation_reported:1; unsigned int group_formation_reported:1;
unsigned int p2p_go_no_pri_sec_switch:1;
unsigned int waiting_presence_resp; unsigned int waiting_presence_resp;
int p2p_first_connection_timeout; int p2p_first_connection_timeout;
unsigned int p2p_nfc_tag_enabled:1; unsigned int p2p_nfc_tag_enabled:1;