Re: [2.6.26-rc5] iwlwifi 4965 not working - last on 2.6.23

Zhu Yi
2008-06-24T02:42:22Z

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

On Mon, 2008-06-23 at 21:03 +0200, Michał Kudła wrote:
>
> I attached files form console log and dmesg
> console-rfkill-0.txt
> dmesg-2.6.26-rc7_2008-06-23-rfkill-0.txt
> console-rfkill-1.txt
> dmesg-2.6.26-rc7_2008-06-23-rfkill-1.txt

Please try attached patch.

Thanks,
-yi

[-- Attachment #2: linux-2.6.26-rc7-sw-rfkill.patch --]
[-- Type: text/x-patch, Size: 1525 bytes --]

diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 883b42f..39cab88 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -2444,7 +2444,8 @@ void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
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 (!priv->is_open)
+ clear_bit(STATUS_RF_KILL_SW, &priv->status);
spin_unlock_irqrestore(&priv->lock, flags);

/* wake up ucode */
@@ -2462,7 +2463,6 @@ void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
return;
}

- queue_work(priv->workqueue, &priv->restart);
return;
}

@@ -5534,13 +5534,15 @@ static int __iwl4965_up(struct iwl_priv *priv)
if (iwl_read32(priv, CSR_GP_CNTRL) &
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
clear_bit(STATUS_RF_KILL_HW, &priv->status);
- else {
+ else
set_bit(STATUS_RF_KILL_HW, &priv->status);
- if (!test_bit(STATUS_IN_SUSPEND, &priv->status)) {
- iwl_rfkill_set_hw_state(priv);
- IWL_WARNING("Radio disabled by HW RF Kill switch\n");
- return -ENODEV;
- }
+
+ if (!test_bit(STATUS_IN_SUSPEND, &priv->status) &&
+ iwl_is_rfkill(priv)) {
+ iwl_rfkill_set_hw_state(priv);
+ IWL_WARNING("Radio disabled by %s RF Kill switch\n",
+ test_bit(STATUS_RF_KILL_HW, &priv->status) ? "HW" : "SW");
+ return -ENODEV;
}

iwl_rfkill_set_hw_state(priv);