2008-03-19 23:45:03

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH] iwlwifi: prevent tuning during scanning

From: Mohamed Abbas <[email protected]>

Postpone calling ieee80211_hw_config if hardware scanning is active.
This is similar to solution for software scanning where channel setting
is delayed until scan complete.

Signed-off-by: Mohamed Abbas <[email protected]>
Signed-off-by: Reinette Chatre <[email protected]>
---
net/mac80211/ieee80211_ioctl.c | 2 +-
net/mac80211/ieee80211_sta.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 1d91575..83b79c9 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -308,7 +308,7 @@ int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz)
}

if (set) {
- if (local->sta_sw_scanning)
+ if (local->sta_sw_scanning || local->sta_hw_scanning)
ret = 0;
else
ret = ieee80211_hw_config(local);
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 4255ec4..1e9650e 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -3609,6 +3609,9 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)

if (local->sta_hw_scanning) {
local->sta_hw_scanning = 0;
+ if (ieee80211_hw_config(local))
+ printk(KERN_DEBUG "%s: failed to restore operational "
+ "channel after scan\n", dev->name);
/* Restart STA timer for HW scan case */
rcu_read_lock();
list_for_each_entry_rcu(sdata, &local->interfaces, list)
--
1.5.3.4



2008-03-20 00:07:08

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: prevent tuning during scanning

Wrong patch title. Trying to sneak patches past me? ;)

Also, I thought you explicitly wanted the channel change callback to be
allowed during hw scan because hw scan could return to the home channel
inbetween...

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part

2008-03-20 15:18:10

by Reinette Chatre

[permalink] [raw]
Subject: RE: [PATCH] iwlwifi: prevent tuning during scanning

On Wednesday, March 19, 2008 5:07 PM, Johannes Berg wrote:

> Wrong patch title. Trying to sneak patches past me? ;)
>
> Also, I thought you explicitly wanted the channel change callback to
> be allowed during hw scan because hw scan could return to the home
> channel inbetween...
>
> johannes

Sorry Johannes - my fault. I just sent it again with corrected title.

Reinette

2008-03-20 03:46:45

by Abbas, Mohamed

[permalink] [raw]
Subject: RE: [PATCH] iwlwifi: prevent tuning during scanning

We can not call any host command that change active channel during
scanning. Actually we do cancel scan if config callback was called
during scanning. So if a user tried to change channel while scanning
this patch will delay the channel change until scan finish, this is the
same behavior as sw scan.
Mohamed


-----Original Message-----
From: Johannes Berg [mailto:[email protected]]
Sent: Wednesday, March 19, 2008 5:07 PM
To: Chatre, Reinette
Cc: [email protected]; [email protected];
[email protected]; Abbas, Mohamed
Subject: Re: [PATCH] iwlwifi: prevent tuning during scanning

Wrong patch title. Trying to sneak patches past me? ;)

Also, I thought you explicitly wanted the channel change callback to be
allowed during hw scan because hw scan could return to the home channel
inbetween...

johannes

2008-03-20 10:12:09

by Johannes Berg

[permalink] [raw]
Subject: RE: [PATCH] iwlwifi: prevent tuning during scanning


On Wed, 2008-03-19 at 20:46 -0700, Abbas, Mohamed wrote:
> We can not call any host command that change active channel during
> scanning. Actually we do cancel scan if config callback was called
> during scanning. So if a user tried to change channel while scanning
> this patch will delay the channel change until scan finish, this is the
> same behavior as sw scan.

Ok, nothing against the patch, but please resend it with a proper
subject.

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part

2008-03-20 00:13:43

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: prevent tuning during scanning


> + if (ieee80211_hw_config(local))
> + printk(KERN_DEBUG "%s: failed to restore operational "
> + "channel after scan\n", dev->name);

Also, the message is wrong, it's correct for the sw scan case where we
in software leave the 'operational channel', but in hw scan case this
can really only ever make a difference when the channel was changed by
the user during a scan.

Maybe a better solution would be to make the ioctls wait for the scan to
finish?

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part