From ef898efe82fcbfc68629ae4979b6ccefcf9d69d8 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Thu, 28 Feb 2013 09:59:22 +0100 Subject: [PATCH] --- yaml --- r: 361063 b: refs/heads/master c: feda30271e5455394c57e35eba66db88d1b15077 h: refs/heads/master i: 361061: 2b19f0c2f1bba263bbc61a5a321b84e0ce811e3d 361059: df724e1fa8b7607e63567bd692d81e3efc9ecc25 361055: d8785c07bf99b97fdfae22f2244f2ecdb4ca3f16 v: v3 --- [refs] | 2 +- trunk/net/mac80211/cfg.c | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 8dd5cda87afb..21c251d470da 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d0ae708d1acd4bf6ad5b9937d9da44d16ca18f13 +refs/heads/master: feda30271e5455394c57e35eba66db88d1b15077 diff --git a/trunk/net/mac80211/cfg.c b/trunk/net/mac80211/cfg.c index 808f5fcd1ced..fb306814576a 100644 --- a/trunk/net/mac80211/cfg.c +++ b/trunk/net/mac80211/cfg.c @@ -3290,14 +3290,19 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy, int ret = -ENODATA; rcu_read_lock(); - if (local->use_chanctx) { - chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); - if (chanctx_conf) { - *chandef = chanctx_conf->def; - ret = 0; - } - } else if (local->open_count == local->monitors) { - *chandef = local->monitor_chandef; + chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); + if (chanctx_conf) { + *chandef = chanctx_conf->def; + ret = 0; + } else if (local->open_count > 0 && + local->open_count == local->monitors && + sdata->vif.type == NL80211_IFTYPE_MONITOR) { + if (local->use_chanctx) + *chandef = local->monitor_chandef; + else + cfg80211_chandef_create(chandef, + local->_oper_channel, + local->_oper_channel_type); ret = 0; } rcu_read_unlock();