ath11k: fix multi band roaming

when roaming between 2 radios the following error messages would show up in the logs

[681066.503943] ath11k c000000.wifi: Failed to add peer: 38:f9:d3:bf:b2:d4 for VDEV: 1
[681066.503979] ath11k c000000.wifi: Failed to add station: 38:f9:d3:bf:b2:d4 for VDEV: 1

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2024-06-13 08:23:05 +02:00
parent bb7d78cd7d
commit 1d106efd51

View File

@@ -0,0 +1,38 @@
--- a/drivers/net/wireless/ath/ath11k/peer.c
+++ b/drivers/net/wireless/ath/ath11k/peer.c
@@ -819,8 +819,13 @@ int ath11k_peer_delete(struct ath11k *ar
}
}
#endif
- ath11k_peer_rhash_delete(ar->ab, peer);
+ if (peer->vdev_id == vdev_id)
+ ath11k_peer_rhash_delete(ar->ab, peer);
}
+
+ if (!peer)
+ peer = ath11k_peer_find(ar->ab, vdev_id, addr);
+
spin_unlock_bh(&ar->ab->base_lock);
mutex_unlock(&ar->ab->tbl_mtx_lock);
#ifdef CPTCFG_ATH11K_NSS_SUPPORT
@@ -870,8 +875,18 @@ int ath11k_peer_create(struct ath11k *ar
spin_lock_bh(&ar->ab->base_lock);
peer = ath11k_peer_find_by_addr(ar->ab, param->peer_addr);
if (peer) {
- spin_unlock_bh(&ar->ab->base_lock);
- return -EINVAL;
+ if (peer->vdev_id == param->vdev_id) {
+ spin_unlock_bh(&ar->ab->base_lock);
+ return -EINVAL;
+ }
+
+ /* Assume sta is transitioning to another band.
+ * Remove here the peer from rhash.
+ */
+ mutex_lock(&ar->ab->tbl_mtx_lock);
+ ath11k_peer_rhash_delete(ar->ab, peer);
+ mutex_unlock(&ar->ab->tbl_mtx_lock);
+
}
spin_unlock_bh(&ar->ab->base_lock);