]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: add helper to find multi-link station
authorSriram R <quic_srirrama@quicinc.com>
Fri, 1 Nov 2024 15:17:04 +0000 (17:17 +0200)
committerJeff Johnson <quic_jjohnson@quicinc.com>
Wed, 6 Nov 2024 19:36:28 +0000 (11:36 -0800)
Multi-link stations are identified in driver using the multi-link
peer id and they have ATH12K_PEER_ML_ID_VALID bit set in the id. Add a helper
to find multi-link station using the multi-link peer id.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://patch.msgid.link/20241101151705.165987-8-kvalo@kernel.org
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
drivers/net/wireless/ath/ath12k/peer.c
drivers/net/wireless/ath/ath12k/peer.h

index 2ad19baf0664a0a859025917a10b02ffe716de88..0e86847edd6e1dfee9931f2f8c406e71bf19e0aa 100644 (file)
@@ -79,6 +79,20 @@ struct ath12k_peer *ath12k_peer_find_by_addr(struct ath12k_base *ab,
        return NULL;
 }
 
+static struct ath12k_peer *ath12k_peer_find_by_ml_id(struct ath12k_base *ab,
+                                                    int ml_peer_id)
+{
+       struct ath12k_peer *peer;
+
+       lockdep_assert_held(&ab->base_lock);
+
+       list_for_each_entry(peer, &ab->peers, list)
+               if (ml_peer_id == peer->ml_id)
+                       return peer;
+
+       return NULL;
+}
+
 struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab,
                                           int peer_id)
 {
@@ -86,6 +100,9 @@ struct ath12k_peer *ath12k_peer_find_by_id(struct ath12k_base *ab,
 
        lockdep_assert_held(&ab->base_lock);
 
+       if (peer_id & ATH12K_PEER_ML_ID_VALID)
+               return ath12k_peer_find_by_ml_id(ab, peer_id);
+
        list_for_each_entry(peer, &ab->peers, list)
                if (peer_id == peer->peer_id)
                        return peer;
index 085246ca938d91c5eae5d3e48ccaa5e12d9e4a17..c28aca5d88a04b55ae988efe7f52f398876bff5e 100644 (file)
@@ -19,6 +19,8 @@ struct ppdu_user_delayba {
        u32 resp_rate_flags;
 };
 
+#define ATH12K_PEER_ML_ID_VALID         BIT(13)
+
 struct ath12k_peer {
        struct list_head list;
        struct ieee80211_sta *sta;
@@ -47,6 +49,8 @@ struct ath12k_peer {
 
        /* protected by ab->data_lock */
        bool dp_setup_done;
+
+       u16 ml_id;
 };
 
 struct ath12k_ml_peer {