2008-03-20 15:17:35

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH] mac80211: 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]>
---
Resend of patch "iwlwifi: prevent tuning during scanning" with
corrected title.

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 15:36:41

by Johannes Berg

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


On Thu, 2008-03-20 at 08:14 -0700, Reinette Chatre wrote:
> 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]>

Fine with me.

Acked-by: Johannes Berg <[email protected]>

> ---
> Resend of patch "iwlwifi: prevent tuning during scanning" with
> corrected title.
>
> 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)


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