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

Commit 9d8eff77 authored by Ahmad Masri's avatar Ahmad Masri Committed by Gerrit - the friendly Code Review server
Browse files

wil6210: enable AP/PCP power save



New FW has power save capability in AP/PCP mode. FW reports this to
driver with WMI_FW_CAPABILITY_AP_POWER_MANAGEMENT.

AP/PCP mode power save in FW is disabled by default. It can be enabled
by sending WMI_PS_DEV_PROFILE_CFG_CMD to FW as part of start_ap
sequence.

Several pre-conditions must be met for driver to enable this:
1. power save enabled from cfg80211
2. AP power save enabled from platform driver. This is reported from
   platform driver with a new WIL_PLATFORM_CAPA_AP_PS

AP power save can be controlled via "ap_ps" debugfs.

Change-Id: I328fdbfe5382e60688c9f4a67aa9378197e01987
Signed-off-by: default avatarAhmad Masri <amasri@codeaurora.org>
parent 72049e4b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -2049,7 +2049,8 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
	if (pbss)
		wmi_nettype = WMI_NETTYPE_P2P;

	wil_dbg_misc(wil, "start_ap: mid=%d, is_go=%d\n", vif->mid, is_go);
	wil_dbg_misc(wil, "start_ap: mid=%d, is_go=%d ap_ps=%d\n", vif->mid,
		     is_go, wil->ap_ps);
	if (is_go && !pbss) {
		wil_err(wil, "P2P GO must be in PBSS\n");
		return -ENOTSUPP;
@@ -2139,6 +2140,14 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
	if (rc)
		goto err_bcast;

	if (test_bit(WMI_FW_CAPABILITY_AP_POWER_MANAGEMENT,
		     wil->fw_capabilities)) {
		enum wmi_ps_profile_type ps_profile = wil->ap_ps ?
			wil->ps_profile : WMI_PS_PROFILE_TYPE_PS_DISABLED;

		wil_ps_update(wil, ps_profile);
	}

	goto out; /* success */

err_bcast:
+1 −0
Original line number Diff line number Diff line
@@ -2639,6 +2639,7 @@ static const struct dbg_off dbg_wil_off[] = {
	WIL_FIELD(rx_buff_id_count, 0644,	doff_u32),
	WIL_FIELD(amsdu_en, 0644,	doff_u8),
	WIL_FIELD(force_edmg_channel, 0644,	doff_u8),
	WIL_FIELD(ap_ps, 0644, doff_u8),
	{},
};

+2 −0
Original line number Diff line number Diff line
@@ -1307,6 +1307,8 @@ void wil_refresh_fw_capabilities(struct wil6210_priv *wil)
	}

	update_supported_bands(wil);

	wil->ap_ps = test_bit(WIL_PLATFORM_CAPA_AP_PS, wil->platform_capa);
}

void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
+1 −0
Original line number Diff line number Diff line
@@ -1041,6 +1041,7 @@ struct wil6210_priv {
	void *platform_handle;
	struct wil_platform_ops platform_ops;
	bool keep_radio_on_during_sleep;
	u8 ap_ps; /* AP mode power save enabled */

	struct pmc_ctx pmc;

+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ enum wil_platform_capa {
	WIL_PLATFORM_CAPA_T_PWR_ON_0 = 1,
	WIL_PLATFORM_CAPA_EXT_CLK = 2,
	WIL_PLATFORM_CAPA_SMMU = 3,
	WIL_PLATFORM_CAPA_AP_PS = 4,
	WIL_PLATFORM_CAPA_MAX,
};

Loading