aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
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 07089754b544..5a9fa42f999b 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