aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2007-12-20 01:10:01 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:54 -0500
commita0646470e8a965df59054a5c82e53e5572bf04a0 (patch)
treefe4b434a1b8f2accdcfd3e1055b903ffb20e5d8b /drivers/net/wireless/iwlwifi/iwl4965-base.c
parent12342c475f5de17071eaf24ea2938ba8dfe285f2 (diff)
iwlwifi: skip mac80211 conf during a hardware scan and replay it afterwards
This patch skips mac80211 configuration setting during a hardware scan and replays it afterwards for the iwlwifi drivers. Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 07089754b54..5a9fa42f999 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -7332,8 +7332,8 @@ static void iwl4965_bg_scan_completed(struct work_struct *work)
7332 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 7332 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
7333 return; 7333 return;
7334 7334
7335 if (priv->cache_conf) 7335 if (test_bit(STATUS_CONF_PENDING, &priv->status))
7336 iwl4965_mac_config(priv->hw, priv->cache_conf); 7336 iwl4965_mac_config(priv->hw, ieee80211_get_hw_conf(priv->hw));
7337 7337
7338 ieee80211_scan_completed(priv->hw); 7338 ieee80211_scan_completed(priv->hw);
7339 7339
@@ -7476,27 +7476,12 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
7476 goto out; 7476 goto out;
7477 } 7477 }
7478 7478
7479 /* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only
7480 * what is exposed through include/ declarations */
7481 if (unlikely(!iwl4965_param_disable_hw_scan && 7479 if (unlikely(!iwl4965_param_disable_hw_scan &&
7482 test_bit(STATUS_SCANNING, &priv->status))) { 7480 test_bit(STATUS_SCANNING, &priv->status))) {
7483 7481 IWL_DEBUG_MAC80211("leave - scanning\n");
7484 if (unlikely(priv->cache_conf)) 7482 set_bit(STATUS_CONF_PENDING, &priv->status);
7485 IWL_DEBUG_MAC80211("leave - still scanning\n");
7486 else {
7487 /* Cache the configuration now so that we can
7488 * replay it after the hardware scan is finished. */
7489 priv->cache_conf = kmalloc(sizeof(*conf), GFP_KERNEL);
7490 if (priv->cache_conf) {
7491 memcpy(priv->cache_conf, conf, sizeof(*conf));
7492 IWL_DEBUG_MAC80211("leave - scanning\n");
7493 } else {
7494 IWL_DEBUG_MAC80211("leave - no memory\n");
7495 ret = -ENOMEM;
7496 }
7497 }
7498 mutex_unlock(&priv->mutex); 7483 mutex_unlock(&priv->mutex);
7499 return ret; 7484 return 0;
7500 } 7485 }
7501 7486
7502 spin_lock_irqsave(&priv->lock, flags); 7487 spin_lock_irqsave(&priv->lock, flags);
@@ -7564,12 +7549,9 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
7564 7549
7565 IWL_DEBUG_MAC80211("leave\n"); 7550 IWL_DEBUG_MAC80211("leave\n");
7566 7551
7567out:
7568 if (priv->cache_conf) {
7569 kfree(priv->cache_conf);
7570 priv->cache_conf = NULL;
7571 }
7572 mutex_unlock(&priv->mutex); 7552 mutex_unlock(&priv->mutex);
7553out:
7554 clear_bit(STATUS_CONF_PENDING, &priv->status);
7573 return ret; 7555 return ret;
7574} 7556}
7575 7557