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

Commit 526549a8 authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo
Browse files

ath10k: prevent invalid ps timeout config



Setting 0 ps timeout to firmware yields very poor
latency and traffic issues. This is the case when
multi-vif is active.

Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 9f9b5746
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -1105,10 +1105,12 @@ static int ath10k_mac_vif_recalc_ps_poll_count(struct ath10k_vif *arvif)
static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif)
static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif)
{
{
	struct ath10k *ar = arvif->ar;
	struct ath10k *ar = arvif->ar;
	struct ieee80211_vif *vif = arvif->vif;
	struct ieee80211_conf *conf = &ar->hw->conf;
	struct ieee80211_conf *conf = &ar->hw->conf;
	enum wmi_sta_powersave_param param;
	enum wmi_sta_powersave_param param;
	enum wmi_sta_ps_mode psmode;
	enum wmi_sta_ps_mode psmode;
	int ret;
	int ret;
	int ps_timeout;


	lockdep_assert_held(&arvif->ar->conf_mutex);
	lockdep_assert_held(&arvif->ar->conf_mutex);


@@ -1119,8 +1121,15 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif)
		psmode = WMI_STA_PS_MODE_ENABLED;
		psmode = WMI_STA_PS_MODE_ENABLED;
		param = WMI_STA_PS_PARAM_INACTIVITY_TIME;
		param = WMI_STA_PS_PARAM_INACTIVITY_TIME;


		ps_timeout = conf->dynamic_ps_timeout;
		if (ps_timeout == 0) {
			/* Firmware doesn't like 0 */
			ps_timeout = ieee80211_tu_to_usec(
				vif->bss_conf.beacon_int) / 1000;
		}

		ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
		ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
						  conf->dynamic_ps_timeout);
						  ps_timeout);
		if (ret) {
		if (ret) {
			ath10k_warn(ar, "failed to set inactivity time for vdev %d: %i\n",
			ath10k_warn(ar, "failed to set inactivity time for vdev %d: %i\n",
				    arvif->vdev_id, ret);
				    arvif->vdev_id, ret);