diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 13c2bad71c21..2804952448c5 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -1105,10 +1105,12 @@ static int ath10k_mac_vif_recalc_ps_poll_count(struct ath10k_vif *arvif) | |||
1105 | static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) | 1105 | static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) |
1106 | { | 1106 | { |
1107 | struct ath10k *ar = arvif->ar; | 1107 | struct ath10k *ar = arvif->ar; |
1108 | struct ieee80211_vif *vif = arvif->vif; | ||
1108 | struct ieee80211_conf *conf = &ar->hw->conf; | 1109 | struct ieee80211_conf *conf = &ar->hw->conf; |
1109 | enum wmi_sta_powersave_param param; | 1110 | enum wmi_sta_powersave_param param; |
1110 | enum wmi_sta_ps_mode psmode; | 1111 | enum wmi_sta_ps_mode psmode; |
1111 | int ret; | 1112 | int ret; |
1113 | int ps_timeout; | ||
1112 | 1114 | ||
1113 | lockdep_assert_held(&arvif->ar->conf_mutex); | 1115 | lockdep_assert_held(&arvif->ar->conf_mutex); |
1114 | 1116 | ||
@@ -1119,8 +1121,15 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) | |||
1119 | psmode = WMI_STA_PS_MODE_ENABLED; | 1121 | psmode = WMI_STA_PS_MODE_ENABLED; |
1120 | param = WMI_STA_PS_PARAM_INACTIVITY_TIME; | 1122 | param = WMI_STA_PS_PARAM_INACTIVITY_TIME; |
1121 | 1123 | ||
1124 | ps_timeout = conf->dynamic_ps_timeout; | ||
1125 | if (ps_timeout == 0) { | ||
1126 | /* Firmware doesn't like 0 */ | ||
1127 | ps_timeout = ieee80211_tu_to_usec( | ||
1128 | vif->bss_conf.beacon_int) / 1000; | ||
1129 | } | ||
1130 | |||
1122 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, | 1131 | ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, |
1123 | conf->dynamic_ps_timeout); | 1132 | ps_timeout); |
1124 | if (ret) { | 1133 | if (ret) { |
1125 | ath10k_warn(ar, "failed to set inactivity time for vdev %d: %i\n", | 1134 | ath10k_warn(ar, "failed to set inactivity time for vdev %d: %i\n", |
1126 | arvif->vdev_id, ret); | 1135 | arvif->vdev_id, ret); |