From 078217a2d7007d7948d0ed728a18d30e6e92d3c9 Mon Sep 17 00:00:00 2001 From: Sergey Matyukevich Date: Fri, 27 Dec 2019 15:22:24 +0300 Subject: [PATCH] STA OBSS: Update secondary channel info after CSA Field wpa_s->sme.ht_sec_chan keeps secondary channel for the 40 MHz band. This field is used to prepare a list of channels for the STA OBSS scan. Initially, the secondary channel is set to HT_SEC_CHAN_UNKNOWN. Later on, in function wpa_obss_scan_freq_list() it is obtained from the current BSS HT operation IE. However, the secondary channel information is not updated after channel switch, which may lead to an incorrect list of channels prepared for the STA OBSS scan. Update ht_sec_chan according to the channel switch event data to fix this. Signed-off-by: Sergey Matyukevich --- wpa_supplicant/events.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index f034e5040..2bf35cb58 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -4564,6 +4564,20 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, wpa_s->assoc_freq = data->ch_switch.freq; wpa_s->current_ssid->frequency = data->ch_switch.freq; +#ifdef CONFIG_SME + switch (data->ch_switch.ch_offset) { + case 1: + wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_ABOVE; + break; + case -1: + wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_BELOW; + break; + default: + wpa_s->sme.ht_sec_chan = HT_SEC_CHAN_UNKNOWN; + break; + } +#endif /* CONFIG_SME */ + #ifdef CONFIG_AP if (wpa_s->current_ssid->mode == WPAS_MODE_AP || wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||