]> err.no Git - linux-2.6/commitdiff
iwlwifi: fix unload warning and error
authorMohamed Abbas <mabbas@linux.intel.com>
Tue, 15 Apr 2008 23:01:46 +0000 (16:01 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 Apr 2008 20:00:01 +0000 (16:00 -0400)
This patch fix the error we get when unload the driver, No space for Tx.
The cause of this problem is related to receiving late SW rfkill from
rfkill subsystem during the driver teardown causing this error.

Signed-off-by: Mohamed Abbas <mabbas@linux.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-rfkill.c
drivers/net/wireless/iwlwifi/iwl4965-base.c

index 8f38c24491cd06a16b08ae83b10f59c2695c73f0..5980a5621cb8de9d4afae1d47272f30c4effdb84 100644 (file)
@@ -47,6 +47,9 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
        if (!priv->rfkill_mngr.rfkill)
                return 0;
 
+       if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+               return 0;
+
        IWL_DEBUG_RF_KILL("we recieved soft RFKILL set to state %d\n", state);
        mutex_lock(&priv->mutex);
 
index 0eb4220f035ffb7f881aa60a753fb7168fd982f8..dae881e47293184ab15c6b33d795fc4261c21e0f 100644 (file)
@@ -2427,7 +2427,8 @@ void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
                                    CSR_UCODE_SW_BIT_RFKILL);
                        spin_unlock_irqrestore(&priv->lock, flags);
                        /* call the host command only if no hw rf-kill set */
-                       if (!test_bit(STATUS_RF_KILL_HW, &priv->status))
+                       if (!test_bit(STATUS_RF_KILL_HW, &priv->status) &&
+                           iwl_is_ready(priv))
                                iwl4965_send_card_state(priv,
                                                        CARD_STATE_CMD_DISABLE,
                                                        0);