From 65e8b2f3d8f9f166044e7bfda530266a8f5bd88e Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Wed, 3 May 2023 15:04:38 +0530 Subject: [PATCH] qcacmn: Add CDP API to check if UMAC reset is in progress Add CDP API to check if UMAC reset is in progress. Change-Id: I9b5891f61278aa6be52ee2e8d5f9de3185d92eef CRs-Fixed: 3475148 --- dp/inc/cdp_txrx_ctrl.h | 21 +++++++++++++++++++++ dp/inc/cdp_txrx_ops.h | 1 + dp/wifi3.0/be/mlo/dp_mlo.c | 28 ++++++++++++++++++++++++++++ dp/wifi3.0/dp_internal.h | 16 ++++++++++++++++ dp/wifi3.0/dp_main.c | 1 + 5 files changed, 67 insertions(+) diff --git a/dp/inc/cdp_txrx_ctrl.h b/dp/inc/cdp_txrx_ctrl.h index 26194191cb..469ab7eb7d 100644 --- a/dp/inc/cdp_txrx_ctrl.h +++ b/dp/inc/cdp_txrx_ctrl.h @@ -1408,4 +1408,25 @@ QDF_STATUS cdp_txrx_get_pdev_phyrx_error_mask(ol_txrx_soc_handle soc, } #endif +/** + * cdp_umac_reset_is_inprogress() - API to check if umac reset is in progress + * @soc: opaque soc handle + * + * Return: true if umac reset is in progress, else false. + */ +static inline bool +cdp_umac_reset_is_inprogress(ol_txrx_soc_handle soc) +{ + if (!soc || !soc->ops) { + dp_cdp_debug("Invalid Instance:"); + QDF_BUG(0); + return false; + } + + if (!soc->ops->ctrl_ops || + !soc->ops->ctrl_ops->umac_reset_is_inprogress) + return false; + + return soc->ops->ctrl_ops->umac_reset_is_inprogress(soc); +} #endif /* _CDP_TXRX_CTRL_H_ */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index fb89958efa..28768c8b33 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -953,6 +953,7 @@ struct cdp_ctrl_ops { uint32_t *mask, uint32_t *mask_cont); #endif + bool (*umac_reset_is_inprogress)(struct cdp_soc_t *psoc); }; struct cdp_me_ops { diff --git a/dp/wifi3.0/be/mlo/dp_mlo.c b/dp/wifi3.0/be/mlo/dp_mlo.c index ec08fa5c6d..bc1d2430c4 100644 --- a/dp/wifi3.0/be/mlo/dp_mlo.c +++ b/dp/wifi3.0/be/mlo/dp_mlo.c @@ -1589,4 +1589,32 @@ QDF_STATUS dp_mlo_umac_reset_stats_print(struct dp_soc *soc) return QDF_STATUS_SUCCESS; } + +bool dp_umac_reset_is_inprogress(struct cdp_soc_t *psoc) +{ + struct dp_soc_umac_reset_ctx *umac_reset_ctx; + struct dp_soc *soc = (struct dp_soc *)psoc; + struct dp_soc_mlo_umac_reset_ctx *grp_umac_reset_ctx; + struct dp_soc_be *be_soc = NULL; + struct dp_mlo_ctxt *mlo_ctx = NULL; + + if (!soc) { + dp_umac_reset_err("DP SOC is null"); + return false; + } + + umac_reset_ctx = &soc->umac_reset_ctx; + + be_soc = dp_get_be_soc_from_dp_soc(soc); + if (be_soc) + mlo_ctx = be_soc->ml_ctxt; + + if (mlo_ctx) { + grp_umac_reset_ctx = &mlo_ctx->grp_umac_reset_ctx; + return grp_umac_reset_ctx->umac_reset_in_progress; + } else { + return (umac_reset_ctx->current_state != + UMAC_RESET_STATE_WAIT_FOR_TRIGGER); + } +} #endif diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index f52fcb6e3c..245f919000 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -2814,6 +2814,22 @@ QDF_STATUS dp_umac_reset_notify_asserted_soc(struct dp_soc *soc) } #endif +#ifdef DP_UMAC_HW_RESET_SUPPORT +/** + * dp_umac_reset_is_inprogress() - Check if umac reset is in progress + * @psoc: dp soc handle + * + * Return: true if umac reset is in progress, else false. + */ +bool dp_umac_reset_is_inprogress(struct cdp_soc_t *psoc); +#else +static inline +bool dp_umac_reset_is_inprogress(struct cdp_soc_t *psoc) +{ + return false; +} +#endif + #ifndef WLAN_SOFTUMAC_SUPPORT QDF_STATUS dp_reo_send_cmd(struct dp_soc *soc, enum hal_reo_cmd_type type, struct hal_reo_cmd_params *params, diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index b0c07eac27..cff67e7ce9 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -10866,6 +10866,7 @@ static struct cdp_ctrl_ops dp_ops_ctrl = { .txrx_get_pdev_phyrx_error_mask = dp_get_pdev_phyrx_error_mask, #endif .txrx_peer_flush_frags = dp_peer_flush_frags, + .umac_reset_is_inprogress = dp_umac_reset_is_inprogress, }; static struct cdp_me_ops dp_ops_me = {