提交 8722c899 编写于 作者: S Stanislaw Gruszka 提交者: John W. Linville

iwlwifi: reintroduce iwl_enable_rfkill_int

If device is disabled by rfkill switch, do not enable all interrupts,
but only CSR_INT_BIT_RF_KILL to receive rfkill state change. Unblocking
other interrupts might cause problems, since driver can not be prepared
for receive them.
Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
Signed-off-by: NWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 c2945f39
...@@ -376,6 +376,12 @@ static inline void iwl_enable_interrupts(struct iwl_trans *trans) ...@@ -376,6 +376,12 @@ static inline void iwl_enable_interrupts(struct iwl_trans *trans)
iwl_write32(trans, CSR_INT_MASK, trans_pcie->inta_mask); iwl_write32(trans, CSR_INT_MASK, trans_pcie->inta_mask);
} }
static inline void iwl_enable_rfkill_int(struct iwl_trans *trans)
{
IWL_DEBUG_ISR(trans, "Enabling rfkill interrupt\n");
iwl_write32(trans, CSR_INT_MASK, CSR_INT_BIT_RF_KILL);
}
/* /*
* we have 8 bits used like this: * we have 8 bits used like this:
* *
......
...@@ -1134,10 +1134,8 @@ void iwl_irq_tasklet(struct iwl_trans *trans) ...@@ -1134,10 +1134,8 @@ void iwl_irq_tasklet(struct iwl_trans *trans)
if (test_bit(STATUS_INT_ENABLED, &trans->shrd->status)) if (test_bit(STATUS_INT_ENABLED, &trans->shrd->status))
iwl_enable_interrupts(trans); iwl_enable_interrupts(trans);
/* Re-enable RF_KILL if it occurred */ /* Re-enable RF_KILL if it occurred */
else if (handled & CSR_INT_BIT_RF_KILL) { else if (handled & CSR_INT_BIT_RF_KILL)
IWL_DEBUG_ISR(trans, "Enabling rfkill interrupt\n"); iwl_enable_rfkill_int(trans);
iwl_write32(trans, CSR_INT_MASK, CSR_INT_BIT_RF_KILL);
}
} }
/****************************************************************************** /******************************************************************************
......
...@@ -1044,7 +1044,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, ...@@ -1044,7 +1044,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
if (hw_rfkill) { if (hw_rfkill) {
iwl_enable_interrupts(trans); iwl_enable_rfkill_int(trans);
return -ERFKILL; return -ERFKILL;
} }
...@@ -1553,8 +1553,7 @@ static void iwl_trans_pcie_stop_hw(struct iwl_trans *trans) ...@@ -1553,8 +1553,7 @@ static void iwl_trans_pcie_stop_hw(struct iwl_trans *trans)
iwl_write32(trans, CSR_INT, 0xFFFFFFFF); iwl_write32(trans, CSR_INT, 0xFFFFFFFF);
/* Even if we stop the HW, we still want the RF kill interrupt */ /* Even if we stop the HW, we still want the RF kill interrupt */
IWL_DEBUG_ISR(trans, "Enabling rfkill interrupt\n"); iwl_enable_rfkill_int(trans);
iwl_write32(trans, CSR_INT_MASK, CSR_INT_BIT_RF_KILL);
} }
static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,
...@@ -1647,10 +1646,14 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans) ...@@ -1647,10 +1646,14 @@ static int iwl_trans_pcie_resume(struct iwl_trans *trans)
{ {
bool hw_rfkill; bool hw_rfkill;
iwl_enable_interrupts(trans);
hw_rfkill = !(iwl_read32(trans, CSR_GP_CNTRL) & hw_rfkill = !(iwl_read32(trans, CSR_GP_CNTRL) &
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW); CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
if (hw_rfkill)
iwl_enable_rfkill_int(trans);
else
iwl_enable_interrupts(trans);
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册