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: Ahmad Masri <amasri@codeaurora.org>
Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
This commit is contained in:
Ahmad Masri 2019-12-04 12:48:48 +02:00 • committed by Alexei Avshalom Lazar
commit 4a8e85bc08
6 changed files with 16 additions and 1 deletions

View file

@ -2155,7 +2155,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;
@ -2247,6 +2248,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:

View file

@ -2460,6 +2460,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),
{},
};

View file

@ -1309,6 +1309,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)

View file

@ -1047,6 +1047,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;

View file

@ -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,
};

View file

@ -100,6 +100,7 @@ enum wmi_fw_capability {
WMI_FW_CAPABILITY_IPA = 27,
WMI_FW_CAPABILITY_TEMPERATURE_ALL_RF = 30,
WMI_FW_CAPABILITY_SPLIT_REKEY = 31,
WMI_FW_CAPABILITY_AP_POWER_MANAGEMENT = 32,
WMI_FW_CAPABILITY_MAX,
};