From 04f667fcdde158c1baf8d99516c96d21b878b919 Mon Sep 17 00:00:00 2001 From: Vasanthakumar Thiagarajan Date: Fri, 12 May 2017 13:18:01 +0530 Subject: [PATCH] DFS: Allow switch to DFS channel after radar detection in ETSI This is to comply with uniform spreading requirement for ETSI domain (section 4.7.2.7 in EN 301 893 - V1.8.1). ETSI uniform spreading requires equal probability for the usable channels. The previous channel selection logic after a radar detection did not fully comply with the uniform spreading requirement for the domain by ignoring DFS channels. Consider DFS channels also during channel selection when the current DFS domain is ETSI. Signed-off-by: Vasanthakumar Thiagarajan --- src/ap/dfs.c | 7 +++++++ src/ap/hostapd.h | 2 ++ src/ap/hw_features.c | 1 + 3 files changed, 10 insertions(+) diff --git a/src/ap/dfs.c b/src/ap/dfs.c index 295720100..5a0d7814b 100644 --- a/src/ap/dfs.c +++ b/src/ap/dfs.c @@ -889,6 +889,13 @@ static int hostapd_dfs_start_channel_switch(struct hostapd_iface *iface) if (iface->cac_started) return hostapd_dfs_start_channel_switch_cac(iface); + /* + * Allow selection of DFS channel in ETSI to comply with + * uniform spreading. + */ + if (iface->dfs_domain == HOSTAPD_DFS_REGION_ETSI) + skip_radar = 0; + /* Perform channel switch/CSA */ channel = dfs_get_valid_channel(iface, &secondary_channel, &vht_oper_centr_freq_seg0_idx, diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index e7c65f7bb..88749338f 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -475,6 +475,8 @@ struct hostapd_iface { struct dl_list sta_seen; /* struct hostapd_sta_info */ unsigned int num_sta_seen; + + u8 dfs_domain; }; /* hostapd.c */ diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index da7c3f637..a53fd2341 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -93,6 +93,7 @@ int hostapd_get_hw_features(struct hostapd_iface *iface) } iface->hw_flags = flags; + iface->dfs_domain = dfs_domain; hostapd_free_hw_features(iface->hw_features, iface->num_hw_features); iface->hw_features = modes;