]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Add framework for hardware specific DP interrupt handler
authorRipan Deuri <quic_rdeuri@quicinc.com>
Tue, 30 Sep 2025 13:10:04 +0000 (18:40 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 30 Sep 2025 16:12:58 +0000 (09:12 -0700)
Currently, the DP service SRNG handler is invoked directly from the NAPI
poll handler, which prevents using different handlers for different
architectures. To fix this, introduce a DP architecture-ops table to
invoke architecture specific handler from NAPI poll handler. Future patches
will leverage this framework to invoke architecture-specific handlers from
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: Ripan Deuri <quic_rdeuri@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20250930131005.2884253-6-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/ahb.c
drivers/net/wireless/ath/ath12k/dp.h
drivers/net/wireless/ath/ath12k/pci.c
drivers/net/wireless/ath/ath12k/wifi7/dp.c
drivers/net/wireless/ath/ath12k/wifi7/dp.h

index c545bea18935c721ec9c39626c3a0d2a1e869488..7eb8dedaa9474657b19ad66193ec4d37a276f741 100644 (file)
@@ -525,9 +525,10 @@ static int ath12k_ahb_ext_grp_napi_poll(struct napi_struct *napi, int budget)
                                                struct ath12k_ext_irq_grp,
                                                napi);
        struct ath12k_base *ab = irq_grp->ab;
+       struct ath12k_dp *dp = ath12k_ab_to_dp(ab);
        int work_done;
 
-       work_done = ath12k_wifi7_dp_service_srng(ab, irq_grp, budget);
+       work_done = ath12k_dp_service_srng(dp, irq_grp, budget);
        if (work_done < budget) {
                napi_complete_done(napi, work_done);
                ath12k_ahb_ext_grp_enable(irq_grp);
index 05f48b461774ba253dda91377bf417f6638e74cf..546f73e46c41bd7c7e14aff3498bda4527c432ec 100644 (file)
@@ -367,6 +367,15 @@ struct ath12k_link_stats {
        u32 tx_desc_type[HAL_TCL_DESC_TYPE_MAX];
 };
 
+/* DP arch ops to communicate from common module
+ * to arch specific module
+ */
+struct ath12k_dp_arch_ops {
+       int (*service_srng)(struct ath12k_dp *dp,
+                           struct ath12k_ext_irq_grp *irq_grp,
+                           int budget);
+};
+
 struct ath12k_dp {
        struct ath12k_base *ab;
        u32 mon_dest_ring_stuck_cnt;
@@ -430,6 +439,8 @@ struct ath12k_dp {
 
        struct ath12k_hw_group *ag;
        u8 device_id;
+
+       struct ath12k_dp_arch_ops *ops;
 };
 
 static inline void ath12k_dp_get_mac_addr(u32 addr_l32, u16 addr_h16, u8 *addr)
@@ -444,6 +455,13 @@ ath12k_dp_hw_grp_to_dp(struct ath12k_dp_hw_group *dp_hw_grp, u8 device_id)
        return dp_hw_grp->dp[device_id];
 }
 
+static inline int
+ath12k_dp_service_srng(struct ath12k_dp *dp, struct ath12k_ext_irq_grp *irq_grp,
+                      int budget)
+{
+       return dp->ops->service_srng(dp, irq_grp, budget);
+}
+
 void ath12k_dp_vdev_tx_attach(struct ath12k *ar, struct ath12k_link_vif *arvif);
 void ath12k_dp_cc_config(struct ath12k_base *ab);
 void ath12k_dp_partner_cc_init(struct ath12k_base *ab);
index 672cf2899681adf011b8e54c83310344c3f162aa..6925abed190a0569c8d7ac57a7e2cd18a880a044 100644 (file)
@@ -479,10 +479,11 @@ static int ath12k_pci_ext_grp_napi_poll(struct napi_struct *napi, int budget)
                                                struct ath12k_ext_irq_grp,
                                                napi);
        struct ath12k_base *ab = irq_grp->ab;
+       struct ath12k_dp *dp = ath12k_ab_to_dp(ab);
        int work_done;
        int i;
 
-       work_done = ath12k_wifi7_dp_service_srng(ab, irq_grp, budget);
+       work_done = ath12k_dp_service_srng(dp, irq_grp, budget);
        if (work_done < budget) {
                napi_complete_done(napi, work_done);
                for (i = 0; i < irq_grp->num_irq; i++)
index adc3480b282b3ae8845a0d5dba226654a72cd5f7..4465a9e93bf85fd0a58ac79b4fa80dd280b5c345 100644 (file)
 #include "dp.h"
 #include "dp_tx.h"
 
-int ath12k_wifi7_dp_service_srng(struct ath12k_base *ab,
-                                struct ath12k_ext_irq_grp *irq_grp,
-                                int budget)
+static int ath12k_wifi7_dp_service_srng(struct ath12k_dp *dp,
+                                       struct ath12k_ext_irq_grp *irq_grp,
+                                       int budget)
 {
+       struct ath12k_base *ab = dp->ab;
        struct napi_struct *napi = &irq_grp->napi;
        int grp_id = irq_grp->grp_id;
        int work_done = 0;
@@ -134,6 +135,10 @@ done:
        return tot_work_done;
 }
 
+static struct ath12k_dp_arch_ops ath12k_wifi7_dp_arch_ops = {
+       .service_srng = ath12k_wifi7_dp_service_srng,
+};
+
 /* TODO: remove export once this file is built with wifi7 ko */
 struct ath12k_dp *ath12k_wifi7_dp_device_alloc(struct ath12k_base *ab)
 {
@@ -148,6 +153,8 @@ struct ath12k_dp *ath12k_wifi7_dp_device_alloc(struct ath12k_base *ab)
        dp->dev = ab->dev;
        dp->hw_params = ab->hw_params;
 
+       dp->ops = &ath12k_wifi7_dp_arch_ops;
+
        return dp;
 }
 EXPORT_SYMBOL(ath12k_wifi7_dp_device_alloc);
index 2300fda657865ffbaf6a0da45c992d84ebdfa95f..72fdfb368c994ebe605473aec3914eacc3fa7611 100644 (file)
@@ -13,8 +13,6 @@
 struct ath12k_base;
 struct ath12k_dp;
 
-int ath12k_wifi7_dp_service_srng(struct ath12k_base *ab,
-                                struct ath12k_ext_irq_grp *irq_grp, int budget);
 struct ath12k_dp *ath12k_wifi7_dp_device_alloc(struct ath12k_base *ab);
 void ath12k_wifi7_dp_device_free(struct ath12k_dp *dp);