Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c146683 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: restore power save state after internal FW reset" into msm-4.9

parents 27e69bfe 472bec2c
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -1653,12 +1653,6 @@ static int wil_cfg80211_set_power_mgmt(struct wiphy *wiphy,
{
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	enum wmi_ps_profile_type ps_profile;
	int rc;

	if (!test_bit(WMI_FW_CAPABILITY_PS_CONFIG, wil->fw_capabilities)) {
		wil_err(wil, "set_power_mgmt not supported\n");
		return -EOPNOTSUPP;
	}

	wil_dbg_misc(wil, "enabled=%d, timeout=%d\n",
		     enabled, timeout);
@@ -1668,11 +1662,7 @@ static int wil_cfg80211_set_power_mgmt(struct wiphy *wiphy,
	else
		ps_profile = WMI_PS_PROFILE_TYPE_PS_DISABLED;

	rc  = wmi_ps_dev_profile_cfg(wil, ps_profile);
	if (rc)
		wil_err(wil, "wmi_ps_dev_profile_cfg failed (%d)\n", rc);

	return rc;
	return wil_ps_update(wil, ps_profile);
}

static struct cfg80211_ops wil_cfg80211_ops = {
+24 −0
Original line number Diff line number Diff line
@@ -576,6 +576,9 @@ int wil_priv_init(struct wil6210_priv *wil)

	if (rx_ring_overflow_thrsh == WIL6210_RX_HIGH_TRSH_INIT)
		rx_ring_overflow_thrsh = WIL6210_RX_HIGH_TRSH_DEFAULT;

	wil->ps_profile =  WMI_PS_PROFILE_TYPE_DEFAULT;

	return 0;

out_wmi_wq:
@@ -904,6 +907,24 @@ void wil_abort_scan(struct wil6210_priv *wil, bool sync)
	}
}

int wil_ps_update(struct wil6210_priv *wil, enum wmi_ps_profile_type ps_profile)
{
	int rc;

	if (!test_bit(WMI_FW_CAPABILITY_PS_CONFIG, wil->fw_capabilities)) {
		wil_err(wil, "set_power_mgmt not supported\n");
		return -EOPNOTSUPP;
	}

	rc  = wmi_ps_dev_profile_cfg(wil, ps_profile);
	if (rc)
		wil_err(wil, "wmi_ps_dev_profile_cfg failed (%d)\n", rc);
	else
		wil->ps_profile = ps_profile;

	return rc;
}

/*
 * We reset all the structures, and we reset the UMAC.
 * After calling this routine, you're expected to reload
@@ -1038,6 +1059,9 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
			return rc;
		}

		if (wil->ps_profile != WMI_PS_PROFILE_TYPE_DEFAULT)
			wil_ps_update(wil, wil->ps_profile);

		if (wil->tt_data_set)
			wmi_set_tt_cfg(wil, &wil->tt_data);

+4 −0
Original line number Diff line number Diff line
@@ -697,6 +697,8 @@ struct wil6210_priv {
	/* High Access Latency Policy voting */
	struct wil_halp halp;

	enum wmi_ps_profile_type ps_profile;

	struct wil_ftm_priv ftm;
	bool tt_data_set;
	struct wmi_tt_data tt_data;
@@ -816,6 +818,8 @@ int wil_if_add(struct wil6210_priv *wil);
void wil_if_remove(struct wil6210_priv *wil);
int wil_priv_init(struct wil6210_priv *wil);
void wil_priv_deinit(struct wil6210_priv *wil);
int wil_ps_update(struct wil6210_priv *wil,
		  enum wmi_ps_profile_type ps_profile);
int wil_reset(struct wil6210_priv *wil, bool no_fw);
void wil_fw_error_recovery(struct wil6210_priv *wil);
void wil_set_recovery_state(struct wil6210_priv *wil, int state);