aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-06-30 05:23:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-30 17:37:44 -0400
commita9efa652cbfead13bbe200878f8a2d74f3543e1b (patch)
treed8f42b1a09053750c0f74710232669a95da33134
parent154b25ce9218fbe6eebacef7907fabf6d663e639 (diff)
iwlwifi: clean up HW RF-kill state machine and restarts
This patch cleans up HW RF-kill state machine. Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c12
2 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 08a42a70962..eee220cf52a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1407,7 +1407,14 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
1407 spin_lock_irqsave(&priv->lock, flags); 1407 spin_lock_irqsave(&priv->lock, flags);
1408 iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); 1408 iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
1409 1409
1410 clear_bit(STATUS_RF_KILL_SW, &priv->status); 1410 /* If the driver is up it will receive CARD_STATE_NOTIFICATION
1411 * notification where it will clear SW rfkill status.
1412 * Setting it here would break the handler. Only if the
1413 * interface is down we can set here since we don't
1414 * receive any further notification.
1415 */
1416 if (!priv->is_open)
1417 clear_bit(STATUS_RF_KILL_SW, &priv->status);
1411 spin_unlock_irqrestore(&priv->lock, flags); 1418 spin_unlock_irqrestore(&priv->lock, flags);
1412 1419
1413 /* wake up ucode */ 1420 /* wake up ucode */
@@ -1425,8 +1432,10 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
1425 return 0; 1432 return 0;
1426 } 1433 }
1427 1434
1428 if (priv->is_open) 1435 /* If the driver is already loaded, it will receive
1429 queue_work(priv->workqueue, &priv->restart); 1436 * CARD_STATE_NOTIFICATION notifications and the handler will
1437 * call restart to reload the driver.
1438 */
1430 return 1; 1439 return 1;
1431} 1440}
1432EXPORT_SYMBOL(iwl_radio_kill_sw_enable_radio); 1441EXPORT_SYMBOL(iwl_radio_kill_sw_enable_radio);
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index e9b6f3099d8..a4aebe19600 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1606,14 +1606,12 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv)
1606 IWL_DEBUG(IWL_DL_RF_KILL, "RF_KILL bit toggled to %s.\n", 1606 IWL_DEBUG(IWL_DL_RF_KILL, "RF_KILL bit toggled to %s.\n",
1607 hw_rf_kill ? "disable radio":"enable radio"); 1607 hw_rf_kill ? "disable radio":"enable radio");
1608 1608
1609 /* Queue restart only if RF_KILL switch was set to "kill" 1609 /* driver only loads ucode once setting the interface up.
1610 * when we loaded driver, and is now set to "enable". 1610 * the driver as well won't allow loading if RFKILL is set
1611 * After we're Alive, RF_KILL gets handled by 1611 * therefore no need to restart the driver from this handler
1612 * iwl4965_rx_card_state_notif() */ 1612 */
1613 if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) { 1613 if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status))
1614 clear_bit(STATUS_RF_KILL_HW, &priv->status); 1614 clear_bit(STATUS_RF_KILL_HW, &priv->status);
1615 queue_work(priv->workqueue, &priv->restart);
1616 }
1617 1615
1618 handled |= CSR_INT_BIT_RF_KILL; 1616 handled |= CSR_INT_BIT_RF_KILL;
1619 } 1617 }