aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-09-24 01:57:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-24 16:18:04 -0400
commit8d09a5e1c36d0dec5728e6c8b0bb5412de09b27b (patch)
tree4e98dfc3181fb2feebc37de9b2d61451797b72e0 /drivers/net/wireless
parent55d6a3cd0cc85ed90c39cf32e16f622bd003117b (diff)
iwlwifi: don't fail if scan is issued too early
This patch returns success and empty scan on scans requests that were rejected because issued too early. The cached bss list from previous scanning will be returned by mac80211. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c8
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index d069549a01c2..7330890fd05e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3190,9 +3190,9 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw,
3190 3190
3191static 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)
3192{ 3192{
3193 int ret;
3194 unsigned long flags; 3193 unsigned long flags;
3195 struct iwl_priv *priv = hw->priv; 3194 struct iwl_priv *priv = hw->priv;
3195 int ret;
3196 3196
3197 IWL_DEBUG_MAC80211("enter\n"); 3197 IWL_DEBUG_MAC80211("enter\n");
3198 3198
@@ -3211,20 +3211,27 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
3211 goto out_unlock; 3211 goto out_unlock;
3212 } 3212 }
3213 3213
3214 /* 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 */
3215 if (priv->next_scan_jiffies && 3218 if (priv->next_scan_jiffies &&
3216 time_after(priv->next_scan_jiffies, jiffies)) { 3219 time_after(priv->next_scan_jiffies, jiffies)) {
3217 IWL_DEBUG_SCAN("scan rejected: within next scan period\n"); 3220 IWL_DEBUG_SCAN("scan rejected: within next scan period\n");
3218 ret = -EAGAIN; 3221 queue_work(priv->workqueue, &priv->scan_completed);
3222 ret = 0;
3219 goto out_unlock; 3223 goto out_unlock;
3220 } 3224 }
3225
3221 /* if we just finished scan ask for delay */ 3226 /* if we just finished scan ask for delay */
3222 if (iwl_is_associated(priv) && priv->last_scan_jiffies && 3227 if (iwl_is_associated(priv) && priv->last_scan_jiffies &&
3223 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) { 3228 time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) {
3224 IWL_DEBUG_SCAN("scan rejected: within previous scan period\n"); 3229 IWL_DEBUG_SCAN("scan rejected: within previous scan period\n");
3225 ret = -EAGAIN; 3230 queue_work(priv->workqueue, &priv->scan_completed);
3231 ret = 0;
3226 goto out_unlock; 3232 goto out_unlock;
3227 } 3233 }
3234
3228 if (ssid_len) { 3235 if (ssid_len) {
3229 priv->one_direct_scan = 1; 3236 priv->one_direct_scan = 1;
3230 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);
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 09c264be0496..bf855c35b0c1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -463,11 +463,6 @@ void iwl_init_scan_params(struct iwl_priv *priv)
463 463
464int iwl_scan_initiate(struct iwl_priv *priv) 464int iwl_scan_initiate(struct iwl_priv *priv)
465{ 465{
466 if (priv->iw_mode == NL80211_IFTYPE_AP) {
467 IWL_ERROR("APs don't scan.\n");
468 return 0;
469 }
470
471 if (!iwl_is_ready_rf(priv)) { 466 if (!iwl_is_ready_rf(priv)) {
472 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n"); 467 IWL_DEBUG_SCAN("Aborting scan due to not ready.\n");
473 return -EIO; 468 return -EIO;
@@ -479,8 +474,7 @@ int iwl_scan_initiate(struct iwl_priv *priv)
479 } 474 }
480 475
481 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 476 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
482 IWL_DEBUG_SCAN("Scan request while abort pending. " 477 IWL_DEBUG_SCAN("Scan request while abort pending\n");
483 "Queuing.\n");
484 return -EAGAIN; 478 return -EAGAIN;
485 } 479 }
486 480