Commit 46ad1ff9 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Luca Coelho
Browse files

iwlwifi: mvm: register to mac80211 last



All the actions that were taken after the registration can
be taken before the registration to mac80211.
This will help to defer part of the op_mode_mvm_start
function to a later stage in case the device is not
available.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.c03cc5db67c1.Ia928ca34d25a73d959a345ffbe4f1217c3f17394@changeid


Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 4e8fe214
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -891,16 +891,9 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
	/* Set EBS as successful as long as not stated otherwise by the FW. */
	mvm->last_ebs_successful = true;

	err = iwl_mvm_mac_setup_register(mvm);
	if (err)
		goto out_free;
	mvm->hw_registered = true;

	min_backoff = iwl_mvm_min_backoff(mvm);
	iwl_mvm_thermal_initialize(mvm, min_backoff);

	iwl_mvm_dbgfs_register(mvm, dbgfs_dir);

	if (!iwl_mvm_has_new_rx_stats_api(mvm))
		memset(&mvm->rx_stats_v3, 0,
		       sizeof(struct mvm_statistics_rx_v3));
@@ -909,8 +902,17 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,

	iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx);

	err = iwl_mvm_mac_setup_register(mvm);
	if (err)
		goto out_thermal_exit;
	mvm->hw_registered = true;

	iwl_mvm_dbgfs_register(mvm, dbgfs_dir);

	return op_mode;

 out_thermal_exit:
	iwl_mvm_thermal_exit(mvm);
 out_free:
	iwl_fw_flush_dumps(&mvm->fwrt);
	iwl_fw_runtime_free(&mvm->fwrt);