From bb342bfe614743e9536251dfd91bea198397066e Mon Sep 17 00:00:00 2001 From: Emmanuel Grumbach Date: Mon, 30 Jun 2008 17:23:25 +0800 Subject: [PATCH] --- yaml --- r: 103295 b: refs/heads/master c: a9efa652cbfead13bbe200878f8a2d74f3543e1b h: refs/heads/master i: 103293: 5e4634dd63ea8f9f9ccec0b1b19c64c5d423844e 103291: f81fd57a5cd6f60cc2e1b49e50bec8fd93ab75e0 103287: 39c8b376eb18167dd3549bfa89d580b04cb67d76 103279: d1879dc0987ed946f75007e4a5a3169454293bec 103263: 2ef90a685b400bb003763ce92493d79595480b9b 103231: 1bed8fefe54a56a1dedb12e91bffc0740047281a 103167: f0c8ccd781c743f5062e36d46983167dd3d97e69 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/iwlwifi/iwl-core.c | 15 ++++++++++++--- trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c | 12 +++++------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 1ba10f0bacaa..51d76bf5249b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 154b25ce9218fbe6eebacef7907fabf6d663e639 +refs/heads/master: a9efa652cbfead13bbe200878f8a2d74f3543e1b diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c index 08a42a70962e..eee220cf52a2 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c @@ -1407,7 +1407,14 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv) spin_lock_irqsave(&priv->lock, flags); iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); - clear_bit(STATUS_RF_KILL_SW, &priv->status); + /* If the driver is up it will receive CARD_STATE_NOTIFICATION + * notification where it will clear SW rfkill status. + * Setting it here would break the handler. Only if the + * interface is down we can set here since we don't + * receive any further notification. + */ + if (!priv->is_open) + clear_bit(STATUS_RF_KILL_SW, &priv->status); spin_unlock_irqrestore(&priv->lock, flags); /* wake up ucode */ @@ -1425,8 +1432,10 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv) return 0; } - if (priv->is_open) - queue_work(priv->workqueue, &priv->restart); + /* If the driver is already loaded, it will receive + * CARD_STATE_NOTIFICATION notifications and the handler will + * call restart to reload the driver. + */ return 1; } EXPORT_SYMBOL(iwl_radio_kill_sw_enable_radio); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c b/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c index e9b6f3099d8e..a4aebe196003 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c @@ -1606,14 +1606,12 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv) IWL_DEBUG(IWL_DL_RF_KILL, "RF_KILL bit toggled to %s.\n", hw_rf_kill ? "disable radio":"enable radio"); - /* Queue restart only if RF_KILL switch was set to "kill" - * when we loaded driver, and is now set to "enable". - * After we're Alive, RF_KILL gets handled by - * iwl4965_rx_card_state_notif() */ - if (!hw_rf_kill && !test_bit(STATUS_ALIVE, &priv->status)) { + /* driver only loads ucode once setting the interface up. + * 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)) clear_bit(STATUS_RF_KILL_HW, &priv->status); - queue_work(priv->workqueue, &priv->restart); - } handled |= CSR_INT_BIT_RF_KILL; }