diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-12-01 13:45:37 +0200 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-12-13 08:52:53 +0200 |
commit | 92fe83430b899b786c837e5b716a328220d47ae5 (patch) | |
tree | 70a813f79e31df3ada7fd3d26647f1f9db996c52 /drivers/net/wireless/intel/iwlwifi/iwl-trans.c | |
parent | 156f92f2b4711a0e8478c596557a1bd5ca69b02d (diff) | |
download | linux-92fe83430b899b786c837e5b716a328220d47ae5.tar.bz2 |
iwlwifi: uninline iwl_trans_send_cmd
This function got too big to be inlined. Uninline it.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/iwl-trans.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c index ccd317b6408f..c3fafbc6b654 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c @@ -61,6 +61,7 @@ * *****************************************************************************/ #include <linux/kernel.h> +#include "iwl-drv.h" #include "iwl-trans.h" struct iwl_trans *iwl_trans_alloc(unsigned int priv_size, @@ -112,3 +113,35 @@ void iwl_trans_free(struct iwl_trans *trans) kmem_cache_destroy(trans->dev_cmd_pool); kfree(trans); } + +int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) +{ + int ret; + + if (unlikely(!(cmd->flags & CMD_SEND_IN_RFKILL) && + test_bit(STATUS_RFKILL, &trans->status))) + return -ERFKILL; + + if (unlikely(test_bit(STATUS_FW_ERROR, &trans->status))) + return -EIO; + + if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) { + IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); + return -EIO; + } + + if (WARN_ON((cmd->flags & CMD_WANT_ASYNC_CALLBACK) && + !(cmd->flags & CMD_ASYNC))) + return -EINVAL; + + if (!(cmd->flags & CMD_ASYNC)) + lock_map_acquire_read(&trans->sync_cmd_lockdep_map); + + ret = trans->ops->send_cmd(trans, cmd); + + if (!(cmd->flags & CMD_ASYNC)) + lock_map_release(&trans->sync_cmd_lockdep_map); + + return ret; +} +IWL_EXPORT_SYMBOL(iwl_trans_send_cmd); |