diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-05-18 05:29:13 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-06-06 02:20:08 -0400 |
commit | f84b29ec0a1ab767679d3f2428877b65f94bc3ff (patch) | |
tree | a507271a8575e324872929484a73512d3af578bd /drivers/net/wireless/iwlwifi/iwl-scan.c | |
parent | 0e1654fa2b91324ab91019c7dfabf3518aca54dd (diff) |
iwlwifi: queue user-initiated scan when doing internal scan
The internal scanning created a problem where
when userspace tries to scan, the scan gets
rejected. Instead of doing that, queue up the
user-initiated scan when doing an internal
scan.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 0f9cbc23b33..b8bcd48eb8f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -333,7 +333,8 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw, | |||
333 | goto out_unlock; | 333 | goto out_unlock; |
334 | } | 334 | } |
335 | 335 | ||
336 | if (test_bit(STATUS_SCANNING, &priv->status)) { | 336 | if (test_bit(STATUS_SCANNING, &priv->status) && |
337 | !priv->is_internal_short_scan) { | ||
337 | IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); | 338 | IWL_DEBUG_SCAN(priv, "Scan already in progress.\n"); |
338 | ret = -EAGAIN; | 339 | ret = -EAGAIN; |
339 | goto out_unlock; | 340 | goto out_unlock; |
@@ -348,8 +349,16 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw, | |||
348 | /* mac80211 will only ask for one band at a time */ | 349 | /* mac80211 will only ask for one band at a time */ |
349 | priv->scan_band = req->channels[0]->band; | 350 | priv->scan_band = req->channels[0]->band; |
350 | priv->scan_request = req; | 351 | priv->scan_request = req; |
352 | priv->scan_vif = vif; | ||
351 | 353 | ||
352 | ret = iwl_scan_initiate(priv, vif); | 354 | /* |
355 | * If an internal scan is in progress, just set | ||
356 | * up the scan_request as per above. | ||
357 | */ | ||
358 | if (priv->is_internal_short_scan) | ||
359 | ret = 0; | ||
360 | else | ||
361 | ret = iwl_scan_initiate(priv, vif); | ||
353 | 362 | ||
354 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 363 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
355 | 364 | ||
@@ -513,7 +522,21 @@ void iwl_bg_scan_completed(struct work_struct *work) | |||
513 | priv->is_internal_short_scan = false; | 522 | priv->is_internal_short_scan = false; |
514 | IWL_DEBUG_SCAN(priv, "internal short scan completed\n"); | 523 | IWL_DEBUG_SCAN(priv, "internal short scan completed\n"); |
515 | internal = true; | 524 | internal = true; |
525 | } else { | ||
526 | priv->scan_request = NULL; | ||
527 | priv->scan_vif = NULL; | ||
516 | } | 528 | } |
529 | |||
530 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
531 | goto out; | ||
532 | |||
533 | if (internal && priv->scan_request) | ||
534 | iwl_scan_initiate(priv, priv->scan_vif); | ||
535 | |||
536 | /* Since setting the TXPOWER may have been deferred while | ||
537 | * performing the scan, fire one off */ | ||
538 | iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); | ||
539 | out: | ||
517 | mutex_unlock(&priv->mutex); | 540 | mutex_unlock(&priv->mutex); |
518 | 541 | ||
519 | /* | 542 | /* |
@@ -523,15 +546,6 @@ void iwl_bg_scan_completed(struct work_struct *work) | |||
523 | */ | 546 | */ |
524 | if (!internal) | 547 | if (!internal) |
525 | ieee80211_scan_completed(priv->hw, false); | 548 | ieee80211_scan_completed(priv->hw, false); |
526 | |||
527 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
528 | return; | ||
529 | |||
530 | /* Since setting the TXPOWER may have been deferred while | ||
531 | * performing the scan, fire one off */ | ||
532 | mutex_lock(&priv->mutex); | ||
533 | iwl_set_tx_power(priv, priv->tx_power_user_lmt, true); | ||
534 | mutex_unlock(&priv->mutex); | ||
535 | } | 549 | } |
536 | EXPORT_SYMBOL(iwl_bg_scan_completed); | 550 | EXPORT_SYMBOL(iwl_bg_scan_completed); |
537 | 551 | ||