linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: return the vif's chandef in ieee80211_cfg_get_channel()
@ 2014-09-30  4:08 Emmanuel Grumbach
  2014-10-09  9:02 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Emmanuel Grumbach @ 2014-09-30  4:08 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Luciano Coelho, Emmanuel Grumbach

From: Luciano Coelho <luciano.coelho@intel.com>

The chandef of the channel context a vif is using may be different
than the chandef of the vif itself.  For instance, the bandwidth used
by the vif may be narrower than the one configured in the channel
context.  To avoid confusion, return the vif's chandef in
ieee80211_cfg_get_channel() instead of the chandef of the channel
context.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9b03d08..6a7339e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3476,7 +3476,7 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
 	rcu_read_lock();
 	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
 	if (chanctx_conf) {
-		*chandef = chanctx_conf->def;
+		*chandef = sdata->vif.bss_conf.chandef;
 		ret = 0;
 	} else if (local->open_count > 0 &&
 		   local->open_count == local->monitors &&
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: return the vif's chandef in ieee80211_cfg_get_channel()
  2014-09-30  4:08 [PATCH] mac80211: return the vif's chandef in ieee80211_cfg_get_channel() Emmanuel Grumbach
@ 2014-10-09  9:02 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2014-10-09  9:02 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless, Luciano Coelho

On Tue, 2014-09-30 at 07:08 +0300, Emmanuel Grumbach wrote:
> From: Luciano Coelho <luciano.coelho@intel.com>
> 
> The chandef of the channel context a vif is using may be different
> than the chandef of the vif itself.  For instance, the bandwidth used
> by the vif may be narrower than the one configured in the channel
> context.  To avoid confusion, return the vif's chandef in
> ieee80211_cfg_get_channel() instead of the chandef of the channel
> context.

Applied.

johannes


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-09  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  4:08 [PATCH] mac80211: return the vif's chandef in ieee80211_cfg_get_channel() Emmanuel Grumbach
2014-10-09  9:02 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).