diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2014-02-13 11:31:59 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-04-09 10:55:43 +0200 |
commit | 73de86a38962b18edad3205c2358599dd9c83e9f (patch) | |
tree | caf27b6e5000427c940a07d325d1210417ba87ad /net/mac80211/chan.c | |
parent | 2beb6dab2d799ee8934cb0801845e551ad8c70f2 (diff) | |
download | op-kernel-dev-73de86a38962b18edad3205c2358599dd9c83e9f.zip op-kernel-dev-73de86a38962b18edad3205c2358599dd9c83e9f.tar.gz |
cfg80211/mac80211: move interface counting for combination check to mac80211
Move the counting part of the interface combination check from
cfg80211 to mac80211.
This is needed to simplify locking when the driver has to perform a
combination check by itself (eg. with channel-switch).
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/chan.c')
-rw-r--r-- | net/mac80211/chan.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index b297bd3..623b336 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -519,6 +519,7 @@ int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata, { struct ieee80211_local *local = sdata->local; struct ieee80211_chanctx *ctx; + u8 radar_detect_width = 0; int ret; lockdep_assert_held(&local->mtx); @@ -526,6 +527,22 @@ int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata, WARN_ON(sdata->dev && netif_carrier_ok(sdata->dev)); mutex_lock(&local->chanctx_mtx); + + ret = cfg80211_chandef_dfs_required(local->hw.wiphy, + chandef, + sdata->wdev.iftype); + if (ret < 0) + goto out; + if (ret > 0) + radar_detect_width = BIT(chandef->width); + + sdata->radar_required = ret; + + ret = ieee80211_check_combinations(sdata, chandef, mode, + radar_detect_width); + if (ret < 0) + goto out; + __ieee80211_vif_release_channel(sdata); ctx = ieee80211_find_chanctx(local, chandef, mode); |