From 5d55371b2193774979b90a3d09e8a2e0572a8162 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 16 May 2017 11:23:10 +0200 Subject: mac80211: mesh: mark channel as unusable if a regulatory MESH CSA is received In the Mesh Channel Switch Parameters (8.4.2.105) the reason is specified to WLAN_REASON_MESH_CHAN_REGULATORY in the case that a regulatory limitation was the cause for the switch. This means another station detected a radar event. Mark the channel as unusable if this happens. Signed-off-by: Benjamin Berg [sw: style cleanup, rebase] Signed-off-by: Simon Wunderlich Signed-off-by: Johannes Berg --- net/mac80211/spectmgmt.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net/mac80211/spectmgmt.c') diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c index 0782e486fe89..d2ea0017c79d 100644 --- a/net/mac80211/spectmgmt.c +++ b/net/mac80211/spectmgmt.c @@ -76,6 +76,11 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata, csa_ie->mode = elems->mesh_chansw_params_ie->mesh_flags; csa_ie->pre_value = le16_to_cpu( elems->mesh_chansw_params_ie->mesh_pre_value); + + if (elems->mesh_chansw_params_ie->mesh_flags & + WLAN_EID_CHAN_SWITCH_PARAM_REASON) + csa_ie->reason_code = le16_to_cpu( + elems->mesh_chansw_params_ie->mesh_reason); } new_freq = ieee80211_channel_to_frequency(new_chan_no, new_band); -- cgit v1.2.3