Skip to content

Commit

Permalink
CHROMIUM: iwl7000: xvt: run CMD_INIT_CONTINUE w/o low power
Browse files Browse the repository at this point in the history
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 <konstantinx.gleyzer@intel.com>
iwl7000-tree: 9cbc3bfe51baa5b85f4fe911fc725c8e7af44d9c
  • Loading branch information
Konstantin Gleyzer authored and Anatol Pomazau committed Oct 23, 2015
1 parent 68f2d9a commit 7d50826
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions drivers/net/wireless/iwl7000/iwlwifi/xvt/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/iwl7000/iwlwifi/xvt/user-infc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwl7000/iwlwifi/xvt/xvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7d50826

Please sign in to comment.