diff options
Diffstat (limited to 'core/cds/src/cds_api.c')
-rw-r--r-- | core/cds/src/cds_api.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 0a57255bce..d633866fb9 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1857,12 +1857,51 @@ static void cds_trigger_recovery_work(void *param) } /** + * cds_get_recovery_reason() - get self recovery reason + * @reason: recovery reason + * + * Return: None + */ +void cds_get_recovery_reason(enum cds_hang_reason *reason) +{ + if (!gp_cds_context) { + cds_err("gp_cds_context is null"); + return; + } + + *reason = gp_cds_context->recovery_reason; +} + +/** + * cds_reset_recovery_reason() - reset the reason to unspecified + * + * Return: None + */ +void cds_reset_recovery_reason(void) +{ + if (!gp_cds_context) { + cds_err("gp_cds_context is null"); + return; + } + + gp_cds_context->recovery_reason = CDS_REASON_UNSPECIFIED; +} + +/** * cds_trigger_recovery() - trigger self recovery + * @reason: recovery reason * * Return: none */ -void cds_trigger_recovery(void) +void cds_trigger_recovery(enum cds_hang_reason reason) { + if (!gp_cds_context) { + cds_err("gp_cds_context is null"); + return; + } + + gp_cds_context->recovery_reason = reason; + if (in_atomic()) { qdf_queue_work(0, gp_cds_context->cds_recovery_wq, &gp_cds_context->cds_recovery_work); |