diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-09-13 08:46:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-14 16:08:03 -0400 |
commit | d5926d9d6a183d109060f68c0b96ea2b33c15377 (patch) | |
tree | c6858f115c5261ae8bfc4cdc112867af5715f1c7 /drivers | |
parent | 3eecce527c7434dfd16517ce08b49632c8a26717 (diff) |
iwlwifi: move scan completed flags handling
Move the scan completed flags handling so that we
can notify mac80211 about aborted scans with the
correct status. Also queue the scan_completed work
before the BT status update so that it won't see
the bits still set (unless a new scan was started
in which case that's fine.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 6bd14bc33478..22bdc986c03e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -222,21 +222,11 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, | |||
222 | jiffies_to_msecs(elapsed_jiffies | 222 | jiffies_to_msecs(elapsed_jiffies |
223 | (priv->scan_start, jiffies))); | 223 | (priv->scan_start, jiffies))); |
224 | 224 | ||
225 | /* | 225 | queue_work(priv->workqueue, &priv->scan_completed); |
226 | * If a request to abort was given, or the scan did not succeed | ||
227 | * then we reset the scan state machine and terminate, | ||
228 | * re-queuing another scan if one has been requested | ||
229 | */ | ||
230 | if (test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->status)) | ||
231 | IWL_DEBUG_INFO(priv, "Aborted scan completed.\n"); | ||
232 | |||
233 | IWL_DEBUG_INFO(priv, "Setting scan to off\n"); | ||
234 | |||
235 | clear_bit(STATUS_SCANNING, &priv->status); | ||
236 | 226 | ||
237 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC && | 227 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC && |
238 | priv->cfg->advanced_bt_coexist && priv->bt_status != | 228 | priv->cfg->advanced_bt_coexist && |
239 | scan_notif->bt_status) { | 229 | priv->bt_status != scan_notif->bt_status) { |
240 | if (scan_notif->bt_status) { | 230 | if (scan_notif->bt_status) { |
241 | /* BT on */ | 231 | /* BT on */ |
242 | if (!priv->bt_ch_announce) | 232 | if (!priv->bt_ch_announce) |
@@ -254,7 +244,6 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, | |||
254 | priv->bt_status = scan_notif->bt_status; | 244 | priv->bt_status = scan_notif->bt_status; |
255 | queue_work(priv->workqueue, &priv->bt_traffic_change_work); | 245 | queue_work(priv->workqueue, &priv->bt_traffic_change_work); |
256 | } | 246 | } |
257 | queue_work(priv->workqueue, &priv->scan_completed); | ||
258 | } | 247 | } |
259 | 248 | ||
260 | void iwl_setup_rx_scan_handlers(struct iwl_priv *priv) | 249 | void iwl_setup_rx_scan_handlers(struct iwl_priv *priv) |
@@ -554,7 +543,7 @@ static void iwl_bg_scan_completed(struct work_struct *work) | |||
554 | { | 543 | { |
555 | struct iwl_priv *priv = | 544 | struct iwl_priv *priv = |
556 | container_of(work, struct iwl_priv, scan_completed); | 545 | container_of(work, struct iwl_priv, scan_completed); |
557 | bool internal = false; | 546 | bool internal = false, aborted; |
558 | struct iwl_rxon_context *ctx; | 547 | struct iwl_rxon_context *ctx; |
559 | 548 | ||
560 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); | 549 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); |
@@ -562,6 +551,15 @@ static void iwl_bg_scan_completed(struct work_struct *work) | |||
562 | cancel_delayed_work(&priv->scan_check); | 551 | cancel_delayed_work(&priv->scan_check); |
563 | 552 | ||
564 | mutex_lock(&priv->mutex); | 553 | mutex_lock(&priv->mutex); |
554 | |||
555 | aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->status); | ||
556 | if (aborted) | ||
557 | IWL_DEBUG_INFO(priv, "Aborted scan completed.\n"); | ||
558 | |||
559 | IWL_DEBUG_INFO(priv, "Setting scan to off\n"); | ||
560 | |||
561 | clear_bit(STATUS_SCANNING, &priv->status); | ||
562 | |||
565 | if (priv->is_internal_short_scan) { | 563 | if (priv->is_internal_short_scan) { |
566 | priv->is_internal_short_scan = false; | 564 | priv->is_internal_short_scan = false; |
567 | IWL_DEBUG_SCAN(priv, "internal short scan completed\n"); | 565 | IWL_DEBUG_SCAN(priv, "internal short scan completed\n"); |
@@ -569,7 +567,7 @@ static void iwl_bg_scan_completed(struct work_struct *work) | |||
569 | } else if (priv->scan_request) { | 567 | } else if (priv->scan_request) { |
570 | priv->scan_request = NULL; | 568 | priv->scan_request = NULL; |
571 | priv->scan_vif = NULL; | 569 | priv->scan_vif = NULL; |
572 | ieee80211_scan_completed(priv->hw, false); | 570 | ieee80211_scan_completed(priv->hw, aborted); |
573 | } | 571 | } |
574 | 572 | ||
575 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 573 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |