aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-08-21 16:34:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:39 -0400
commit5bddf54962bf68002816df710348ba197d6391bb (patch)
tree7bbe9c00977636a8f5645e5e46c1f4c64a233f11
parentb2ccb4dbe77eaebb6b286402c31b4e2b1155660f (diff)
iwlwifi: fix unloading driver while scanning
If NetworkManager is busy scanning when user tries to unload the module, the driver can not be unloaded because HW still scanning. Make sure driver sends abort scan host command to uCode if it is in the middle of scanning during driver unload. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 533b393e8cf6..00457bff1ed1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2155,7 +2155,7 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
2155 2155
2156 priv->is_open = 0; 2156 priv->is_open = 0;
2157 2157
2158 if (iwl_is_ready_rf(priv)) { 2158 if (iwl_is_ready_rf(priv) || test_bit(STATUS_SCAN_HW, &priv->status)) {
2159 /* stop mac, cancel any scan request and clear 2159 /* stop mac, cancel any scan request and clear
2160 * RXON_FILTER_ASSOC_MSK BIT 2160 * RXON_FILTER_ASSOC_MSK BIT
2161 */ 2161 */
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index c4c916df4a43..4f3a108fa990 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -796,7 +796,8 @@ void iwl_bg_abort_scan(struct work_struct *work)
796{ 796{
797 struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan); 797 struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);
798 798
799 if (!iwl_is_ready(priv)) 799 if (!test_bit(STATUS_READY, &priv->status) ||
800 !test_bit(STATUS_GEO_CONFIGURED, &priv->status))
800 return; 801 return;
801 802
802 mutex_lock(&priv->mutex); 803 mutex_lock(&priv->mutex);