ath10k: disable multi-vif ps by default
Not all firmware revisions have a proper multi-interface client powersaving implementation, e.g. qca6174 WLAN.RM.2.0-00073. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
0a987fb006
commit
cffb41f3ee
2 changed files with 36 additions and 2 deletions
|
@ -308,6 +308,7 @@ struct ath10k_vif {
|
||||||
bool is_started;
|
bool is_started;
|
||||||
bool is_up;
|
bool is_up;
|
||||||
bool spectral_enabled;
|
bool spectral_enabled;
|
||||||
|
bool ps;
|
||||||
u32 aid;
|
u32 aid;
|
||||||
u8 bssid[ETH_ALEN];
|
u8 bssid[ETH_ALEN];
|
||||||
|
|
||||||
|
@ -433,6 +434,12 @@ enum ath10k_fw_features {
|
||||||
*/
|
*/
|
||||||
ATH10K_FW_FEATURE_WMI_10_2 = 4,
|
ATH10K_FW_FEATURE_WMI_10_2 = 4,
|
||||||
|
|
||||||
|
/* Some firmware revisions lack proper multi-interface client powersave
|
||||||
|
* implementation. Enabling PS could result in connection drops,
|
||||||
|
* traffic stalls, etc.
|
||||||
|
*/
|
||||||
|
ATH10K_FW_FEATURE_MULTI_VIF_PS_SUPPORT = 5,
|
||||||
|
|
||||||
/* keep last */
|
/* keep last */
|
||||||
ATH10K_FW_FEATURE_COUNT,
|
ATH10K_FW_FEATURE_COUNT,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1251,6 +1251,20 @@ static int ath10k_mac_vif_recalc_ps_poll_count(struct ath10k_vif *arvif)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ath10k_mac_ps_vif_count(struct ath10k *ar)
|
||||||
|
{
|
||||||
|
struct ath10k_vif *arvif;
|
||||||
|
int num = 0;
|
||||||
|
|
||||||
|
lockdep_assert_held(&ar->conf_mutex);
|
||||||
|
|
||||||
|
list_for_each_entry(arvif, &ar->arvifs, list)
|
||||||
|
if (arvif->ps)
|
||||||
|
num++;
|
||||||
|
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
@ -1260,13 +1274,24 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif)
|
||||||
enum wmi_sta_ps_mode psmode;
|
enum wmi_sta_ps_mode psmode;
|
||||||
int ret;
|
int ret;
|
||||||
int ps_timeout;
|
int ps_timeout;
|
||||||
|
bool enable_ps;
|
||||||
|
|
||||||
lockdep_assert_held(&arvif->ar->conf_mutex);
|
lockdep_assert_held(&arvif->ar->conf_mutex);
|
||||||
|
|
||||||
if (arvif->vif->type != NL80211_IFTYPE_STATION)
|
if (arvif->vif->type != NL80211_IFTYPE_STATION)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (vif->bss_conf.ps) {
|
enable_ps = arvif->ps;
|
||||||
|
|
||||||
|
if (enable_ps && ath10k_mac_ps_vif_count(ar) > 1 &&
|
||||||
|
!test_bit(ATH10K_FW_FEATURE_MULTI_VIF_PS_SUPPORT,
|
||||||
|
ar->fw_features)) {
|
||||||
|
ath10k_warn(ar, "refusing to enable ps on vdev %i: not supported by fw\n",
|
||||||
|
arvif->vdev_id);
|
||||||
|
enable_ps = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enable_ps) {
|
||||||
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;
|
||||||
|
|
||||||
|
@ -3650,7 +3675,9 @@ static void ath10k_bss_info_changed(struct ieee80211_hw *hw,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed & BSS_CHANGED_PS) {
|
if (changed & BSS_CHANGED_PS) {
|
||||||
ret = ath10k_mac_vif_setup_ps(arvif);
|
arvif->ps = vif->bss_conf.ps;
|
||||||
|
|
||||||
|
ret = ath10k_config_ps(ar);
|
||||||
if (ret)
|
if (ret)
|
||||||
ath10k_warn(ar, "failed to setup ps on vdev %i: %d\n",
|
ath10k_warn(ar, "failed to setup ps on vdev %i: %d\n",
|
||||||
arvif->vdev_id, ret);
|
arvif->vdev_id, ret);
|
||||||
|
|
Loading…
Add table
Reference in a new issue