wifi: ath12k: pass link ID during MLO while delivering skb
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Mon, 9 Dec 2024 18:54:21 +0000 (20:54 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 16 Dec 2024 20:46:58 +0000 (12:46 -0800)
mac80211 expects link_id in some scenarios or else the packet might
get dropped. Hence, add link_id information before delivering the skb.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-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: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241209185421.376381-10-kvalo@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_mon.c
drivers/net/wireless/ath/ath12k/dp_rx.c
drivers/net/wireless/ath/ath12k/peer.c
drivers/net/wireless/ath/ath12k/peer.h

index 494984133a9196411ac0eeac0311aebd5c085fad..2d53404095d6be71adb304c67f6cda8c144b5272 100644 (file)
@@ -1093,8 +1093,14 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct
                decap = ath12k_dp_rx_h_decap_type(ar->ab, rxcb->rx_desc);
        spin_lock_bh(&ar->ab->base_lock);
        peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu);
-       if (peer && peer->sta)
+       if (peer && peer->sta) {
                pubsta = peer->sta;
+               if (pubsta->valid_links) {
+                       status->link_valid = 1;
+                       status->link_id = peer->link_id;
+               }
+       }
+
        spin_unlock_bh(&ar->ab->base_lock);
 
        ath12k_dbg(ar->ab, ATH12K_DBG_DATA,
index 899a25f5994dba92ce414d2bb0f82a676a2c5db7..66367bfb4acc9a0cf1e73219506fcdd417dc199c 100644 (file)
@@ -2474,6 +2474,11 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *nap
 
        pubsta = peer ? peer->sta : NULL;
 
+       if (pubsta && pubsta->valid_links) {
+               status->link_valid = 1;
+               status->link_id = peer->link_id;
+       }
+
        spin_unlock_bh(&ab->base_lock);
 
        ath12k_dbg(ab, ATH12K_DBG_DATA,
index 5763c5a40cfc3ed5c663a2d09df07f464148232e..792cca8a3fb1b06e6beb9f42ff47e6b1c01192c2 100644 (file)
@@ -388,6 +388,8 @@ int ath12k_peer_create(struct ath12k *ar, struct ath12k_link_vif *arvif,
                arsta = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy,
                                          ahsta->link[link_id]);
 
+               peer->link_id = arsta->link_id;
+
                /* Fill ML info into created peer */
                if (sta->mlo) {
                        ml_peer_id = ahsta->ml_peer_id;
index 7e6231cb2b529c863e0ced9a7a4318d8d4141b9c..5870ee11a8c7ec112d81e8a9b04cb8727c946499 100644 (file)
@@ -59,6 +59,9 @@ struct ath12k_peer {
 
        /* To ensure only certain work related to dp is done once */
        bool primary_link;
+
+       /* for reference to ath12k_link_sta */
+       u8 link_id;
 };
 
 struct ath12k_ml_peer {