diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-12-24 04:10:43 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 09:28:16 -0500 |
commit | 6ae02f3ef7f20af0237e21a979f66b13198921da (patch) | |
tree | f2d63c5b6880b8ea7d8c460ff46b4a98b2d05c1e /drivers | |
parent | d28cbdef8cb7ea04d5ef7c9d7b14df0751560522 (diff) |
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: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/ucode.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/ucode.c b/drivers/net/wireless/iwlwifi/dvm/ucode.c index ecf700bf9842..ebec13a3329f 100644 --- a/drivers/net/wireless/iwlwifi/dvm/ucode.c +++ b/drivers/net/wireless/iwlwifi/dvm/ucode.c | |||
@@ -343,7 +343,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv, | |||
343 | alive_cmd, ARRAY_SIZE(alive_cmd), | 343 | alive_cmd, ARRAY_SIZE(alive_cmd), |
344 | iwl_alive_fn, &alive_data); | 344 | iwl_alive_fn, &alive_data); |
345 | 345 | ||
346 | ret = iwl_trans_start_fw(priv->trans, fw); | 346 | ret = iwl_trans_start_fw(priv->trans, fw, false); |
347 | if (ret) { | 347 | if (ret) { |
348 | priv->cur_ucode = old_type; | 348 | priv->cur_ucode = old_type; |
349 | iwl_remove_notification(&priv->notif_wait, &alive_wait); | 349 | iwl_remove_notification(&priv->notif_wait, &alive_wait); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 15b4700d2a2f..16a82b5a4671 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -399,7 +399,8 @@ struct iwl_trans_ops { | |||
399 | 399 | ||
400 | int (*start_hw)(struct iwl_trans *iwl_trans); | 400 | int (*start_hw)(struct iwl_trans *iwl_trans); |
401 | void (*stop_hw)(struct iwl_trans *iwl_trans, bool op_mode_leaving); | 401 | void (*stop_hw)(struct iwl_trans *iwl_trans, bool op_mode_leaving); |
402 | int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw); | 402 | int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw, |
403 | bool run_in_rfkill); | ||
403 | void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr); | 404 | void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr); |
404 | void (*stop_device)(struct iwl_trans *trans); | 405 | void (*stop_device)(struct iwl_trans *trans); |
405 | 406 | ||
@@ -531,13 +532,14 @@ static inline void iwl_trans_fw_alive(struct iwl_trans *trans, u32 scd_addr) | |||
531 | } | 532 | } |
532 | 533 | ||
533 | static inline int iwl_trans_start_fw(struct iwl_trans *trans, | 534 | static inline int iwl_trans_start_fw(struct iwl_trans *trans, |
534 | const struct fw_img *fw) | 535 | const struct fw_img *fw, |
536 | bool run_in_rfkill) | ||
535 | { | 537 | { |
536 | might_sleep(); | 538 | might_sleep(); |
537 | 539 | ||
538 | WARN_ON_ONCE(!trans->rx_mpdu_cmd); | 540 | WARN_ON_ONCE(!trans->rx_mpdu_cmd); |
539 | 541 | ||
540 | return trans->ops->start_fw(trans, fw); | 542 | return trans->ops->start_fw(trans, fw, run_in_rfkill); |
541 | } | 543 | } |
542 | 544 | ||
543 | static inline void iwl_trans_stop_device(struct iwl_trans *trans) | 545 | static inline void iwl_trans_stop_device(struct iwl_trans *trans) |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index ab179ce36de5..e67e179bd04b 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -435,7 +435,7 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans, | |||
435 | } | 435 | } |
436 | 436 | ||
437 | static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, | 437 | static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, |
438 | const struct fw_img *fw) | 438 | const struct fw_img *fw, bool run_in_rfkill) |
439 | { | 439 | { |
440 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 440 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
441 | int ret; | 441 | int ret; |
@@ -454,7 +454,7 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, | |||
454 | /* If platform's RF_KILL switch is NOT set to KILL */ | 454 | /* If platform's RF_KILL switch is NOT set to KILL */ |
455 | hw_rfkill = iwl_is_rfkill_set(trans); | 455 | hw_rfkill = iwl_is_rfkill_set(trans); |
456 | iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); | 456 | iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); |
457 | if (hw_rfkill) | 457 | if (hw_rfkill && !run_in_rfkill) |
458 | return -ERFKILL; | 458 | return -ERFKILL; |
459 | 459 | ||
460 | iwl_write32(trans, CSR_INT, 0xFFFFFFFF); | 460 | iwl_write32(trans, CSR_INT, 0xFFFFFFFF); |