linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211:  Make no-probe-response kernel messages more useful.
@ 2010-09-29 18:03 greearb
  2010-09-29 18:03 ` [PATCH 2/2] mac80211: Don't go off-channel in work_work unless needed greearb
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: greearb @ 2010-09-29 18:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Add device name and flags to give better idea of what
exactly is happening.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 77913a1... 04f33cf... M	net/mac80211/mlme.c
 net/mac80211/mlme.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 77913a1..04f33cf 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1863,10 +1863,11 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
 
 		else if (ifmgd->probe_send_count < IEEE80211_MAX_PROBE_TRIES) {
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
-			printk(KERN_DEBUG "No probe response from AP %pM"
-				" after %dms, try %d\n", bssid,
+			printk(KERN_DEBUG "%s: No probe response from AP %pM"
+				" after %dms, try %d  flags: 0x%x\n",
+				sdata->dev->name, bssid,
 				(1000 * IEEE80211_PROBE_WAIT)/HZ,
-				ifmgd->probe_send_count);
+				ifmgd->probe_send_count, ifmgd->flags);
 #endif
 			ieee80211_mgd_probe_ap_send(sdata);
 		} else {
@@ -1876,9 +1877,10 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
 			 */
 			ifmgd->flags &= ~(IEEE80211_STA_CONNECTION_POLL |
 					  IEEE80211_STA_BEACON_POLL);
-			printk(KERN_DEBUG "No probe response from AP %pM"
-				" after %dms, disconnecting.\n",
-				bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ);
+			printk(KERN_DEBUG "%s: No probe response from AP %pM"
+			       " after %dms, disconnecting, flags: 0x%x\n",
+			       sdata->dev->name, bssid,
+			       (1000 * IEEE80211_PROBE_WAIT)/HZ, ifmgd->flags);
 			ieee80211_set_disassoc(sdata, true);
 			mutex_unlock(&ifmgd->mtx);
 			mutex_lock(&local->mtx);
-- 
1.7.2.2


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

* [PATCH 2/2] mac80211:  Don't go off-channel in work_work unless needed.
  2010-09-29 18:03 [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful greearb
@ 2010-09-29 18:03 ` greearb
  2010-09-29 18:06   ` Johannes Berg
  2010-09-29 23:03 ` [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful Julian Calaby
  2010-09-30  7:49 ` Johannes Berg
  2 siblings, 1 reply; 8+ messages in thread
From: greearb @ 2010-09-29 18:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

If the work to be done is on the current active channel, then
do not call the offchannel and return-to-channel logic.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 ae344d1... 1f2673d... M	net/mac80211/work.c
 net/mac80211/work.c |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index ae344d1..1f2673d 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -873,6 +873,7 @@ static void ieee80211_work_work(struct work_struct *work)
 	LIST_HEAD(free_work);
 	enum work_action rma;
 	bool remain_off_channel = false;
+	bool went_off_channel = false;
 
 	if (local->scanning)
 		return;
@@ -910,12 +911,21 @@ static void ieee80211_work_work(struct work_struct *work)
 			 *	 happen to be on the same channel as
 			 *	 the requested channel
 			 */
-			ieee80211_offchannel_stop_beaconing(local);
-			ieee80211_offchannel_stop_station(local);
-
-			local->tmp_channel = wk->chan;
-			local->tmp_channel_type = wk->chan_type;
-			ieee80211_hw_config(local, 0);
+			WARN_ON(local->scan_channel != NULL);
+			if (wk->chan != local->oper_channel ||
+			    wk->chan_type != local->_oper_channel_type) {
+				/* Only change channels if we need to */
+				ieee80211_offchannel_stop_beaconing(local);
+				ieee80211_offchannel_stop_station(local);
+
+				local->tmp_channel = wk->chan;
+				local->tmp_channel_type = wk->chan_type;
+				ieee80211_hw_config(local, 0);
+				went_off_channel = true;
+			} else {
+				local->tmp_channel = wk->chan;
+				local->tmp_channel_type = wk->chan_type;
+			}
 			started = true;
 			wk->timeout = jiffies;
 		}
@@ -989,8 +999,10 @@ static void ieee80211_work_work(struct work_struct *work)
 
 	if (!remain_off_channel && local->tmp_channel) {
 		local->tmp_channel = NULL;
-		ieee80211_hw_config(local, 0);
-		ieee80211_offchannel_return(local, true);
+		if (went_off_channel) {
+			ieee80211_hw_config(local, 0);
+			ieee80211_offchannel_return(local, true);
+		}
 		/* give connection some time to breathe */
 		run_again(local, jiffies + HZ/2);
 	}
-- 
1.7.2.2


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

* Re: [PATCH 2/2] mac80211:  Don't go off-channel in work_work unless needed.
  2010-09-29 18:03 ` [PATCH 2/2] mac80211: Don't go off-channel in work_work unless needed greearb
@ 2010-09-29 18:06   ` Johannes Berg
  2010-09-29 18:11     ` Ben Greear
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2010-09-29 18:06 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless

On Wed, 2010-09-29 at 11:03 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> If the work to be done is on the current active channel, then
> do not call the offchannel and return-to-channel logic.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 ae344d1... 1f2673d... M	net/mac80211/work.c
>  net/mac80211/work.c |   28 ++++++++++++++++++++--------
>  1 files changed, 20 insertions(+), 8 deletions(-)
> 
> diff --git a/net/mac80211/work.c b/net/mac80211/work.c
> index ae344d1..1f2673d 100644
> --- a/net/mac80211/work.c
> +++ b/net/mac80211/work.c
> @@ -873,6 +873,7 @@ static void ieee80211_work_work(struct work_struct *work)
>  	LIST_HEAD(free_work);
>  	enum work_action rma;
>  	bool remain_off_channel = false;
> +	bool went_off_channel = false;

Heh, this is not going to work ... the return may be done in a separate
invocation of the function. Would have been nice to test this ;-)

