iwlwifi: fix resume while txpower off
authorMohamed Abbas <mohamed.abbas@intel.com>
Thu, 11 Dec 2008 18:33:37 +0000 (10:33 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 12 Dec 2008 19:45:35 +0000 (14:45 -0500)
This patch take care of coming out rfkill when the driver is up while
rfkill is on by restarting interface.

Signed-off-by: Mohamed Abbas <mohamed.abbas@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-core.c

index 06e2682450772d45036ddf0c58f1ec5fc96b8c2d..cc4b6eba8a11435194e7606b87edc5336959f79c 100644 (file)
@@ -1402,8 +1402,11 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
                 * the driver as well won't allow loading if RFKILL is set
                 * therefore no need to restart the driver from this handler
                 */
-               if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status))
+               if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) {
                        clear_bit(STATUS_RF_KILL_HW, &priv->status);
+                       if (priv->is_open && !iwl_is_rfkill(priv))
+                               queue_work(priv->workqueue, &priv->up);
+               }
 
                handled |= CSR_INT_BIT_RF_KILL;
        }
index 6fc395092dfea8cb5885fb6c665a0faeb9ce4f91..ced79112ed01a11eda73e0ce371e32f3e3611c44 100644 (file)
@@ -1446,6 +1446,16 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
                return 0;
        }
 
+       /* when driver is up while rfkill is on, it wont receive
+        * any CARD_STATE_NOTIFICATION notifications so we have to
+        * restart it in here
+        */
+       if (priv->is_open && !test_bit(STATUS_ALIVE, &priv->status)) {
+               clear_bit(STATUS_RF_KILL_SW, &priv->status);
+               if (!iwl_is_rfkill(priv))
+                       queue_work(priv->workqueue, &priv->up);
+       }
+
        /* If the driver is already loaded, it will receive
         * CARD_STATE_NOTIFICATION notifications and the handler will
         * call restart to reload the driver.