qcacmn: Separate qdf event complete and exit APIs
QDF already has event complete API. Define a separate new API for exit in QDF and re-use qdf_event_set for event completion. Change-Id: If332425ee71b0a4759e0550a33add35e61680309 CRs-Fixed: 1101614
This commit is contained in:
@@ -58,13 +58,12 @@ QDF_STATUS qdf_event_destroy(qdf_event_t *event);
|
||||
QDF_STATUS qdf_wait_single_event(qdf_event_t *event,
|
||||
uint32_t timeout);
|
||||
/**
|
||||
* qdf_event_complete_and_exit() - complete event and exit
|
||||
* @event: Pointer to an event to complete and exit
|
||||
* @reason_code: Reason code for exit
|
||||
* qdf_exit_thread() - exit thread execution
|
||||
* @status: QDF status
|
||||
*
|
||||
* Return: QDF status
|
||||
*/
|
||||
QDF_STATUS qdf_event_complete_and_exit(qdf_event_t *event, long reason_code);
|
||||
QDF_STATUS qdf_exit_thread(QDF_STATUS status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -268,34 +268,13 @@ QDF_STATUS qdf_wait_single_event(qdf_event_t *event, uint32_t timeout)
|
||||
}
|
||||
EXPORT_SYMBOL(qdf_wait_single_event);
|
||||
|
||||
QDF_STATUS qdf_event_complete_and_exit(qdf_event_t *event, long reason_code)
|
||||
QDF_STATUS qdf_exit_thread(QDF_STATUS status)
|
||||
{
|
||||
if (in_interrupt()) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s cannot be called from interrupt context!!!",
|
||||
__func__);
|
||||
QDF_ASSERT(0);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
/* check for null pointer */
|
||||
if (NULL == event) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
|
||||
"NULL event passed into %s", __func__);
|
||||
QDF_ASSERT(0);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
|
||||
/* check if cookie is same as that of initialized event */
|
||||
if (LINUX_EVENT_COOKIE != event->cookie) {
|
||||
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
|
||||
"Uninitialized event passed into %s", __func__);
|
||||
QDF_ASSERT(0);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
complete_and_exit(&event->complete, reason_code);
|
||||
if (status == QDF_STATUS_SUCCESS)
|
||||
do_exit(0);
|
||||
else
|
||||
do_exit(SIGKILL);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
EXPORT_SYMBOL(qdf_event_complete_and_exit);
|
||||
EXPORT_SYMBOL(qdf_exit_thread);
|
||||
|
@@ -411,7 +411,9 @@ int scheduler_thread(void *arg)
|
||||
/* If we get here the MC thread must exit */
|
||||
QDF_TRACE(QDF_MODULE_ID_SCHEDULER, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Scheduler thread exiting!!!!", __func__);
|
||||
qdf_event_complete_and_exit(&sch_ctx->sch_shutdown, 0);
|
||||
qdf_event_set(&sch_ctx->sch_shutdown);
|
||||
qdf_exit_thread(QDF_STATUS_SUCCESS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user