linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mac80211: avoid recalc_idle in monitor mode
@ 2010-09-15 11:56 Rajkumar Manoharan
  2010-09-15 12:12 ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Rajkumar Manoharan @ 2010-09-15 11:56 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Rajkumar Manoharan, Vasanthakumar Thiagarajan

ath9k is not receiving frames in monitor mode after the commit 34d4bc.
The problem is mac80211 sets IEEE80211_CONF_IDLE in __ieee80211_recalc_idle
at ieee80211_do_open. Due to this, ath9k disables the radio.

The above said commit sets SDATA_STATE_RUNNING after __ieee80211_recalc_idle.
IMHO avoiding __ieee80211_recalc_idle in monitor mode looks better
than moving SDATA_STATE_RUNNING set before __ieee80211_recalc_idle.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 net/mac80211/iface.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index c1cc200..2bec319 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -310,9 +310,11 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
 	if (sdata->flags & IEEE80211_SDATA_PROMISC)
 		atomic_inc(&local->iff_promiscs);
 
-	mutex_lock(&local->mtx);
-	hw_reconf_flags |= __ieee80211_recalc_idle(local);
-	mutex_unlock(&local->mtx);
+	if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
+		mutex_lock(&local->mtx);
+		hw_reconf_flags |= __ieee80211_recalc_idle(local);
+		mutex_unlock(&local->mtx);
+	}
 
 	if (coming_up)
 		local->open_count++;
-- 
1.7.2.3


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

* Re: [RFC] mac80211: avoid recalc_idle in monitor mode
  2010-09-15 11:56 [RFC] mac80211: avoid recalc_idle in monitor mode Rajkumar Manoharan
@ 2010-09-15 12:12 ` Johannes Berg
  2010-09-15 13:05   ` Rajkumar Manoharan
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2010-09-15 12:12 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless, Vasanthakumar Thiagarajan

On Wed, 2010-09-15 at 17:26 +0530, Rajkumar Manoharan wrote:
> ath9k is not receiving frames in monitor mode after the commit 34d4bc.
> The problem is mac80211 sets IEEE80211_CONF_IDLE in __ieee80211_recalc_idle
> at ieee80211_do_open. Due to this, ath9k disables the radio.
> 
> The above said commit sets SDATA_STATE_RUNNING after __ieee80211_recalc_idle.
> IMHO avoiding __ieee80211_recalc_idle in monitor mode looks better
> than moving SDATA_STATE_RUNNING set before __ieee80211_recalc_idle.
> 
> Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
> ---
>  net/mac80211/iface.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index c1cc200..2bec319 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -310,9 +310,11 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
>  	if (sdata->flags & IEEE80211_SDATA_PROMISC)
>  		atomic_inc(&local->iff_promiscs);
>  
> -	mutex_lock(&local->mtx);
> -	hw_reconf_flags |= __ieee80211_recalc_idle(local);
> -	mutex_unlock(&local->mtx);
> +	if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
> +		mutex_lock(&local->mtx);
> +		hw_reconf_flags |= __ieee80211_recalc_idle(local);
> +		mutex_unlock(&local->mtx);
> +	}

Hmm, that doesn't seem right, wouldn't it be idle to start with?

johannes


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

* Re: [RFC] mac80211: avoid recalc_idle in monitor mode
  2010-09-15 12:12 ` Johannes Berg
@ 2010-09-15 13:05   ` Rajkumar Manoharan
  2010-09-15 13:05     ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Rajkumar Manoharan @ 2010-09-15 13:05 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Rajkumar Manoharan, linux-wireless@vger.kernel.org,
	Vasanth Thiagarajan

On Wed, Sep 15, 2010 at 05:42:10PM +0530, Johannes Berg wrote:
> On Wed, 2010-09-15 at 17:26 +0530, Rajkumar Manoharan wrote:
> > ath9k is not receiving frames in monitor mode after the commit 34d4bc.
> > The problem is mac80211 sets IEEE80211_CONF_IDLE in __ieee80211_recalc_idle
> > at ieee80211_do_open. Due to this, ath9k disables the radio.
> > 
> > The above said commit sets SDATA_STATE_RUNNING after __ieee80211_recalc_idle.
> > IMHO avoiding __ieee80211_recalc_idle in monitor mode looks better
> > than moving SDATA_STATE_RUNNING set before __ieee80211_recalc_idle.
> > 
> > Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
> > Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
> > ---
> >  net/mac80211/iface.c |    8 +++++---
> >  1 files changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> > index c1cc200..2bec319 100644
> > --- a/net/mac80211/iface.c
> > +++ b/net/mac80211/iface.c
> > @@ -310,9 +310,11 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
> >  	if (sdata->flags & IEEE80211_SDATA_PROMISC)
> >  		atomic_inc(&local->iff_promiscs);
> >  
> > -	mutex_lock(&local->mtx);
> > -	hw_reconf_flags |= __ieee80211_recalc_idle(local);
> > -	mutex_unlock(&local->mtx);
> > +	if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
> > +		mutex_lock(&local->mtx);
> > +		hw_reconf_flags |= __ieee80211_recalc_idle(local);
> > +		mutex_unlock(&local->mtx);
> > +	}
> 
> Hmm, that doesn't seem right, wouldn't it be idle to start with?
not sure whether I am missing something here. Shouldn't we be receiving frames
in monitor mode as soon as the interface is up and running. I don't see any
reason why should we even care about IDLE state for MONITOR mode.
> 
> johannes
>


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

* Re: [RFC] mac80211: avoid recalc_idle in monitor mode
  2010-09-15 13:05   ` Rajkumar Manoharan
@ 2010-09-15 13:05     ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2010-09-15 13:05 UTC (permalink / raw)
  To: Rajkumar Manoharan
  Cc: Rajkumar Manoharan, linux-wireless@vger.kernel.org,
	Vasanth Thiagarajan

On Wed, 2010-09-15 at 18:35 +0530, Rajkumar Manoharan wrote:

> > > -	mutex_lock(&local->mtx);
> > > -	hw_reconf_flags |= __ieee80211_recalc_idle(local);
> > > -	mutex_unlock(&local->mtx);
> > > +	if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
> > > +		mutex_lock(&local->mtx);
> > > +		hw_reconf_flags |= __ieee80211_recalc_idle(local);
> > > +		mutex_unlock(&local->mtx);
> > > +	}
> > 
> > Hmm, that doesn't seem right, wouldn't it be idle to start with?

> not sure whether I am missing something here. Shouldn't we be receiving frames
> in monitor mode as soon as the interface is up and running. I don't see any
> reason why should we even care about IDLE state for MONITOR mode.

But if the device is already idle, adding the monitor wouldn't change it
either, which seems wrong, no?

johannes


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

end of thread, other threads:[~2010-09-15 13:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-15 11:56 [RFC] mac80211: avoid recalc_idle in monitor mode Rajkumar Manoharan
2010-09-15 12:12 ` Johannes Berg
2010-09-15 13:05   ` Rajkumar Manoharan
2010-09-15 13:05     ` 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).