diff options
author | Sunil Ravi <sunilravi@google.com> | 2021-06-29 11:18:20 -0700 |
---|---|---|
committer | Sunil Ravi <sunilravi@google.com> | 2021-06-29 22:13:21 +0000 |
commit | 236f0f571dbfa79146abe5879c56fe52a99d8564 (patch) | |
tree | c014d88ab84219a2e2d8dd835e9e6346852e2a35 | |
parent | eaaf04ea4ffcfebfba5a187e27a77d2d8a3c8057 (diff) | |
download | wpa_supplicant_8-236f0f571dbfa79146abe5879c56fe52a99d8564.tar.gz |
Update GO operating frequency after interface setup is completed.
Once the GO/AP interface initialization is completed, check
if the operating frequency set in wpa_supplicant group interface structure is
different than the one set in hostapd interface structure associated
with the group interface. If yes, update frequency in wpa_supplicant group interface
and Network configuration to the frequency set in hostapd interface
structure. The frequency set in hostapd interface is the correct/final
frequency supplicant configured in kernel/driver.
This is done because supplicant may switch the initially
requested primary and seconday frequencies to get secondary frequency with no beacons
(To avoid interference or 20/40 coex logic). And the updated frequency
is informed by driver only after the interface setup is completed
through channel switch event - EVENT_CH_SWITCH. But supplicant
update the frequency to applications through P2P_GROUP_STARTED event
which is triggered before EVENT_CH_SWITCH event. To send the correct
frequency to applications the frequency must be updated before sending
P2P_GROUP_STARTED event.
Bug: 191272346
Test: Manual - Verified that GO frequency is updated and reported
correctly to Nearby application.
Change-Id: I70910365b8acebfbefdd853e7a6cd3f9f6ec6a5c
-rw-r--r-- | wpa_supplicant/ap.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index cfefa48d..807e36d0 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -807,12 +807,17 @@ static void wpas_ap_configured_cb(void *ctx) return; } + if (wpa_s->current_ssid) { + int acs = 0; #ifdef CONFIG_ACS - if (wpa_s->current_ssid && wpa_s->current_ssid->acs) { - wpa_s->assoc_freq = wpa_s->ap_iface->freq; - wpa_s->current_ssid->frequency = wpa_s->ap_iface->freq; + acs = wpa_s->current_ssid->acs; +#endif + if (acs || (wpa_s->assoc_freq && wpa_s->ap_iface->freq && + wpa_s->assoc_freq != wpa_s->ap_iface->freq)) { + wpa_s->assoc_freq = wpa_s->ap_iface->freq; + wpa_s->current_ssid->frequency = wpa_s->ap_iface->freq; + } } -#endif /* CONFIG_ACS */ wpa_supplicant_set_state(wpa_s, WPA_COMPLETED); |