johannes


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

* Re: [PATCH 2/2] mac80211:  Don't go off-channel in work_work unless needed.
  2010-09-29 18:06   ` Johannes Berg
@ 2010-09-29 18:11     ` Ben Greear
  2010-09-29 18:14       ` Johannes Berg
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Greear @ 2010-09-29 18:11 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 09/29/2010 11:06 AM, Johannes Berg wrote:
> On Wed, 2010-09-29 at 11:03 -0700, greearb@candelatech.com wrote:
>> From: Ben Greear<greearb@candelatech.com>
>>
>> If the work to be done is on the current active channel, then
>> do not call the offchannel and return-to-channel logic.
>>
>> Signed-off-by: Ben Greear<greearb@candelatech.com>
>> ---
>> :100644 100644 ae344d1... 1f2673d... M	net/mac80211/work.c
>>   net/mac80211/work.c |   28 ++++++++++++++++++++--------
>>   1 files changed, 20 insertions(+), 8 deletions(-)
>>
>> diff --git a/net/mac80211/work.c b/net/mac80211/work.c
>> index ae344d1..1f2673d 100644
>> --- a/net/mac80211/work.c
>> +++ b/net/mac80211/work.c
>> @@ -873,6 +873,7 @@ static void ieee80211_work_work(struct work_struct *work)
>>   	LIST_HEAD(free_work);
>>   	enum work_action rma;
>>   	bool remain_off_channel = false;
>> +	bool went_off_channel = false;
>
> Heh, this is not going to work ... the return may be done in a separate
> invocation of the function. Would have been nice to test this ;-)

What is a good way to test this?  I brought up several STA interfaces
and an AP and ran traffic..but I guess I need to do something different?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

* Re: [PATCH 2/2] mac80211:  Don't go off-channel in work_work unless needed.
  2010-09-29 18:11     ` Ben Greear
@ 2010-09-29 18:14       ` Johannes Berg
  0 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2010-09-29 18:14 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless

On Wed, 2010-09-29 at 11:11 -0700, Ben Greear wrote:

> >> +	bool went_off_channel = false;
> >
> > Heh, this is not going to work ... the return may be done in a separate
> > invocation of the function. Would have been nice to test this ;-)
> 
> What is a good way to test this?  I brought up several STA interfaces
> and an AP and ran traffic..but I guess I need to do something different?

The work stuff gets invoked when you try to auth, assoc, do off-channel
work, etc... best way is probably to use iw's off-channel command that
translates to a work item here...

johannes


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

* Re: [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful.
  2010-09-29 18:03 [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful greearb
  2010-09-29 18:03 ` [PATCH 2/2] mac80211: Don't go off-channel in work_work unless needed greearb
@ 2010-09-29 23:03 ` Julian Calaby
  2010-09-29 23:19   ` Joe Perches
  2010-09-30  7:49 ` Johannes Berg
  2 siblings, 1 reply; 8+ messages in thread
From: Julian Calaby @ 2010-09-29 23:03 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless

On Thu, Sep 30, 2010 at 04:03,  <greearb@candelatech.com> wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> Add device name and flags to give better idea of what
> exactly is happening.

Is there a printk variant that does standardised formatting for the
wireless device name?

Thanks,

-- 

Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

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

* Re: [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful.
  2010-09-29 23:03 ` [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful Julian Calaby
@ 2010-09-29 23:19   ` Joe Perches
  0 siblings, 0 replies; 8+ messages in thread
From: Joe Perches @ 2010-09-29 23:19 UTC (permalink / raw)
  To: Julian Calaby; +Cc: greearb, linux-wireless

On Thu, 2010-09-30 at 09:03 +1000, Julian Calaby wrote:
> On Thu, Sep 30, 2010 at 04:03,  <greearb@candelatech.com> wrote:
> > From: Ben Greear <greearb@candelatech.com>
> > Add device name and flags to give better idea of what
> > exactly is happening.
> Is there a printk variant that does standardised formatting for the
> wireless device name?

wiphy_<level>, netdev_<level> and dev_<level> in
descending order of preference.



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

* Re: [PATCH 1/2] mac80211:  Make no-probe-response kernel messages more useful.
  2010-09-29 18:03 [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful greearb
  2010-09-29 18:03 ` [PATCH 2/2] mac80211: Don't go off-channel in work_work unless needed greearb
  2010-09-29 23:03 ` [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful Julian Calaby
@ 2010-09-30  7:49 ` Johannes Berg
  2 siblings, 0 replies; 8+ messages in thread
From: Johannes Berg @ 2010-09-30  7:49 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless

On Wed, 2010-09-29 at 11:03 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> Add device name and flags to give better idea of what
> exactly is happening.

Which of the flags are actually useful though?

johannes



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

end of thread, other threads:[~2010-09-30  7:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-29 18:03 [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful greearb
2010-09-29 18:03 ` [PATCH 2/2] mac80211: Don't go off-channel in work_work unless needed greearb
2010-09-29 18:06   ` Johannes Berg
2010-09-29 18:11     ` Ben Greear
2010-09-29 18:14       ` Johannes Berg
2010-09-29 23:03 ` [PATCH 1/2] mac80211: Make no-probe-response kernel messages more useful Julian Calaby
2010-09-29 23:19   ` Joe Perches
2010-09-30  7:49 ` 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).