|
@@ -7,6 +7,7 @@
|
|
|
*
|
|
|
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
|
|
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
|
|
+ * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
|
|
*
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
* it under the terms of version 2 of the GNU General Public License as
|
|
@@ -33,7 +34,7 @@
|
|
|
*
|
|
|
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
|
|
|
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
|
|
|
- * Copyright(c) 2016 Intel Deutschland GmbH
|
|
|
+ * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
|
|
|
* All rights reserved.
|
|
|
*
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -589,6 +590,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
|
|
mvm->fw = fw;
|
|
|
mvm->hw = hw;
|
|
|
|
|
|
+ mvm->init_status = 0;
|
|
|
+
|
|
|
if (iwl_mvm_has_new_rx_api(mvm)) {
|
|
|
op_mode->ops = &iwl_mvm_ops_mq;
|
|
|
trans->rx_mpdu_cmd_hdr_size = sizeof(struct iwl_rx_mpdu_desc);
|
|
@@ -753,7 +756,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
|
|
iwl_mvm_unref(mvm, IWL_MVM_REF_INIT_UCODE);
|
|
|
mutex_unlock(&mvm->mutex);
|
|
|
/* returns 0 if successful, 1 if success but in rfkill */
|
|
|
- if (err < 0 && !iwlmvm_mod_params.init_dbg) {
|
|
|
+ if (err < 0) {
|
|
|
IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", err);
|
|
|
goto out_free;
|
|
|
}
|
|
@@ -791,12 +794,18 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
|
|
return op_mode;
|
|
|
|
|
|
out_unregister:
|
|
|
+ if (iwlmvm_mod_params.init_dbg)
|
|
|
+ return op_mode;
|
|
|
+
|
|
|
ieee80211_unregister_hw(mvm->hw);
|
|
|
mvm->hw_registered = false;
|
|
|
iwl_mvm_leds_exit(mvm);
|
|
|
iwl_mvm_thermal_exit(mvm);
|
|
|
out_free:
|
|
|
flush_delayed_work(&mvm->fw_dump_wk);
|
|
|
+
|
|
|
+ if (iwlmvm_mod_params.init_dbg)
|
|
|
+ return op_mode;
|
|
|
iwl_phy_db_free(mvm->phy_db);
|
|
|
kfree(mvm->scan_cmd);
|
|
|
iwl_trans_op_mode_leave(trans);
|
|
@@ -821,7 +830,10 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)
|
|
|
|
|
|
iwl_mvm_thermal_exit(mvm);
|
|
|
|
|
|
- ieee80211_unregister_hw(mvm->hw);
|
|
|
+ if (mvm->init_status & IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE) {
|
|
|
+ ieee80211_unregister_hw(mvm->hw);
|
|
|
+ mvm->init_status &= ~IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE;
|
|
|
+ }
|
|
|
|
|
|
kfree(mvm->scan_cmd);
|
|
|
kfree(mvm->mcast_filter_cmd);
|