aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-18 03:36:09 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-12-18 04:33:06 -0500
commit367bbd10ee1abe986a6cfec11974d6c32a04bd96 (patch)
tree1cd7fd49687ee5efa884d22fdfb7b6364cc58a02 /net/mac80211
parentf359d3fe832e49eeec2232b2af5a9e3aee6b4862 (diff)
mac80211: make ieee80211_recalc_radar_chanctx static
The function is only used in one file, so move it up a bit to avoid forward declarations and make it static. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/chan.c46
-rw-r--r--net/mac80211/ieee80211_i.h2
2 files changed, 23 insertions, 25 deletions
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index a57d5d9466bc..f20a98a70cc0 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -358,6 +358,29 @@ static void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local,
358 ieee80211_change_chanctx(local, ctx, compat); 358 ieee80211_change_chanctx(local, ctx, compat);
359} 359}
360 360
361static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
362 struct ieee80211_chanctx *chanctx)
363{
364 bool radar_enabled;
365
366 lockdep_assert_held(&local->chanctx_mtx);
367
368 radar_enabled = ieee80211_is_radar_required(local);
369
370 if (radar_enabled == chanctx->conf.radar_enabled)
371 return;
372
373 chanctx->conf.radar_enabled = radar_enabled;
374 local->radar_detect_enabled = chanctx->conf.radar_enabled;
375
376 if (!local->use_chanctx) {
377 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled;
378 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
379 }
380
381 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR);
382}
383
361static void ieee80211_unassign_vif_chanctx(struct ieee80211_sub_if_data *sdata, 384static void ieee80211_unassign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
362 struct ieee80211_chanctx *ctx) 385 struct ieee80211_chanctx *ctx)
363{ 386{
@@ -404,29 +427,6 @@ static void __ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
404 ieee80211_free_chanctx(local, ctx); 427 ieee80211_free_chanctx(local, ctx);
405} 428}
406 429
407void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
408 struct ieee80211_chanctx *chanctx)
409{
410 bool radar_enabled;
411
412 lockdep_assert_held(&local->chanctx_mtx);
413
414 radar_enabled = ieee80211_is_radar_required(local);
415
416 if (radar_enabled == chanctx->conf.radar_enabled)
417 return;
418
419 chanctx->conf.radar_enabled = radar_enabled;
420 local->radar_detect_enabled = chanctx->conf.radar_enabled;
421
422 if (!local->use_chanctx) {
423 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled;
424 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
425 }
426
427 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR);
428}
429
430void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, 430void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
431 struct ieee80211_chanctx *chanctx) 431 struct ieee80211_chanctx *chanctx)
432{ 432{
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index fb5dbcb79a12..c56009c3589d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1775,8 +1775,6 @@ void ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
1775 1775
1776void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, 1776void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local,
1777 struct ieee80211_chanctx *chanctx); 1777 struct ieee80211_chanctx *chanctx);
1778void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local,
1779 struct ieee80211_chanctx *chanctx);
1780void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, 1778void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
1781 struct ieee80211_chanctx *ctx); 1779 struct ieee80211_chanctx *ctx);
1782 1780