From 7d50826b8c38390c3e930a22deb41a37392b11e0 Mon Sep 17 00:00:00 2001 From: Konstantin Gleyzer Date: Thu, 24 Sep 2015 16:44:24 +0200 Subject: [PATCH] CHROMIUM: iwl7000: xvt: run CMD_INIT_CONTINUE w/o low power When running the init continue command, we shouldn't use low power mode because we lose the configuration. To fix this allow starting and stopping the device without entering low power mode and use this option when switching from the init FW to the runtime FW. Signed-off-by: Konstantin Gleyzer iwl7000-tree: 9cbc3bfe51baa5b85f4fe911fc725c8e7af44d9c --- drivers/net/wireless/iwl7000/iwlwifi/xvt/fw.c | 9 ++++++--- drivers/net/wireless/iwl7000/iwlwifi/xvt/user-infc.c | 10 +++++----- drivers/net/wireless/iwl7000/iwlwifi/xvt/xvt.h | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/iwl7000/iwlwifi/xvt/fw.c b/drivers/net/wireless/iwl7000/iwlwifi/xvt/fw.c index 9a6fb94138aea..d2297608a0327 100644 --- a/drivers/net/wireless/iwl7000/iwlwifi/xvt/fw.c +++ b/drivers/net/wireless/iwl7000/iwlwifi/xvt/fw.c @@ -227,7 +227,7 @@ static int iwl_xvt_load_ucode_wait_alive(struct iwl_xvt *xvt, return 0; } -int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type) +int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type, bool cont_run) { int ret; @@ -244,10 +244,13 @@ int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type) IWL_XVT_DEFAULT_TX_QUEUE, true); } - iwl_trans_stop_device(xvt->trans); + _iwl_trans_stop_device(xvt->trans, !cont_run); } - ret = iwl_trans_start_hw(xvt->trans); + if (cont_run) + ret = _iwl_trans_start_hw(xvt->trans, false); + else + ret = iwl_trans_start_hw(xvt->trans); if (ret) { IWL_ERR(xvt, "Failed to start HW\n"); return ret; diff --git a/drivers/net/wireless/iwl7000/iwlwifi/xvt/user-infc.c b/drivers/net/wireless/iwl7000/iwlwifi/xvt/user-infc.c index fd6402bd2f930..73d0f635022a9 100644 --- a/drivers/net/wireless/iwl7000/iwlwifi/xvt/user-infc.c +++ b/drivers/net/wireless/iwl7000/iwlwifi/xvt/user-infc.c @@ -598,11 +598,11 @@ static int iwl_xvt_send_phy_cfg_cmd(struct iwl_xvt *xvt, u32 ucode_type) return err; } -static int iwl_xvt_run_runtime_fw(struct iwl_xvt *xvt) +static int iwl_xvt_run_runtime_fw(struct iwl_xvt *xvt, bool cont_run) { int err; - err = iwl_xvt_run_fw(xvt, IWL_UCODE_REGULAR); + err = iwl_xvt_run_fw(xvt, IWL_UCODE_REGULAR, cont_run); if (err) goto fw_error; @@ -662,7 +662,7 @@ static int iwl_xvt_start_op_mode(struct iwl_xvt *xvt) */ if (!(xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_INIT)) { if (xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_RUNTIME) { - err = iwl_xvt_run_runtime_fw(xvt); + err = iwl_xvt_run_runtime_fw(xvt, false); } else { if (xvt->state != IWL_XVT_STATE_UNINITIALIZED) { xvt->fw_running = false; @@ -680,7 +680,7 @@ static int iwl_xvt_start_op_mode(struct iwl_xvt *xvt) return err; } - err = iwl_xvt_run_fw(xvt, IWL_UCODE_INIT); + err = iwl_xvt_run_fw(xvt, IWL_UCODE_INIT, false); if (err) return err; @@ -760,7 +760,7 @@ static int iwl_xvt_continue_init(struct iwl_xvt *xvt) if (xvt->sw_stack_cfg.load_mask & IWL_XVT_LOAD_MASK_RUNTIME) /* Run runtime FW stops the device by itself if error occurs */ - err = iwl_xvt_run_runtime_fw(xvt); + err = iwl_xvt_run_runtime_fw(xvt, true); goto cont_init_end; diff --git a/drivers/net/wireless/iwl7000/iwlwifi/xvt/xvt.h b/drivers/net/wireless/iwl7000/iwlwifi/xvt/xvt.h index 6eebb6195a164..b976f838fb1fb 100644 --- a/drivers/net/wireless/iwl7000/iwlwifi/xvt/xvt.h +++ b/drivers/net/wireless/iwl7000/iwlwifi/xvt/xvt.h @@ -292,7 +292,7 @@ int iwl_xvt_user_cmd_execute(struct iwl_op_mode *op_mode, u32 cmd, struct iwl_tm_data *data_out); /* FW */ -int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type); +int iwl_xvt_run_fw(struct iwl_xvt *xvt, u32 ucode_type, bool cont_run); /* NVM */ int iwl_xvt_nvm_init(struct iwl_xvt *xvt);