aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-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/iwl3945-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/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 40b69182e4dc..8d603257b926 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6888,8 +6888,8 @@ static void iwl3945_bg_scan_completed(struct work_struct *work)
6888 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 6888 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
6889 return; 6889 return;
6890 6890
6891 if (priv->cache_conf) 6891 if (test_bit(STATUS_CONF_PENDING, &priv->status))
6892 iwl3945_mac_config(priv->hw, priv->cache_conf); 6892 iwl3945_mac_config(priv->hw, ieee80211_get_hw_conf(priv->hw));
6893 6893
6894 ieee80211_scan_completed(priv->hw); 6894 ieee80211_scan_completed(priv->hw);
6895 6895
@@ -7033,27 +7033,12 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
7033 goto out; 7033 goto out;
7034 } 7034 }
7035 7035
7036 /* TODO: Figure out how to get ieee80211_local->sta_scanning w/ only
7037 * what is exposed through include/ declarations */
7038 if (unlikely(!iwl3945_param_disable_hw_scan && 7036 if (unlikely(!iwl3945_param_disable_hw_scan &&
7039 test_bit(STATUS_SCANNING, &priv->status))) { 7037 test_bit(STATUS_SCANNING, &priv->status))) {
7040 7038 IWL_DEBUG_MAC80211("leave - scanning\n");
7041 if (priv->cache_conf) 7039 set_bit(STATUS_CONF_PENDING, &priv->status);
7042 IWL_DEBUG_MAC80211("leave - still scanning\n");
7043 else {
7044 /* Cache the configuration now so that we can
7045 * replay it after the hardware scan is finished. */
7046 priv->cache_conf = kmalloc(sizeof(*conf), GFP_KERNEL);
7047 if (priv->cache_conf) {
7048 memcpy(priv->cache_conf, conf, sizeof(*conf));
7049 IWL_DEBUG_MAC80211("leave - scanning\n");
7050 } else {
7051 IWL_DEBUG_MAC80211("leave - no memory\n");
7052 ret = -ENOMEM;
7053 }
7054 }
7055 mutex_unlock(&priv->mutex); 7040 mutex_unlock(&priv->mutex);
7056 return ret; 7041 return 0;
7057 } 7042 }
7058 7043
7059 spin_lock_irqsave(&priv->lock, flags); 7044 spin_lock_irqsave(&priv->lock, flags);
@@ -7110,10 +7095,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
7110 IWL_DEBUG_MAC80211("leave\n"); 7095 IWL_DEBUG_MAC80211("leave\n");
7111 7096
7112out: 7097out:
7113 if (priv->cache_conf) { 7098 clear_bit(STATUS_CONF_PENDING, &priv->status);
7114 kfree(priv->cache_conf);
7115 priv->cache_conf = NULL;
7116 }
7117 mutex_unlock(&priv->mutex); 7099 mutex_unlock(&priv->mutex);
7118 return ret; 7100 return ret;
7119} 7101}