diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 1459706972..e37adc6419 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -1060,6 +1060,15 @@ error: qdf_nbuf_free(htt_msg); } +void htt_t2h_stats_handler(void *context) +{ + struct dp_soc *soc = (struct dp_soc *)context; + + if (soc && qdf_atomic_read(&soc->cmn_init_done)) + dp_process_htt_stat_msg(soc); + +} + /** * dp_txrx_fw_stats_handler():Function to process HTT EXT stats * @soc: DP SOC handle @@ -1116,7 +1125,7 @@ static inline void dp_txrx_fw_stats_handler(struct dp_soc *soc, * HTT EXT STATS message */ if (done) - dp_process_htt_stat_msg(soc); + qdf_sched_work(0, &soc->htt_stats_work); return; diff --git a/dp/wifi3.0/dp_htt.h b/dp/wifi3.0/dp_htt.h index 8b79188396..ce6b61e4bb 100644 --- a/dp/wifi3.0/dp_htt.h +++ b/dp/wifi3.0/dp_htt.h @@ -145,4 +145,12 @@ int htt_h2t_rx_ring_cfg(void *htt_soc, int pdev_id, void *hal_srng, int hal_ring_type, int ring_buf_size, struct htt_rx_ring_tlv_filter *htt_tlv_filter); +/* + * htt_t2h_stats_handler() - target to host stats work handler + * @context: context (dp soc context) + * + * Return: void + */ +void htt_t2h_stats_handler(void *context); + #endif /* _DP_HTT_H_ */ diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 37981b05df..b8671ea55b 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1510,6 +1510,9 @@ static void dp_soc_detach_wifi3(void *txrx_soc) qdf_atomic_set(&soc->cmn_init_done, 0); + qdf_flush_work(0, &soc->htt_stats_work); + qdf_disable_work(0, &soc->htt_stats_work); + for (i = 0; i < MAX_PDEV_CNT; i++) { if (soc->pdev_list[i]) dp_pdev_detach_wifi3( @@ -1714,6 +1717,10 @@ static int dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc) dp_rxdma_ring_config(soc); DP_STATS_INIT(soc); + + /* initialize work queue for stats processing */ + qdf_create_work(0, &soc->htt_stats_work, htt_t2h_stats_handler, soc); + return 0; } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index d41875c5e0..f08940158f 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -652,6 +652,8 @@ struct dp_soc { qdf_nbuf_queue_t htt_stats_msg; /* T2H Ext stats message length */ uint32_t htt_msg_len; + /* work queue to process htt stats */ + qdf_work_t htt_stats_work; }; #define MAX_RX_MAC_RINGS 2 /* Same as NAC_MAX_CLENT */