iwlwifi: fix unloading driver while scanning
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 21 Aug 2009 20:34:25 +0000 (13:34 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Aug 2009 18:40:39 +0000 (14:40 -0400)
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>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-scan.c

index 533b393e8cf64875aec74aa3c003f8b1d7cef3a4..00457bff1ed157c04a235af371daabddd2848ec8 100644 (file)
@@ -2155,7 +2155,7 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
 
        priv->is_open = 0;
 
-       if (iwl_is_ready_rf(priv)) {
+       if (iwl_is_ready_rf(priv) || test_bit(STATUS_SCAN_HW, &priv->status)) {
                /* stop mac, cancel any scan request and clear
                 * RXON_FILTER_ASSOC_MSK BIT
                 */
index c4c916df4a435595966d7f1caeecc79d089c790f..4f3a108fa9901e1c9ee314ea59020838dfb99120 100644 (file)
@@ -796,7 +796,8 @@ void iwl_bg_abort_scan(struct work_struct *work)
 {
        struct iwl_priv *priv = container_of(work, struct iwl_priv, abort_scan);
 
-       if (!iwl_is_ready(priv))
+       if (!test_bit(STATUS_READY, &priv->status) ||
+           !test_bit(STATUS_GEO_CONFIGURED, &priv->status))
                return;
 
        mutex_lock(&priv->mutex);