wifi: ath12k: Add framework for hardware specific DP interrupt handler

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>
This commit is contained in:
Ripan Deuri 2025-09-30 18:40:04 +05:30 committed by Jeff Johnson
parent 914c890d3b
commit 39538dc886
5 changed files with 32 additions and 7 deletions

View 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);

View 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);

View 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++)

View File

@ -13,10 +13,11 @@
#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 @@ int ath12k_wifi7_dp_service_srng(struct ath12k_base *ab,
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);

View 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);