Commit 5cbc95a7 authored by Eliad Peller's avatar Eliad Peller Committed by Johannes Berg

mac80211: remove local->radar_detect_enabled

local->radar_detect_enabled should tell whether
radar_detect is enabled on any interface belonging
to local.

However, it's not getting updated correctly
in many cases (actually, when testing with hwsim
it's never been set, even when the dfs master
is beaconing).

Instead of handling all the corner cases
(e.g. channel switch), simply check whether
radar detection is enabled only when needed,
instead of caching the result.
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 50075892
...@@ -2557,7 +2557,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local, ...@@ -2557,7 +2557,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
/* if there's one pending or we're scanning, queue this one */ /* if there's one pending or we're scanning, queue this one */
if (!list_empty(&local->roc_list) || if (!list_empty(&local->roc_list) ||
local->scanning || local->radar_detect_enabled) local->scanning || ieee80211_is_radar_required(local))
goto out_check_combine; goto out_check_combine;
/* if not HW assist, just queue & schedule work */ /* if not HW assist, just queue & schedule work */
......
...@@ -388,7 +388,7 @@ ieee80211_find_chanctx(struct ieee80211_local *local, ...@@ -388,7 +388,7 @@ ieee80211_find_chanctx(struct ieee80211_local *local,
return NULL; return NULL;
} }
static bool ieee80211_is_radar_required(struct ieee80211_local *local) bool ieee80211_is_radar_required(struct ieee80211_local *local)
{ {
struct ieee80211_sub_if_data *sdata; struct ieee80211_sub_if_data *sdata;
...@@ -567,7 +567,7 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, ...@@ -567,7 +567,7 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
bool radar_enabled; bool radar_enabled;
lockdep_assert_held(&local->chanctx_mtx); lockdep_assert_held(&local->chanctx_mtx);
/* for setting local->radar_detect_enabled */ /* for ieee80211_is_radar_required */
lockdep_assert_held(&local->mtx); lockdep_assert_held(&local->mtx);
radar_enabled = ieee80211_is_radar_required(local); radar_enabled = ieee80211_is_radar_required(local);
...@@ -576,7 +576,6 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, ...@@ -576,7 +576,6 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
return; return;
chanctx->conf.radar_enabled = radar_enabled; chanctx->conf.radar_enabled = radar_enabled;
local->radar_detect_enabled = chanctx->conf.radar_enabled;
if (!local->use_chanctx) { if (!local->use_chanctx) {
local->hw.conf.radar_enabled = chanctx->conf.radar_enabled; local->hw.conf.radar_enabled = chanctx->conf.radar_enabled;
......
...@@ -1168,8 +1168,6 @@ struct ieee80211_local { ...@@ -1168,8 +1168,6 @@ struct ieee80211_local {
/* wowlan is enabled -- don't reconfig on resume */ /* wowlan is enabled -- don't reconfig on resume */
bool wowlan; bool wowlan;
/* DFS/radar detection is enabled */
bool radar_detect_enabled;
struct work_struct radar_detected_work; struct work_struct radar_detected_work;
/* number of RX chains the hardware has */ /* number of RX chains the hardware has */
...@@ -1982,6 +1980,7 @@ void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, ...@@ -1982,6 +1980,7 @@ void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
struct ieee80211_chanctx *chanctx); struct ieee80211_chanctx *chanctx);
void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
struct ieee80211_chanctx *ctx); struct ieee80211_chanctx *ctx);
bool ieee80211_is_radar_required(struct ieee80211_local *local);
void ieee80211_dfs_cac_timer(unsigned long data); void ieee80211_dfs_cac_timer(unsigned long data);
void ieee80211_dfs_cac_timer_work(struct work_struct *work); void ieee80211_dfs_cac_timer_work(struct work_struct *work);
......
...@@ -432,7 +432,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local, ...@@ -432,7 +432,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local,
static bool ieee80211_can_scan(struct ieee80211_local *local, static bool ieee80211_can_scan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata) struct ieee80211_sub_if_data *sdata)
{ {
if (local->radar_detect_enabled) if (ieee80211_is_radar_required(local))
return false; return false;
if (!list_empty(&local->roc_list)) if (!list_empty(&local->roc_list))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment