diff mbox series

[V3,8/9] ath11k: add EMA beacon support

Message ID 20200812150050.2683396-9-john@phrozen.org (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series mac80211: add multiple bssid / EMA | expand

Commit Message

John Crispin Aug. 12, 2020, 3 p.m. UTC
We need to update the beacon in multiple bssid mode after each completion
event to get the next EMA beacon.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 08e7f4ac8a26..306f123c09a7 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -791,7 +791,10 @@  static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
 	if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
 		return 0;
 
-	bcn = ieee80211_beacon_get_template(hw, vif, &offs);
+	if (arvif->vif->multiple_bssid.non_transmitted)
+		return 0;
+
+	bcn = ieee80211_beacon_get_template_ema(hw, vif, &offs);
 	if (!bcn) {
 		ath11k_warn(ab, "failed to get beacon template from mac80211\n");
 		return -EPERM;
@@ -822,16 +825,23 @@  static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif)
 void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif)
 {
 	struct ieee80211_vif *vif = arvif->vif;
+	int multiple_bssid = 0;
 
-	if (!vif->cca_active)
+	if (!vif->multiple_bssid.non_transmitted &&
+	    !list_empty(&vif->multiple_bssid.list))
+		multiple_bssid = 1;
+
+	if (!multiple_bssid && !vif->cca_active)
 		return;
 
-	if (ieee80211_beacon_cntdwn_is_complete(vif)) {
+	if (vif->cca_active && ieee80211_beacon_cntdwn_is_complete(vif)) {
 		ieee80211_cca_finish(vif);
 		return;
 	}
 
-	ieee80211_beacon_update_cntdwn(vif);
+	if (vif->cca_active)
+		ieee80211_beacon_update_cntdwn(vif);
+
 	ath11k_mac_setup_bcn_tmpl(arvif);
 }