ath11k: add TWT support

Add target wait time wmi calls to the driver. En/disable the support
from when the bss_config changes. We ignore the cmd completion events.

Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
John Crispin
2019-11-25 16:36:28 +00:00
committed by Kalle Valo
parent 9f056ed8ee
commit 6d293d4476
3 changed files with 173 additions and 0 deletions

View File

@@ -1189,6 +1189,11 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar,
}
}
if (he_cap->he_cap_elem.mac_cap_info[0] & IEEE80211_HE_MAC_CAP0_TWT_RES)
arg->twt_responder = true;
if (he_cap->he_cap_elem.mac_cap_info[0] & IEEE80211_HE_MAC_CAP0_TWT_REQ)
arg->twt_requester = true;
switch (sta->bandwidth) {
case IEEE80211_STA_RX_BW_160:
if (he_cap->he_cap_elem.phy_cap_info[0] &
@@ -1904,6 +1909,13 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
!ath11k_mac_vif_chan(arvif->vif, &def))
ath11k_recalculate_mgmt_rate(ar, vif, &def);
if (changed & BSS_CHANGED_TWT) {
if (info->twt_requester || info->twt_responder)
ath11k_wmi_send_twt_enable_cmd(ar, ar->pdev_idx);
else
ath11k_wmi_send_twt_disable_cmd(ar, ar->pdev_idx);
}
mutex_unlock(&ar->conf_mutex);
}