Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170935
b: refs/heads/master
c: 743cdf1
h: refs/heads/master
i:
  170933: 6dc080d
  170931: 441ebe7
  170927: 65c98f9
v: v3
  • Loading branch information
Ben Cahill authored and John W. Linville committed Oct 27, 2009
1 parent 8d614b9 commit 988f440
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1a34c043802a213e719420ece395cf25c85cc7c5
refs/heads/master: 743cdf1b65656faf1e6f1f74278c52b89a0b7360
27 changes: 21 additions & 6 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2717,19 +2717,34 @@ static void iwl3945_bg_alive_start(struct work_struct *data)
mutex_unlock(&priv->mutex);
}

/*
* 3945 cannot interrupt driver when hardware rf kill switch toggles;
* driver must poll CSR_GP_CNTRL_REG register for change. This register
* *is* readable even when device has been SW_RESET into low power mode
* (e.g. during RF KILL).
*/
static void iwl3945_rfkill_poll(struct work_struct *data)
{
struct iwl_priv *priv =
container_of(data, struct iwl_priv, rfkill_poll.work);
bool old_rfkill = test_bit(STATUS_RF_KILL_HW, &priv->status);
bool new_rfkill = !(iwl_read32(priv, CSR_GP_CNTRL)
& CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);

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
set_bit(STATUS_RF_KILL_HW, &priv->status);
if (new_rfkill != old_rfkill) {
if (new_rfkill)
set_bit(STATUS_RF_KILL_HW, &priv->status);
else
clear_bit(STATUS_RF_KILL_HW, &priv->status);

wiphy_rfkill_set_hw_state(priv->hw->wiphy,
test_bit(STATUS_RF_KILL_HW, &priv->status));
wiphy_rfkill_set_hw_state(priv->hw->wiphy, new_rfkill);

IWL_DEBUG_RF_KILL(priv, "RF_KILL bit toggled to %s.\n",
new_rfkill ? "disable radio" : "enable radio");
}

/* Keep this running, even if radio now enabled. This will be
* cancelled in mac_start() if system decides to start again */
queue_delayed_work(priv->workqueue, &priv->rfkill_poll,
round_jiffies_relative(2 * HZ));

Expand Down

0 comments on commit 988f440

Please sign in to comment.