Commit 6ae02f3e authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg

iwlwifi: let the op_mode run a FW while in RFKILL

In some cases, the fw should run even if the NIC is in
RFKILL. Make the API more flexible to allow that.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent d28cbdef
...@@ -343,7 +343,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, ...@@ -343,7 +343,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
alive_cmd, ARRAY_SIZE(alive_cmd), alive_cmd, ARRAY_SIZE(alive_cmd),
iwl_alive_fn, &alive_data); iwl_alive_fn, &alive_data);
ret = iwl_trans_start_fw(priv->trans, fw); ret = iwl_trans_start_fw(priv->trans, fw, false);
if (ret) { if (ret) {
priv->cur_ucode = old_type; priv->cur_ucode = old_type;
iwl_remove_notification(&priv->notif_wait, &alive_wait); iwl_remove_notification(&priv->notif_wait, &alive_wait);
......
...@@ -399,7 +399,8 @@ struct iwl_trans_ops { ...@@ -399,7 +399,8 @@ struct iwl_trans_ops {
int (*start_hw)(struct iwl_trans *iwl_trans); int (*start_hw)(struct iwl_trans *iwl_trans);
void (*stop_hw)(struct iwl_trans *iwl_trans, bool op_mode_leaving); void (*stop_hw)(struct iwl_trans *iwl_trans, bool op_mode_leaving);
int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw); int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw,
bool run_in_rfkill);
void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr); void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr);
void (*stop_device)(struct iwl_trans *trans); void (*stop_device)(struct iwl_trans *trans);
...@@ -531,13 +532,14 @@ static inline void iwl_trans_fw_alive(struct iwl_trans *trans, u32 scd_addr) ...@@ -531,13 +532,14 @@ static inline void iwl_trans_fw_alive(struct iwl_trans *trans, u32 scd_addr)
} }
static inline int iwl_trans_start_fw(struct iwl_trans *trans, static inline int iwl_trans_start_fw(struct iwl_trans *trans,
const struct fw_img *fw) const struct fw_img *fw,
bool run_in_rfkill)
{ {
might_sleep(); might_sleep();
WARN_ON_ONCE(!trans->rx_mpdu_cmd); WARN_ON_ONCE(!trans->rx_mpdu_cmd);
return trans->ops->start_fw(trans, fw); return trans->ops->start_fw(trans, fw, run_in_rfkill);
} }
static inline void iwl_trans_stop_device(struct iwl_trans *trans) static inline void iwl_trans_stop_device(struct iwl_trans *trans)
......
...@@ -435,7 +435,7 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans, ...@@ -435,7 +435,7 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans,
} }
static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
const struct fw_img *fw) const struct fw_img *fw, bool run_in_rfkill)
{ {
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
int ret; int ret;
...@@ -454,7 +454,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, ...@@ -454,7 +454,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
/* If platform's RF_KILL switch is NOT set to KILL */ /* If platform's RF_KILL switch is NOT set to KILL */
hw_rfkill = iwl_is_rfkill_set(trans); hw_rfkill = iwl_is_rfkill_set(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 && !run_in_rfkill)
return -ERFKILL; return -ERFKILL;
iwl_write32(trans, CSR_INT, 0xFFFFFFFF); iwl_write32(trans, CSR_INT, 0xFFFFFFFF);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment