diff --git a/core/cds/inc/cds_sched.h b/core/cds/inc/cds_sched.h index dd703df0bb..12033e37a8 100644 --- a/core/cds/inc/cds_sched.h +++ b/core/cds/inc/cds_sched.h @@ -36,6 +36,7 @@ #include "qdf_mc_timer.h" #include "cds_config.h" #include "qdf_cpuhp.h" +#include "cdp_txrx_cmn_struct.h" #define MC_SUSPEND_EVENT 0x002 #define RX_POST_EVENT 0x001 @@ -341,6 +342,15 @@ void cds_free_ol_rx_pkt(p_cds_sched_context pSchedContext, * Return: none */ void cds_free_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext); + +/** + * cds_get_rx_thread_pending() - get rx thread status + * @soc: ol_txrx_soc_handle object + * + * Return: 1 if rx thread is not empty. + * 0 if rx thread is empty. + */ +int cds_get_rx_thread_pending(ol_txrx_soc_handle soc); #else static inline void cds_sched_handle_rx_thread_affinity_req( bool high_throughput) {} @@ -389,6 +399,10 @@ static inline int cds_sched_handle_throughput_req( return 0; } +static inline int cds_get_rx_thread_pending(ol_txrx_soc_handle soc) +{ + return 0; +} #endif /** diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 5ba03e2db7..922b8fbcf3 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -145,7 +145,9 @@ static struct ol_if_ops dp_ol_if_ops = { /* TODO: Add any other control path calls required to OL_IF/WMA layer */ }; #else -static struct ol_if_ops dp_ol_if_ops; +static struct ol_if_ops dp_ol_if_ops = { + .dp_rx_get_pending = cds_get_rx_thread_pending, +}; #endif static void cds_trigger_recovery_work(void *param); diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index 36a548dcae..5c1c518ebb 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -918,3 +918,35 @@ int cds_get_gfp_flags(void) return flags; } + +/** + * cds_get_rx_thread_pending(): get rx thread status + * @soc: ol_txrx_soc_handle object + * + * Return: 1 if rx thread is not empty. + * 0 if rx thread is empty + */ +#ifdef QCA_CONFIG_SMP +int cds_get_rx_thread_pending(ol_txrx_soc_handle soc) +{ + p_cds_sched_context cds_sched_context = get_cds_sched_ctxt(); + + if (!cds_sched_context) { + cds_err("cds_sched_context is NULL"); + return 0; + } + + spin_lock_bh(&cds_sched_context->ol_rx_queue_lock); + + if (list_empty(&cds_sched_context->ol_rx_thread_queue)) { + spin_unlock_bh(&cds_sched_context->ol_rx_queue_lock); + return 0; + } + + /* In helium there is no scope to get no of pending frames + * in rx thread, Hence return 1 if frames are queued + */ + spin_unlock_bh(&cds_sched_context->ol_rx_queue_lock); + return 1; +} +#endif