diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-02-28 03:59:22 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-28 03:59:22 -0500 |
commit | feda30271e5455394c57e35eba66db88d1b15077 (patch) | |
tree | 89a948ff65091e39c0dc3e9ce7f01728798916f0 /net/mac80211/cfg.c | |
parent | d0ae708d1acd4bf6ad5b9937d9da44d16ca18f13 (diff) |
mac80211: really fix monitor mode channel reporting
After Felix's patch it was still broken in case you
used more than just a single monitor interface. Fix
it better now.
Reported-by: Sujith Manoharan <sujith@msujith.org>
Tested-by: Sujith Manoharan <sujith@msujith.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 808f5fcd1ced..fb306814576a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -3290,14 +3290,19 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy, | |||
3290 | int ret = -ENODATA; | 3290 | int ret = -ENODATA; |
3291 | 3291 | ||
3292 | rcu_read_lock(); | 3292 | rcu_read_lock(); |
3293 | if (local->use_chanctx) { | 3293 | chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); |
3294 | chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); | 3294 | if (chanctx_conf) { |
3295 | if (chanctx_conf) { | 3295 | *chandef = chanctx_conf->def; |
3296 | *chandef = chanctx_conf->def; | 3296 | ret = 0; |
3297 | ret = 0; | 3297 | } else if (local->open_count > 0 && |
3298 | } | 3298 | local->open_count == local->monitors && |
3299 | } else if (local->open_count == local->monitors) { | 3299 | sdata->vif.type == NL80211_IFTYPE_MONITOR) { |
3300 | *chandef = local->monitor_chandef; | 3300 | if (local->use_chanctx) |
3301 | *chandef = local->monitor_chandef; | ||
3302 | else | ||
3303 | cfg80211_chandef_create(chandef, | ||
3304 | local->_oper_channel, | ||
3305 | local->_oper_channel_type); | ||
3301 | ret = 0; | 3306 | ret = 0; |
3302 | } | 3307 | } |
3303 | rcu_read_unlock(); | 3308 | rcu_read_unlock(); |