aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2015-09-08 09:46:24 (GMT)
committerJouni Malinen <j@w1.fi>2015-10-03 18:01:49 (GMT)
commit61f121d925e4ff2d2a7827064dfb5e18ec729b18 (patch)
tree568f9f9fe371f9d5b645e8f4476527f6c16f19bd /wpa_supplicant/events.c
parent38d9048fa8d3c4374a53b29bea74b50002b42109 (diff)
downloadhostap-61f121d925e4ff2d2a7827064dfb5e18ec729b18.zip
hostap-61f121d925e4ff2d2a7827064dfb5e18ec729b18.tar.gz
hostap-61f121d925e4ff2d2a7827064dfb5e18ec729b18.tar.bz2
Handle channel switch notification for other interface types
Channel switch notification was handled only for AP/GO interfaces. As the notification can be sent on other interface types as well, extend the handling to handle other interface types. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index f15630c..ea1f142 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3459,20 +3459,23 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
data->rx_from_unknown.wds);
break;
case EVENT_CH_SWITCH:
- if (!data)
- break;
- if (!wpa_s->ap_iface) {
- wpa_dbg(wpa_s, MSG_DEBUG, "AP: Ignore channel switch "
- "event in non-AP mode");
+ if (!data || !wpa_s->current_ssid)
break;
- }
- wpas_ap_ch_switch(wpa_s, data->ch_switch.freq,
- data->ch_switch.ht_enabled,
- data->ch_switch.ch_offset,
- data->ch_switch.ch_width,
- data->ch_switch.cf1,
- data->ch_switch.cf2);
+ wpa_s->assoc_freq = data->ch_switch.freq;
+ wpa_s->current_ssid->frequency = data->ch_switch.freq;
+
+ if (wpa_s->current_ssid->mode == WPAS_MODE_AP ||
+ wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||
+ wpa_s->current_ssid->mode ==
+ WPAS_MODE_P2P_GROUP_FORMATION) {
+ wpas_ap_ch_switch(wpa_s, data->ch_switch.freq,
+ data->ch_switch.ht_enabled,
+ data->ch_switch.ch_offset,
+ data->ch_switch.ch_width,
+ data->ch_switch.cf1,
+ data->ch_switch.cf2);
+ }
wpas_p2p_update_channel_list(wpa_s, WPAS_P2P_CHANNEL_UPDATE_CS);
break;