* [PATCH] iwl4965: fix bogus hardware scan configuration caching
@ 2007-12-19 0:30 Johannes Berg
2007-12-20 5:56 ` Zhu Yi
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2007-12-19 0:30 UTC (permalink / raw)
To: John Linville; +Cc: Zhu Yi, linux-wireless
When iwl4965 is scanning, it needs to cache any configuration requests.
This was implemented but the implementation is buggy: it uses only
the *first* configuration rather than the *last* that is requested
during scanning. This patch fixes that and also removes a bogus
comment related to the issue.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
This patch requires porting to iwl3965. For correctness, it
needs to be applied to 2.6.24 although most likely nobody will
ask to change channel twice during a single hardware scan. Duh!
Warning: patch is not even compile tested yet because I currently have a
broken tree. I don't see why it shouldn't work though.
drivers/net/wireless/iwlwifi/iwl4965-base.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
--- everything.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-12-19 01:17:23.773023329 +0100
+++ everything/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-12-19 01:20:08.943020887 +0100
@@ -7471,25 +7471,21 @@ static int iwl4965_mac_config(struct iee
goto out;
}
- /* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only
- * what is exposed through include/ declarations */
if (unlikely(!iwl4965_param_disable_hw_scan &&
test_bit(STATUS_SCANNING, &priv->status))) {
+ /*
+ * Cache the configuration now so that we can
+ * replay it after the hardware scan is finished.
+ */
- if (unlikely(priv->cache_conf))
- IWL_DEBUG_MAC80211("leave - still scanning\n");
- else {
- /* Cache the configuration now so that we can
- * replay it after the hardware scan is finished. */
+ if (likely(!priv->cache_conf))
priv->cache_conf = kmalloc(sizeof(*conf), GFP_KERNEL);
- if (priv->cache_conf) {
- memcpy(priv->cache_conf, conf, sizeof(*conf));
- IWL_DEBUG_MAC80211("leave - scanning\n");
- } else {
- IWL_DEBUG_MAC80211("leave - no memory\n");
- ret = -ENOMEM;
- }
- }
+
+ if (likely(priv->cache_conf))
+ memcpy(priv->cache_conf, conf, sizeof(*conf));
+ else
+ ret = -ENOMEM;
+
mutex_unlock(&priv->mutex);
return ret;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] iwl4965: fix bogus hardware scan configuration caching
2007-12-19 0:30 [PATCH] iwl4965: fix bogus hardware scan configuration caching Johannes Berg
@ 2007-12-20 5:56 ` Zhu Yi
0 siblings, 0 replies; 2+ messages in thread
From: Zhu Yi @ 2007-12-20 5:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
On Wed, 2007-12-19 at 01:30 +0100, Johannes Berg wrote:
> When iwl4965 is scanning, it needs to cache any configuration
> requests.
> This was implemented but the implementation is buggy: it uses only
> the *first* configuration rather than the *last* that is requested
> during scanning. This patch fixes that and also removes a bogus
> comment related to the issue.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> This patch requires porting to iwl3965. For correctness, it
> needs to be applied to 2.6.24 although most likely nobody will
> ask to change channel twice during a single hardware scan. Duh!
>
> Warning: patch is not even compile tested yet because I currently have
> a broken tree. I don't see why it shouldn't work though.
NACK. We have a better fix that doesn't require to alloc buffer at all
in our tree. Will post it here later.
http://intellinuxwireless.org/repos/?p=iwlwifi.git;a=commitdiff;h=5f967087629a19b0c166101ddd227dee8ab2ec39
Thanks,
-yi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-20 5:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19 0:30 [PATCH] iwl4965: fix bogus hardware scan configuration caching Johannes Berg
2007-12-20 5:56 ` Zhu Yi
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).