Commit 7d6222e2 authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho

iwlwifi: mvm: add and use iwl_mvm_has_unified_ucode()

This may need to be refined later, but for now using this,
even with the TODO, is better than checking "has new TX API".
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent b37ca87f
...@@ -457,7 +457,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) ...@@ -457,7 +457,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
}; };
int ret; int ret;
if (iwl_mvm_has_new_tx_api(mvm)) if (iwl_mvm_has_unified_ucode(mvm))
return iwl_run_unified_mvm_ucode(mvm, true); return iwl_run_unified_mvm_ucode(mvm, true);
lockdep_assert_held(&mvm->mutex); lockdep_assert_held(&mvm->mutex);
...@@ -1034,7 +1034,7 @@ static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm) ...@@ -1034,7 +1034,7 @@ static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm)
{ {
int ret; int ret;
if (iwl_mvm_has_new_tx_api(mvm)) if (iwl_mvm_has_unified_ucode(mvm))
return iwl_run_unified_mvm_ucode(mvm, false); return iwl_run_unified_mvm_ucode(mvm, false);
ret = iwl_run_init_mvm_ucode(mvm, false); ret = iwl_run_init_mvm_ucode(mvm, false);
...@@ -1101,8 +1101,8 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ...@@ -1101,8 +1101,8 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
if (ret) if (ret)
goto error; goto error;
/* Send phy db control command and then phy db calibration*/ if (!iwl_mvm_has_unified_ucode(mvm)) {
if (!iwl_mvm_has_new_tx_api(mvm)) { /* Send phy db control command and then phy db calibration */
ret = iwl_send_phy_db_data(mvm->phy_db); ret = iwl_send_phy_db_data(mvm->phy_db);
if (ret) if (ret)
goto error; goto error;
......
...@@ -1232,6 +1232,12 @@ static inline bool iwl_mvm_has_new_tx_api(struct iwl_mvm *mvm) ...@@ -1232,6 +1232,12 @@ static inline bool iwl_mvm_has_new_tx_api(struct iwl_mvm *mvm)
return mvm->trans->cfg->use_tfh; return mvm->trans->cfg->use_tfh;
} }
static inline bool iwl_mvm_has_unified_ucode(struct iwl_mvm *mvm)
{
/* TODO - better define this */
return mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_A000;
}
static inline bool iwl_mvm_is_cdb_supported(struct iwl_mvm *mvm) static inline bool iwl_mvm_is_cdb_supported(struct iwl_mvm *mvm)
{ {
/* /*
......
...@@ -645,7 +645,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, ...@@ -645,7 +645,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
mvm->last_agg_queue = IWL_MVM_DQA_MAX_DATA_QUEUE; mvm->last_agg_queue = IWL_MVM_DQA_MAX_DATA_QUEUE;
} }
mvm->sf_state = SF_UNINIT; mvm->sf_state = SF_UNINIT;
if (iwl_mvm_has_new_tx_api(mvm)) if (iwl_mvm_has_unified_ucode(mvm))
iwl_fw_set_current_image(&mvm->fwrt, IWL_UCODE_REGULAR); iwl_fw_set_current_image(&mvm->fwrt, IWL_UCODE_REGULAR);
else else
iwl_fw_set_current_image(&mvm->fwrt, IWL_UCODE_INIT); iwl_fw_set_current_image(&mvm->fwrt, IWL_UCODE_INIT);
......
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