diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2021-02-10 18:15:14 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2021-02-11 02:52:11 +0300 |
commit | 13b5fa9582f5aa99ac2442d6b3d5fbe0581d0ab5 (patch) | |
tree | a6e62562f887084f45f958ee0d086b1146efc417 /drivers/net/wireless | |
parent | ee1a02d7604bdd5060d0447ecae6d40b5712dc9f (diff) | |
download | linux-13b5fa9582f5aa99ac2442d6b3d5fbe0581d0ab5.tar.xz |
iwlwifi: mvm: get NVM later in the mvm_start flow
We don't need the NVM until fairly late in the flow and
since this flow will be split soon, get the NVM later to
unite it with the parts that really need it.
Gather all what needs the NVM into a function.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.bab0e65c4909.I789f3eb577b216ad1688269e036ce9fa4880f532@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 130e78edd4ed..ebed82c590e5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -667,6 +667,22 @@ static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm) return ret; } +static int iwl_mvm_start_post_nvm(struct iwl_mvm *mvm) +{ + int ret; + + iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx); + + ret = iwl_mvm_mac_setup_register(mvm); + if (ret) + return ret; + mvm->hw_registered = true; + + iwl_mvm_dbgfs_register(mvm); + + return 0; +} + static struct iwl_op_mode * iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, const struct iwl_fw *fw, struct dentry *dbgfs_dir) @@ -890,9 +906,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, scan_size = iwl_mvm_scan_size(mvm); - if (iwl_mvm_start_get_nvm(mvm)) - goto out_free; - mvm->scan_cmd = kmalloc(scan_size, GFP_KERNEL); if (!mvm->scan_cmd) goto out_free; @@ -913,15 +926,13 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, else memset(&mvm->rx_stats, 0, sizeof(struct mvm_statistics_rx)); - iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx); + mvm->debugfs_dir = dbgfs_dir; - err = iwl_mvm_mac_setup_register(mvm); - if (err) + if (iwl_mvm_start_get_nvm(mvm)) goto out_thermal_exit; - mvm->hw_registered = true; - mvm->debugfs_dir = dbgfs_dir; - iwl_mvm_dbgfs_register(mvm); + if (iwl_mvm_start_post_nvm(mvm)) + goto out_thermal_exit; return op_mode; |