diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-04-06 07:12:42 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-04-16 16:47:37 -0400 |
commit | b6e4c55aaee4fd40526a6816e60c68dd62e565c4 (patch) | |
tree | 64bbff3fc159290e41173d0a227375eafe941943 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 811ecc995b18eb58067ffa75b961ece3b84a1f03 (diff) |
iwlwifi: trigger scan synchronously
Scan requesting doesn't need to be asynchronous
since all code paths leading up to it can sleep.
Make the scan request a new util operation that
is hw-specific (to account for 3945 vs. agn)
and call it right in place.
This patch moves a lot of code into iwlagn as
it need not be in iwlcore.
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/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 0f773973a4e5..06004d03f20b 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2790,11 +2790,8 @@ static void iwl3945_rfkill_poll(struct work_struct *data) | |||
2790 | 2790 | ||
2791 | } | 2791 | } |
2792 | 2792 | ||
2793 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) | 2793 | void iwl3945_request_scan(struct iwl_priv *priv) |
2794 | static void iwl3945_bg_request_scan(struct work_struct *data) | ||
2795 | { | 2794 | { |
2796 | struct iwl_priv *priv = | ||
2797 | container_of(data, struct iwl_priv, request_scan); | ||
2798 | struct iwl_host_cmd cmd = { | 2795 | struct iwl_host_cmd cmd = { |
2799 | .id = REPLY_SCAN_CMD, | 2796 | .id = REPLY_SCAN_CMD, |
2800 | .len = sizeof(struct iwl3945_scan_cmd), | 2797 | .len = sizeof(struct iwl3945_scan_cmd), |
@@ -2808,8 +2805,6 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
2808 | 2805 | ||
2809 | conf = ieee80211_get_hw_conf(priv->hw); | 2806 | conf = ieee80211_get_hw_conf(priv->hw); |
2810 | 2807 | ||
2811 | mutex_lock(&priv->mutex); | ||
2812 | |||
2813 | cancel_delayed_work(&priv->scan_check); | 2808 | cancel_delayed_work(&priv->scan_check); |
2814 | 2809 | ||
2815 | if (!iwl_is_ready(priv)) { | 2810 | if (!iwl_is_ready(priv)) { |
@@ -2992,7 +2987,6 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
2992 | queue_delayed_work(priv->workqueue, &priv->scan_check, | 2987 | queue_delayed_work(priv->workqueue, &priv->scan_check, |
2993 | IWL_SCAN_CHECK_WATCHDOG); | 2988 | IWL_SCAN_CHECK_WATCHDOG); |
2994 | 2989 | ||
2995 | mutex_unlock(&priv->mutex); | ||
2996 | return; | 2990 | return; |
2997 | 2991 | ||
2998 | done: | 2992 | done: |
@@ -3006,7 +3000,6 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
3006 | 3000 | ||
3007 | /* inform mac80211 scan aborted */ | 3001 | /* inform mac80211 scan aborted */ |
3008 | queue_work(priv->workqueue, &priv->scan_completed); | 3002 | queue_work(priv->workqueue, &priv->scan_completed); |
3009 | mutex_unlock(&priv->mutex); | ||
3010 | } | 3003 | } |
3011 | 3004 | ||
3012 | static void iwl3945_bg_restart(struct work_struct *data) | 3005 | static void iwl3945_bg_restart(struct work_struct *data) |
@@ -3785,7 +3778,6 @@ static void iwl3945_setup_deferred_work(struct iwl_priv *priv) | |||
3785 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); | 3778 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); |
3786 | INIT_DELAYED_WORK(&priv->_3945.rfkill_poll, iwl3945_rfkill_poll); | 3779 | INIT_DELAYED_WORK(&priv->_3945.rfkill_poll, iwl3945_rfkill_poll); |
3787 | INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed); | 3780 | INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed); |
3788 | INIT_WORK(&priv->request_scan, iwl3945_bg_request_scan); | ||
3789 | INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan); | 3781 | INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan); |
3790 | INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check); | 3782 | INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check); |
3791 | 3783 | ||