]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Move ath12k_dp_rx_frags_cleanup API to Wi-Fi 7
authorPavankumar Nandeshwar <quic_pnandesh@quicinc.com>
Mon, 3 Nov 2025 11:21:06 +0000 (16:51 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Wed, 5 Nov 2025 15:16:55 +0000 (07:16 -0800)
The API ath12k_dp_rx_frags_cleanup uses rx hw structure that is specific to
Wi-Fi 7. Hence move the API to Wi-Fi 7 and use ops infra to reach it from the
common code.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-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: Pavankumar Nandeshwar <quic_pnandesh@quicinc.com>
Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com>
Reviewed-by: Karthikeyan Periyasamy <karthikeyan.periyasamy@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20251103112111.2260639-8-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp.h
drivers/net/wireless/ath/ath12k/dp_rx.c
drivers/net/wireless/ath/ath12k/dp_rx.h
drivers/net/wireless/ath/ath12k/wifi7/dp.c
drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c
drivers/net/wireless/ath/ath12k/wifi7/dp_rx.h

index 17c919213c6aec3dd955737d3a80e7f6436864f1..74801055e2f02cc4fe1d6ccbabcb81023d08d120 100644 (file)
@@ -408,6 +408,8 @@ struct ath12k_dp_arch_ops {
        int (*rx_link_desc_return)(struct ath12k_base *ab,
                                   struct ath12k_buffer_addr *buf_addr_info,
                                   enum hal_wbm_rel_bm_act action);
+       void (*rx_frags_cleanup)(struct ath12k_dp_rx_tid *rx_tid,
+                                bool rel_link_desc);
        int (*peer_rx_tid_reo_update)(struct ath12k_dp *dp,
                                      struct ath12k_dp_link_peer *peer,
                                      struct ath12k_dp_rx_tid *rx_tid,
@@ -588,6 +590,14 @@ int ath12k_dp_arch_rx_link_desc_return(struct ath12k_dp *dp,
        return dp->ops->rx_link_desc_return(dp->ab, buf_addr_info, action);
 }
 
+static inline
+void ath12k_dp_arch_rx_frags_cleanup(struct ath12k_dp *dp,
+                                    struct ath12k_dp_rx_tid *rx_tid,
+                                    bool rel_link_desc)
+{
+       dp->ops->rx_frags_cleanup(rx_tid, rel_link_desc);
+}
+
 static inline int ath12k_dp_arch_peer_rx_tid_reo_update(struct ath12k_dp *dp,
                                                        struct ath12k_dp_link_peer *peer,
                                                        struct ath12k_dp_rx_tid *rx_tid,
index 01faa76f8e06e58d5424fdb6f86c9971f9225346..f76d1329925848b1d2c578675b909991f774b07a 100644 (file)
@@ -445,30 +445,6 @@ free_desc:
        rx_tid->qbuf.vaddr = NULL;
 }
 
-void ath12k_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
-                               bool rel_link_desc)
-{
-       enum hal_wbm_rel_bm_act act = HAL_WBM_REL_BM_ACT_PUT_IN_IDLE;
-       struct ath12k_buffer_addr *buf_addr_info;
-       struct ath12k_dp *dp = rx_tid->dp;
-
-       lockdep_assert_held(&dp->dp_lock);
-
-       if (rx_tid->dst_ring_desc) {
-               if (rel_link_desc) {
-                       buf_addr_info = &rx_tid->dst_ring_desc->buf_addr_info;
-                       ath12k_dp_arch_rx_link_desc_return(dp, buf_addr_info, act);
-               }
-               kfree(rx_tid->dst_ring_desc);
-               rx_tid->dst_ring_desc = NULL;
-       }
-
-       rx_tid->cur_sn = 0;
-       rx_tid->last_frag_no = 0;
-       rx_tid->rx_frag_bitmap = 0;
-       __skb_queue_purge(&rx_tid->rx_frags);
-}
-
 void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_dp_link_peer *peer)
 {
        struct ath12k_dp_rx_tid *rx_tid;
@@ -485,7 +461,7 @@ void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_dp_link_peer
                rx_tid = &peer->dp_peer->rx_tid[i];
 
                ath12k_dp_arch_rx_peer_tid_delete(dp, peer, i);
-               ath12k_dp_rx_frags_cleanup(rx_tid, true);
+               ath12k_dp_arch_rx_frags_cleanup(dp, rx_tid, true);
 
                spin_unlock_bh(&dp->dp_lock);
                timer_delete_sync(&rx_tid->frag_timer);
@@ -1327,7 +1303,7 @@ static void ath12k_dp_rx_frag_timer(struct timer_list *timer)
                spin_unlock_bh(&rx_tid->dp->dp_lock);
                return;
        }
-       ath12k_dp_rx_frags_cleanup(rx_tid, true);
+       ath12k_dp_arch_rx_frags_cleanup(rx_tid->dp, rx_tid, true);
        spin_unlock_bh(&rx_tid->dp->dp_lock);
 }
 
index 3c0d66855999de55005c9a0640645079175e4b07..0dffb59c13b87aca5e97bfa16833f896a5d80cae 100644 (file)
@@ -183,8 +183,6 @@ void ath12k_dp_rx_h_sort_frags(struct ath12k_base *ab,
                               struct sk_buff *cur_frag);
 void ath12k_dp_rx_h_undecap_frag(struct ath12k_pdev_dp *dp_pdev, struct sk_buff *msdu,
                                 enum hal_encrypt_type enctype, u32 flags);
