aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 273762769767..7330890fd05e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2504,8 +2504,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2504 2504
2505 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK; 2505 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
2506 2506
2507 if (priv->current_ht_config.is_ht) 2507 iwl_set_rxon_ht(priv, &priv->current_ht_config);
2508 iwl_set_rxon_ht(priv, &priv->current_ht_config);
2509 2508
2510 iwl_set_rxon_chain(priv); 2509 iwl_set_rxon_chain(priv);
2511 priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id); 2510 priv->staging_rxon.assoc_id = cpu_to_le16(priv->assoc_id);
@@ -2568,8 +2567,6 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2568 iwl_chain_noise_reset(priv); 2567 iwl_chain_noise_reset(priv);
2569 priv->start_calib = 1; 2568 priv->start_calib = 1;
2570 2569
2571 /* we have just associated, don't start scan too early */
2572 priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN;
2573} 2570}
2574 2571
2575static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 2572static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
@@ -3171,6 +3168,10 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
3171 priv->power_data.dtim_period = bss_conf->dtim_period; 3168 priv->power_data.dtim_period = bss_conf->dtim_period;
3172 priv->timestamp = bss_conf->timestamp; 3169 priv->timestamp = bss_conf->timestamp;
3173 priv->assoc_capability = bss_conf->assoc_capability; 3170 priv->assoc_capability = bss_conf->assoc_capability;
3171
3172 /* we have just associated, don't start scan too early
3173 * leave time for EAPOL exchange to complete
3174 */
3174 priv->next_scan_jiffies = jiffies + 3175 priv->next_scan_jiffies = jiffies +
3175 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; 3176 IWL_DELAY_NEXT_SCAN_AFTER_ASSOC;
3176 mutex_lock(&priv->mutex); 3177 mutex_lock(&priv->mutex);
@@ -3189,9 +3190,9 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
3189 3190
3190static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len) 3191static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
3191{ 3192{
3192 int ret;
3193 unsigned long flags; 3193 unsigned long flags;
3194 struct iwl_priv *priv = hw->priv; 3194 struct iwl_priv *priv = hw->priv;
3195 int ret;
3195 3196
3196 IWL_DEBUG_MAC80211("enter\n"); 3197 IWL_DEBUG_MAC80211("enter\n");
3197 3198
@@ -3210,20 +3211,27 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
3210 goto out_unlock; 3211 goto out_unlock;
3211 } 3212 }
3212 3213
3213 /* we don't schedule scan within next_scan_jiffies period */ 3214 /* We don't schedule scan within next_scan_jiffies period.
3215 * Avoid scanning during possible EAPOL exchange, return
3216 * success immediately.
3217 */
3214 if (priv->next_scan_jiffies && 3218 if (priv->next_scan_jiffies &&
3215 time_after(priv->next_scan_jiffies, jiffies)) { 3219 time_after(priv->next_scan_jiffies, jiffies)) {
3216 IWL_DEBUG_SCAN("scan rejected: within next scan period\n"); 3220 IWL_DEBUG_SCAN("scan rejected: within next scan period\n");
3217 ret = -EAGAIN; 3221 queue_work(priv->workqueue, &priv->scan_completed);
3222 ret = 0;
3218 goto out_unlock; 3223 goto out_unlock;
3219 } 3224 }
3225
3220 /* if we just finished scan ask for delay */ 3226 /* if we just finished scan ask for delay */
3221 if (iwl_is_associated(priv) && priv->last_scan_jiffies && 3227 if (iwl_is_associated(priv) && priv->last_scan_jiffies &&
3222 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) { 3228 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) {
3223 IWL_DEBUG_SCAN("scan rejected: within previous scan period\n"); 3229 IWL_DEBUG_SCAN("scan rejected: within previous scan period\n");
3224 ret = -EAGAIN; 3230 queue_work(priv->workqueue, &priv->scan_completed);
3231 ret = 0;
3225 goto out_unlock; 3232 goto out_unlock;
3226 } 3233 }
3234
3227 if (ssid_len) { 3235 if (ssid_len) {
3228 priv->one_direct_scan = 1; 3236 priv->one_direct_scan = 1;
3229 priv->direct_ssid_len = min_t(u8, ssid_len, IW_ESSID_MAX_SIZE); 3237 priv->direct_ssid_len = min_t(u8, ssid_len, IW_ESSID_MAX_SIZE);