diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 501477464e07..dd9ff2ed645a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -469,21 +469,6 @@ EXPORT_SYMBOL(iwl_init_scan_params); | |||
469 | 469 | ||
470 | static int iwl_scan_initiate(struct iwl_priv *priv) | 470 | static int iwl_scan_initiate(struct iwl_priv *priv) |
471 | { | 471 | { |
472 | if (!iwl_is_ready_rf(priv)) { | ||
473 | IWL_DEBUG_SCAN(priv, "Aborting scan due to not ready.\n"); | ||
474 | return -EIO; | ||
475 | } | ||
476 | |||
477 | if (test_bit(STATUS_SCANNING, &priv->status)) { | ||
478 | IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); | ||
479 | return -EAGAIN; | ||
480 | } | ||
481 | |||
482 | if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { | ||
483 | IWL_DEBUG_SCAN(priv, "Scan request while abort pending\n"); | ||
484 | return -EAGAIN; | ||
485 | } | ||
486 | |||
487 | IWL_DEBUG_INFO(priv, "Starting scan...\n"); | 472 | IWL_DEBUG_INFO(priv, "Starting scan...\n"); |
488 | set_bit(STATUS_SCANNING, &priv->status); | 473 | set_bit(STATUS_SCANNING, &priv->status); |
489 | priv->is_internal_short_scan = false; | 474 | priv->is_internal_short_scan = false; |
@@ -515,6 +500,18 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw, | |||
515 | goto out_unlock; | 500 | goto out_unlock; |
516 | } | 501 | } |
517 | 502 | ||
503 | if (test_bit(STATUS_SCANNING, &priv->status)) { | ||
504 | IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); | ||
505 | ret = -EAGAIN; | ||
506 | goto out_unlock; | ||
507 | } | ||
508 | |||
509 | if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { | ||
510 | IWL_DEBUG_SCAN(priv, "Scan request while abort pending\n"); | ||
511 | ret = -EAGAIN; | ||
512 | goto out_unlock; | ||
513 | } | ||
514 | |||
518 | /* We don't schedule scan within next_scan_jiffies period. | 515 | /* We don't schedule scan within next_scan_jiffies period. |
519 | * Avoid scanning during possible EAPOL exchange, return | 516 | * Avoid scanning during possible EAPOL exchange, return |
520 | * success immediately. | 517 | * success immediately. |