aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-09-22 18:14:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-27 14:34:09 -0400
commitf253247a944fcf5f48ca434331d9e4f72f5fef8d (patch)
tree1a86e468fc87aed6b89f487badce48c93448c1a7 /drivers/net
parent98efb4a52b5c64c79647ea4fdb2c6a3f3db6e743 (diff)
iwlagn: refactor scan complete
We'll need to be able to run scan complete inline, not from the workqueue, so refactor it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index d9596ba39b82..30100220ce2b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -1013,18 +1013,14 @@ static void iwl_bg_abort_scan(struct work_struct *work)
1013 mutex_unlock(&priv->shrd->mutex); 1013 mutex_unlock(&priv->shrd->mutex);
1014} 1014}
1015 1015
1016static void iwl_bg_scan_completed(struct work_struct *work) 1016static void iwl_process_scan_complete(struct iwl_priv *priv)
1017{ 1017{
1018 struct iwl_priv *priv =
1019 container_of(work, struct iwl_priv, scan_completed);
1020 bool aborted; 1018 bool aborted;
1021 1019
1022 IWL_DEBUG_SCAN(priv, "Completed scan.\n"); 1020 IWL_DEBUG_SCAN(priv, "Completed scan.\n");
1023 1021
1024 cancel_delayed_work(&priv->scan_check); 1022 cancel_delayed_work(&priv->scan_check);
1025 1023
1026 mutex_lock(&priv->shrd->mutex);
1027
1028 aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->shrd->status); 1024 aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->shrd->status);
1029 if (aborted) 1025 if (aborted)
1030 IWL_DEBUG_SCAN(priv, "Aborted scan completed.\n"); 1026 IWL_DEBUG_SCAN(priv, "Aborted scan completed.\n");
@@ -1057,7 +1053,7 @@ static void iwl_bg_scan_completed(struct work_struct *work)
1057 goto out_complete; 1053 goto out_complete;
1058 } 1054 }
1059 1055
1060 goto out; 1056 return;
1061 } 1057 }
1062 1058
1063out_complete: 1059out_complete:
@@ -1066,11 +1062,18 @@ out_complete:
1066out_settings: 1062out_settings:
1067 /* Can we still talk to firmware ? */ 1063 /* Can we still talk to firmware ? */
1068 if (!iwl_is_ready_rf(priv->shrd)) 1064 if (!iwl_is_ready_rf(priv->shrd))
1069 goto out; 1065 return;
1070 1066
1071 iwlagn_post_scan(priv); 1067 iwlagn_post_scan(priv);
1068}
1069
1070static void iwl_bg_scan_completed(struct work_struct *work)
1071{
1072 struct iwl_priv *priv =
1073 container_of(work, struct iwl_priv, scan_completed);
1072 1074
1073out: 1075 mutex_lock(&priv->shrd->mutex);
1076 iwl_process_scan_complete(priv);
1074 mutex_unlock(&priv->shrd->mutex); 1077 mutex_unlock(&priv->shrd->mutex);
1075} 1078}
1076 1079