aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-01-07 10:50:09 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-14 03:37:06 -0500
commit5cbc95a749c5f3b238af0953881edede9bfe5bf6 (patch)
tree4bd05d244a56723b38bfafcba8eed0875249027e
parent50075892ba30c4c19c41235b5308ee5a1e2125d7 (diff)
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: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/cfg.c2
-rw-r--r--net/mac80211/chan.c5
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/scan.c2
4 files changed, 5 insertions, 7 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9ccecb405ede..fd6860d7f557 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2557,7 +2557,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
2557 2557
2558 /* if there's one pending or we're scanning, queue this one */ 2558 /* if there's one pending or we're scanning, queue this one */
2559 if (!list_empty(&local->roc_list) || 2559 if (!list_empty(&local->roc_list) ||
2560 local->scanning || local->radar_detect_enabled) 2560 local->scanning || ieee80211_is_radar_required(local))
2561 goto out_check_combine; 2561 goto out_check_combine;
2562 2562
2563 /* if not HW assist, just queue & schedule work */ 2563 /* if not HW assist, just queue & schedule work */
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index da1c12c34487..92c721dbd5af 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -388,7 +388,7 @@ ieee80211_find_chanctx(struct ieee80211_local *local,
388 return NULL; 388 return NULL;
389} 389}
390 390
391static bool ieee80211_is_radar_required(struct ieee80211_local *local) 391bool ieee80211_is_radar_required(struct ieee80211_local *local)
392{ 392{
393 struct ieee80211_sub_if_data *sdata; 393 struct ieee80211_sub_if_data *sdata;
394 394
@@ -567,7 +567,7 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
567 bool radar_enabled; 567 bool radar_enabled;
568 568
569 lockdep_assert_held(&local->chanctx_mtx); 569 lockdep_assert_held(&local->chanctx_mtx);
570 /* for setting local->radar_detect_enabled */ 570 /* for ieee80211_is_radar_required */
571 lockdep_assert_held(&local->mtx); 571 lockdep_assert_held(&local->mtx);
572 572
573 radar_enabled = ieee80211_is_radar_required(local); 573 radar_enabled = ieee80211_is_radar_required(local);
@@ -576,7 +576,6 @@ static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
576 return; 576 return;
577 577
578 chanctx->conf.radar_enabled = radar_enabled; 578 chanctx->conf.radar_enabled = radar_enabled;
579 local->radar_detect_enabled = chanctx->conf.radar_enabled;
580 579
581 if (!local->use_chanctx) { 580 if (!local->use_chanctx) {
582 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled; 581 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 91878ef5069a..156ea79e0157 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1168,8 +1168,6 @@ struct ieee80211_local {
1168 /* wowlan is enabled -- don't reconfig on resume */ 1168 /* wowlan is enabled -- don't reconfig on resume */
1169 bool wowlan; 1169 bool wowlan;
1170 1170
1171 /* DFS/radar detection is enabled */
1172 bool radar_detect_enabled;
1173 struct work_struct radar_detected_work; 1171 struct work_struct radar_detected_work;
1174 1172
1175 /* number of RX chains the hardware has */ 1173 /* number of RX chains the hardware has */
@@ -1982,6 +1980,7 @@ void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
1982 struct ieee80211_chanctx *chanctx); 1980 struct ieee80211_chanctx *chanctx);
1983void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, 1981void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
1984 struct ieee80211_chanctx *ctx); 1982 struct ieee80211_chanctx *ctx);
1983bool ieee80211_is_radar_required(struct ieee80211_local *local);
1985 1984
1986void ieee80211_dfs_cac_timer(unsigned long data); 1985void ieee80211_dfs_cac_timer(unsigned long data);
1987void ieee80211_dfs_cac_timer_work(struct work_struct *work); 1986void ieee80211_dfs_cac_timer_work(struct work_struct *work);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 844fb5f7910e..b0320bb20ab8 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -432,7 +432,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local,
432static bool ieee80211_can_scan(struct ieee80211_local *local, 432static bool ieee80211_can_scan(struct ieee80211_local *local,
433 struct ieee80211_sub_if_data *sdata) 433 struct ieee80211_sub_if_data *sdata)
434{ 434{
435 if (local->radar_detect_enabled) 435 if (ieee80211_is_radar_required(local))
436 return false; 436 return false;
437 437
438 if (!list_empty(&local->roc_list)) 438 if (!list_empty(&local->roc_list))