diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-11-06 19:36:21 +0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-11-09 23:55:14 +0400 |
commit | d18aa87fbfe80f33076942d11f19c9d813e835b1 (patch) | |
tree | ac66e526137a249ba4c2a825111db6387dcb32d5 /drivers/net/wireless/iwlwifi/pcie/tx.c | |
parent | 2e6e6b1f3f6ca4903f2b2a8e8ac764e5cef2e7a8 (diff) | |
download | linux-d18aa87fbfe80f33076942d11f19c9d813e835b1.tar.xz |
iwlwifi: return commands with error on FW error
When a firmware error occurs, don't just abort synchronous
commands but also return an error (-EIO) and block any new
commands as well. Currently, an error is only returned if
WANT_SKB was set which is confusing and can lead to issues.
Blocking is done until a new firmware image is loaded.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/tx.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index ae73bd3944e8..dcc7e1256e39 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c @@ -915,6 +915,13 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd) } } + if (test_bit(STATUS_FW_ERROR, &trans_pcie->status)) { + IWL_ERR(trans, "FW error in SYNC CMD %s\n", + trans_pcie_get_cmd_string(trans_pcie, cmd->id)); + ret = -EIO; + goto cancel; + } + if (test_bit(STATUS_RFKILL, &trans_pcie->status)) { IWL_DEBUG_RF_KILL(trans, "RFKILL in SYNC CMD... no rsp\n"); ret = -ERFKILL; @@ -954,6 +961,9 @@ int iwl_trans_pcie_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) { struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); + if (test_bit(STATUS_FW_ERROR, &trans_pcie->status)) + return -EIO; + if (test_bit(STATUS_RFKILL, &trans_pcie->status)) return -ERFKILL; |