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
This commit is contained in:
Shashikala Prabhu
2023-05-03 15:04:38 +05:30
committed by Madan Koyyalamudi
parent 8b6fd27e6e
commit 65e8b2f3d8
5 changed files with 67 additions and 0 deletions

View File

@@ -1408,4 +1408,25 @@ QDF_STATUS cdp_txrx_get_pdev_phyrx_error_mask(ol_txrx_soc_handle soc,
} }
#endif #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_ */ #endif /* _CDP_TXRX_CTRL_H_ */

View File

@@ -953,6 +953,7 @@ struct cdp_ctrl_ops {
uint32_t *mask, uint32_t *mask,
uint32_t *mask_cont); uint32_t *mask_cont);
#endif #endif
bool (*umac_reset_is_inprogress)(struct cdp_soc_t *psoc);
}; };
struct cdp_me_ops { struct cdp_me_ops {

View File

@@ -1589,4 +1589,32 @@ QDF_STATUS dp_mlo_umac_reset_stats_print(struct dp_soc *soc)
return QDF_STATUS_SUCCESS; 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 #endif

View File

@@ -2814,6 +2814,22 @@ QDF_STATUS dp_umac_reset_notify_asserted_soc(struct dp_soc *soc)
} }
#endif #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 #ifndef WLAN_SOFTUMAC_SUPPORT
QDF_STATUS dp_reo_send_cmd(struct dp_soc *soc, enum hal_reo_cmd_type type, QDF_STATUS dp_reo_send_cmd(struct dp_soc *soc, enum hal_reo_cmd_type type,
struct hal_reo_cmd_params *params, struct hal_reo_cmd_params *params,

View File

@@ -10866,6 +10866,7 @@ static struct cdp_ctrl_ops dp_ops_ctrl = {
.txrx_get_pdev_phyrx_error_mask = dp_get_pdev_phyrx_error_mask, .txrx_get_pdev_phyrx_error_mask = dp_get_pdev_phyrx_error_mask,
#endif #endif
.txrx_peer_flush_frags = dp_peer_flush_frags, .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 = { static struct cdp_me_ops dp_ops_me = {