Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: prevent tuning during scanning
@ 2008-03-19 23:43 Reinette Chatre
  2008-03-20  0:06 ` Johannes Berg
  2008-03-20  0:13 ` Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Reinette Chatre @ 2008-03-19 23:43 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ipw3945-devel, Mohamed Abbas, Reinette Chatre

From: Mohamed Abbas <mohamed.abbas@intel.com>

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 <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 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


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

* Re: [PATCH] iwlwifi: prevent tuning during scanning
  2008-03-19 23:43 [PATCH] iwlwifi: prevent tuning during scanning Reinette Chatre
@ 2008-03-20  0:06 ` Johannes Berg
  2008-03-20  3:46   ` Abbas, Mohamed
  2008-03-20 15:15   ` Chatre, Reinette
  2008-03-20  0:13 ` Johannes Berg
  1 sibling, 2 replies; 6+ messages in thread
From: Johannes Berg @ 2008-03-20  0:06 UTC (permalink / raw)
  To: Reinette Chatre; +Cc: linville, linux-wireless, ipw3945-devel, Mohamed Abbas

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [PATCH] iwlwifi: prevent tuning during scanning
  2008-03-19 23:43 [PATCH] iwlwifi: prevent tuning during scanning Reinette Chatre
  2008-03-20  0:06 ` Johannes Berg
@ 2008-03-20  0:13 ` Johannes Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2008-03-20  0:13 UTC (permalink / raw)
  To: Reinette Chatre; +Cc: linville, linux-wireless, ipw3945-devel, Mohamed Abbas

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]


> +		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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* RE: [PATCH] iwlwifi: prevent tuning during scanning
  2008-03-20  0:06 ` Johannes Berg
@ 2008-03-20  3:46   ` Abbas, Mohamed
  2008-03-20 10:11     ` Johannes Berg
  2008-03-20 15:15   ` Chatre, Reinette
  1 sibling, 1 reply; 6+ messages in thread
From: Abbas, Mohamed @ 2008-03-20  3:46 UTC (permalink / raw)
  To: Johannes Berg, Chatre, Reinette; +Cc: linville, linux-wireless, ipw3945-devel

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:johannes@sipsolutions.net] 
Sent: Wednesday, March 19, 2008 5:07 PM
To: Chatre, Reinette
Cc: linville@tuxdriver.com; linux-wireless@vger.kernel.org;
ipw3945-devel@lists.sourceforge.net; 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

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

* RE: [PATCH] iwlwifi: prevent tuning during scanning
  2008-03-20  3:46   ` Abbas, Mohamed
@ 2008-03-20 10:11     ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2008-03-20 10:11 UTC (permalink / raw)
  To: Abbas, Mohamed; +Cc: Chatre, Reinette, linville, linux-wireless, ipw3945-devel

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]


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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* RE: [PATCH] iwlwifi: prevent tuning during scanning
  2008-03-20  0:06 ` Johannes Berg
  2008-03-20  3:46   ` Abbas, Mohamed
@ 2008-03-20 15:15   ` Chatre, Reinette
  1 sibling, 0 replies; 6+ messages in thread
From: Chatre, Reinette @ 2008-03-20 15:15 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless, ipw3945-devel, Abbas, Mohamed

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

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

end of thread, other threads:[~2008-03-20 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-19 23:43 [PATCH] iwlwifi: prevent tuning during scanning Reinette Chatre
2008-03-20  0:06 ` Johannes Berg
2008-03-20  3:46   ` Abbas, Mohamed
2008-03-20 10:11     ` Johannes Berg
2008-03-20 15:15   ` Chatre, Reinette
2008-03-20  0:13 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox