diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 7135ebf9bb..2a81b6393b 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -2596,6 +2596,24 @@ dp_get_tcl_cmd_cred_ring_state_from_hal(struct dp_pdev *pdev, } #endif +#ifndef WLAN_DP_DISABLE_TCL_STATUS_SRNG +static inline QDF_STATUS +dp_get_tcl_status_ring_state_from_hal(struct dp_pdev *pdev, + struct dp_srng_ring_state *ring_state) +{ + return dp_get_srng_ring_state_from_hal(pdev->soc, pdev, + &pdev->soc->tcl_status_ring, + TCL_STATUS, ring_state); +} +#else +static inline QDF_STATUS +dp_get_tcl_status_ring_state_from_hal(struct dp_pdev *pdev, + struct dp_srng_ring_state *ring_state) +{ + return QDF_STATUS_SUCCESS; +} +#endif + /** * dp_queue_srng_ring_stats(): Print pdev hal level ring stats * @pdev: DP_pdev handle @@ -2669,12 +2687,8 @@ static void dp_queue_ring_stats(struct dp_pdev *pdev) if (status == QDF_STATUS_SUCCESS) qdf_assert_always(++j < DP_MAX_SRNGS); - status = dp_get_srng_ring_state_from_hal - (pdev->soc, pdev, - &pdev->soc->tcl_status_ring, - TCL_STATUS, - &soc_srngs_state->ring_state[j]); - + status = dp_get_tcl_status_ring_state_from_hal + (pdev, &soc_srngs_state->ring_state[j]); if (status == QDF_STATUS_SUCCESS) qdf_assert_always(++j < DP_MAX_SRNGS); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index bd84641181..c4aa5e6ef7 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -14545,6 +14545,70 @@ static inline void dp_tx_init_cmd_credit_ring(struct dp_soc *soc) } #endif +#ifndef WLAN_DP_DISABLE_TCL_STATUS_SRNG +static inline QDF_STATUS dp_soc_tcl_status_srng_init(struct dp_soc *soc) +{ + QDF_STATUS status; + + status = dp_srng_init(soc, &soc->tcl_status_ring, TCL_STATUS, 0, 0); + if (QDF_IS_STATUS_ERROR(status)) + return status; + + wlan_minidump_log(soc->tcl_status_ring.base_vaddr_unaligned, + soc->tcl_status_ring.alloc_size, + soc->ctrl_psoc, + WLAN_MD_DP_SRNG_TCL_STATUS, + "wbm_desc_rel_ring"); + + return QDF_STATUS_SUCCESS; +} + +static inline void dp_soc_tcl_status_srng_deinit(struct dp_soc *soc) +{ + wlan_minidump_remove(soc->tcl_status_ring.base_vaddr_unaligned, + soc->tcl_status_ring.alloc_size, + soc->ctrl_psoc, WLAN_MD_DP_SRNG_TCL_STATUS, + "wbm_desc_rel_ring"); + dp_srng_deinit(soc, &soc->tcl_status_ring, TCL_STATUS, 0); +} + +static inline QDF_STATUS dp_soc_tcl_status_srng_alloc(struct dp_soc *soc) +{ + struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx = soc->wlan_cfg_ctx; + uint32_t entries; + QDF_STATUS status = QDF_STATUS_SUCCESS; + + entries = wlan_cfg_get_dp_soc_tcl_status_ring_size(soc_cfg_ctx); + status = dp_srng_alloc(soc, &soc->tcl_status_ring, + TCL_STATUS, entries, 0); + + return status; +} + +static inline void dp_soc_tcl_status_srng_free(struct dp_soc *soc) +{ + dp_srng_free(soc, &soc->tcl_status_ring); +} +#else +static inline QDF_STATUS dp_soc_tcl_status_srng_init(struct dp_soc *soc) +{ + return QDF_STATUS_SUCCESS; +} + +static inline void dp_soc_tcl_status_srng_deinit(struct dp_soc *soc) +{ +} + +static inline QDF_STATUS dp_soc_tcl_status_srng_alloc(struct dp_soc *soc) +{ + return QDF_STATUS_SUCCESS; +} + +static inline void dp_soc_tcl_status_srng_free(struct dp_soc *soc) +{ +} +#endif + /** * dp_soc_srng_deinit() - de-initialize soc srng rings * @soc: Datapath soc handle @@ -14576,12 +14640,7 @@ static void dp_soc_srng_deinit(struct dp_soc *soc) /* TCL command and status rings */ dp_soc_tcl_cmd_cred_srng_deinit(soc); - - wlan_minidump_remove(soc->tcl_status_ring.base_vaddr_unaligned, - soc->tcl_status_ring.alloc_size, - soc->ctrl_psoc, WLAN_MD_DP_SRNG_TCL_STATUS, - "wbm_desc_rel_ring"); - dp_srng_deinit(soc, &soc->tcl_status_ring, TCL_STATUS, 0); + dp_soc_tcl_status_srng_deinit(soc); for (i = 0; i < soc->num_reo_dest_rings; i++) { /* TODO: Get number of rings and ring sizes @@ -14666,17 +14725,11 @@ static QDF_STATUS dp_soc_srng_init(struct dp_soc *soc) goto fail1; } - if (dp_srng_init(soc, &soc->tcl_status_ring, TCL_STATUS, 0, 0)) { + if (dp_soc_tcl_status_srng_init(soc)) { dp_init_err("%pK: dp_srng_init failed for tcl_status_ring", soc); goto fail1; } - wlan_minidump_log(soc->tcl_status_ring.base_vaddr_unaligned, - soc->tcl_status_ring.alloc_size, - soc->ctrl_psoc, - WLAN_MD_DP_SRNG_TCL_STATUS, - "wbm_desc_rel_ring"); - /* REO reinjection ring */ if (dp_srng_init(soc, &soc->reo_reinject_ring, REO_REINJECT, 0, 0)) { dp_init_err("%pK: dp_srng_init failed for reo_reinject_ring", soc); @@ -14814,8 +14867,7 @@ static void dp_soc_srng_free(struct dp_soc *soc) } dp_soc_tcl_cmd_cred_srng_free(soc); - - dp_srng_free(soc, &soc->tcl_status_ring); + dp_soc_tcl_status_srng_free(soc); for (i = 0; i < soc->num_reo_dest_rings; i++) dp_srng_free(soc, &soc->reo_dest_ring[i]); @@ -14860,9 +14912,7 @@ static QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc) goto fail1; } - entries = wlan_cfg_get_dp_soc_tcl_status_ring_size(soc_cfg_ctx); - if (dp_srng_alloc(soc, &soc->tcl_status_ring, TCL_STATUS, entries, - 0)) { + if (dp_soc_tcl_status_srng_alloc(soc)) { dp_init_err("%pK: dp_srng_alloc failed for tcl_status_ring", soc); goto fail1; } diff --git a/hal/wifi3.0/kiwi/hal_kiwi.c b/hal/wifi3.0/kiwi/hal_kiwi.c index df817a3260..434ed8917c 100644 --- a/hal/wifi3.0/kiwi/hal_kiwi.c +++ b/hal/wifi3.0/kiwi/hal_kiwi.c @@ -2030,7 +2030,11 @@ struct hal_hw_srng_config hw_srng_table_kiwi[] = { }, { /* TCL_STATUS */ .start_ring_id = HAL_SRNG_TCL_STATUS, +#ifndef WLAN_DP_DISABLE_TCL_CMD_CRED_SRNG .max_rings = 1, +#else + .max_rings = 0, +#endif /* confirm that TLV header is needed */ .entry_size = sizeof(struct tcl_status_ring) >> 2, .lmac_ring = FALSE,