[PATCH 1/1] SRU: UBUNTU: iwlagn -- fix rfkill when on when driver loaded

Andy Whitcroft apw at canonical.com
Fri Nov 14 01:04:01 UTC 2008


From: Mohamed Abbas <mohamed.abbas at intel.com>

OriginalAuthor: Mohamed Abbas <mohamed.abbas at intel.com>
Bug: #193970

When the iwlagn driver is loaded and the rfkill switch is already on
then we do not start notifications.  This prevents the switch enabling
wireless.

This patch is currently on its way upstream.  This has been tested on an
iwl5300.  Proposing this fix for SRU for Intrepid.

Signed-off-by: Andy Whitcroft <apw at canonical.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn.c  |    5 ++++-
 drivers/net/wireless/iwlwifi/iwl-core.c |   10 ++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index c00b25d..36aeb15 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1656,8 +1656,11 @@ static void iwl4965_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;
 	}
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 1383fd1..22987f4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1435,6 +1435,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.
-- 
1.5.6.3





More information about the kernel-team mailing list