-void ath12k_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
-                               bool rel_link_desc);
 int ath12k_dp_rx_h_michael_mic(struct crypto_shash *tfm, u8 *key,
                               struct ieee80211_hdr *hdr, u8 *data,
                               size_t data_len, u8 *mic);
index 1fd7738a39b572564767668c458de323ea374633..b57e8de05c27322209b31d900c1bb0bf18fe2c93 100644 (file)
@@ -144,6 +144,7 @@ static struct ath12k_dp_arch_ops ath12k_wifi7_dp_arch_ops = {
        .rx_peer_tid_delete = ath12k_wifi7_dp_rx_peer_tid_delete,
        .reo_cache_flush = ath12k_wifi7_dp_reo_cache_flush,
        .rx_link_desc_return = ath12k_wifi7_dp_rx_link_desc_return,
+       .rx_frags_cleanup = ath12k_wifi7_dp_rx_frags_cleanup,
        .peer_rx_tid_reo_update = ath12k_wifi7_peer_rx_tid_reo_update,
        .rx_assign_reoq = ath12k_wifi7_dp_rx_assign_reoq,
        .peer_rx_tid_qref_setup = ath12k_wifi7_peer_rx_tid_qref_setup,
index 0cf8a8f7b5f6e4765f40b1b7ccbfa8646e28c80d..13cd23d7c7daece7fc783a9d4a76b5bb22cf7bd6 100644 (file)
@@ -1100,6 +1100,30 @@ static int ath12k_wifi7_dp_rx_h_defrag(struct ath12k_pdev_dp *dp_pdev,
        return 0;
 }
 
+void ath12k_wifi7_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
+                                     bool rel_link_desc)
+{
+       enum hal_wbm_rel_bm_act act = HAL_WBM_REL_BM_ACT_PUT_IN_IDLE;
+       struct ath12k_buffer_addr *buf_addr_info;
+       struct ath12k_dp *dp = rx_tid->dp;
+
+       lockdep_assert_held(&dp->dp_lock);
+
+       if (rx_tid->dst_ring_desc) {
+               if (rel_link_desc) {
+                       buf_addr_info = &rx_tid->dst_ring_desc->buf_addr_info;
+                       ath12k_wifi7_dp_rx_link_desc_return(dp->ab, buf_addr_info, act);
+               }
+               kfree(rx_tid->dst_ring_desc);
+               rx_tid->dst_ring_desc = NULL;
+       }
+
+       rx_tid->cur_sn = 0;
+       rx_tid->last_frag_no = 0;
+       rx_tid->rx_frag_bitmap = 0;
+       __skb_queue_purge(&rx_tid->rx_frags);
+}
+
 static int ath12k_wifi7_dp_rx_frag_h_mpdu(struct ath12k_pdev_dp *dp_pdev,
                                          struct sk_buff *msdu,
                                          struct hal_reo_dest_ring *ring_desc,
@@ -1154,7 +1178,7 @@ static int ath12k_wifi7_dp_rx_frag_h_mpdu(struct ath12k_pdev_dp *dp_pdev,
        if ((!skb_queue_empty(&rx_tid->rx_frags) && seqno != rx_tid->cur_sn) ||
            skb_queue_empty(&rx_tid->rx_frags)) {
                /* Flush stored fragments and start a new sequence */
-               ath12k_dp_rx_frags_cleanup(rx_tid, true);
+               ath12k_wifi7_dp_rx_frags_cleanup(rx_tid, true);
                rx_tid->cur_sn = seqno;
        }
 
@@ -1214,12 +1238,12 @@ static int ath12k_wifi7_dp_rx_frag_h_mpdu(struct ath12k_pdev_dp *dp_pdev,
        if (ath12k_wifi7_dp_rx_h_defrag_reo_reinject(dp, rx_tid, defrag_skb))
                goto err_frags_cleanup;
 
-       ath12k_dp_rx_frags_cleanup(rx_tid, false);
+       ath12k_wifi7_dp_rx_frags_cleanup(rx_tid, false);
        goto out_unlock;
 
 err_frags_cleanup:
        dev_kfree_skb_any(defrag_skb);
-       ath12k_dp_rx_frags_cleanup(rx_tid, true);
+       ath12k_wifi7_dp_rx_frags_cleanup(rx_tid, true);
 out_unlock:
        spin_unlock_bh(&dp->dp_lock);
        return ret;
index cb72b75526d4a6ece7478be410ca10554103b09d..85677258b1df10b8958a2f7ba4ef8f5c8c0dee88 100644 (file)
@@ -31,6 +31,8 @@ int ath12k_wifi7_dp_rx_assign_reoq(struct ath12k_base *ab, struct ath12k_dp_peer
 int ath12k_wifi7_dp_rx_link_desc_return(struct ath12k_base *ab,
                                        struct ath12k_buffer_addr *buf_addr_info,
                                        enum hal_wbm_rel_bm_act action);
+void ath12k_wifi7_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
+                                     bool rel_link_desc);
 void ath12k_wifi7_peer_rx_tid_qref_setup(struct ath12k_base *ab, u16 peer_id, u16 tid,
                                         dma_addr_t paddr);
 void ath12k_wifi7_dp_rx_peer_tid_delete(struct ath12k_base *ab,