summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/cds/src/cds_api.c11
-rw-r--r--core/mac/src/sys/common/inc/wlan_qct_sys.h77
-rw-r--r--core/mac/src/sys/common/src/wlan_qct_sys.c59
3 files changed, 45 insertions, 102 deletions
diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c
index d67c346df6..deddb962ad 100644
--- a/core/cds/src/cds_api.c
+++ b/core/cds/src/cds_api.c
@@ -856,17 +856,8 @@ QDF_STATUS cds_disable(v_CONTEXT_t cds_context)
cds_err("Invalid PE context return!");
return QDF_STATUS_E_INVAL;
}
- qdf_status = sme_stop(handle, HAL_STOP_TYPE_SYS_DEEP_SLEEP);
- if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- cds_err("Failed to stop SME: %d", qdf_status);
- QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
- }
- qdf_status = mac_stop(handle, HAL_STOP_TYPE_SYS_DEEP_SLEEP);
- if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
- cds_err("Failed to stop MAC");
- QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
- }
+ umac_stop(cds_context);
return qdf_status;
}
diff --git a/core/mac/src/sys/common/inc/wlan_qct_sys.h b/core/mac/src/sys/common/inc/wlan_qct_sys.h
index 9f51f4c1e4..87dad898d5 100644
--- a/core/mac/src/sys/common/inc/wlan_qct_sys.h
+++ b/core/mac/src/sys/common/inc/wlan_qct_sys.h
@@ -53,22 +53,16 @@
Type declarations
-------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
-
- \brief sysResponseCback() - SYS async resonse callback
-
- This is a protype for the callback function that SYS makes to various
- modules in the system.
-
- \param pUserData - user data that is passed to the Callback function
- when it is invoked.
-
- \return Nothing
-
- \sa sysMcStart(), sysMcThreadProbe(), sysTxThreadProbe()
-
- --------------------------------------------------------------------------*/
-typedef void (*sysResponseCback)(void *pUserData);
+/**
+ * sys_rsp_cb() - SYS async resonse callback
+ * @user_data: context data for callback
+ *
+ * This is a protype for the callback function that SYS makes to various
+ * modules in the system.
+ *
+ * Return: None
+ */
+typedef void (*sys_rsp_cb)(void *user_data);
typedef enum {
SYS_MSG_ID_MC_START,
@@ -114,50 +108,13 @@ typedef enum {
--------------------------------------------------------------------------*/
QDF_STATUS sys_build_message_header(SYS_MSG_ID sysMsgId, cds_msg_t *pMsg);
-/*----------------------------------------------------------------------------
-
- \brief sysMcStart() - start the system Main Controller thread.
-
- This function starts the SYS (Main Controller) module. Starting this
- module triggers the CFG download to the 'legacy' MAC software.
-
- \param p_cds_context - pointer to the CDS Context
-
- \param userCallback - this is a callback that is called when the SYS
- has completed the 'start' funciton.
-
- \param pUserData - pointer to some user data entity that is passed to
- the callback function as a parameter when invoked.
-
- \return QDF_STATUS_SUCCESS -
-
- \todo: We have not 'status' on the callback. How do we notify the
- callback that there is a failure ?
-
- \sa
-
- --------------------------------------------------------------------------*/
-QDF_STATUS sysMcStart(v_CONTEXT_t p_cds_context, sysResponseCback userCallback,
- void *pUserData);
-
-/*----------------------------------------------------------------------------
-
- \brief sys_stop() - Stop the SYS module.
-
- This function stops the SYS module.
-
- \todo: What else do we need to do on sys_stop()?
-
- \param p_cds_context - pointer to the CDS Context
-
- \return QDF_STATUS_SUCCESS - the SYS module is stopped.
-
- QDF_STATUS_E_FAILURE - the SYS module open failed to stop.
-
- \sa
-
- --------------------------------------------------------------------------*/
-QDF_STATUS sys_stop(v_CONTEXT_t p_cds_context);
+/**
+ * umac_stop() - send schedule message to mc thread to stop umac (sme and mac)
+ * @p_cds_context: cds context
+ *
+ * Return: status of operation
+ */
+QDF_STATUS umac_stop(v_CONTEXT_t p_cds_context);
/*----------------------------------------------------------------------------
diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c
index 1693ecc050..c224720d65 100644
--- a/core/mac/src/sys/common/src/wlan_qct_sys.c
+++ b/core/mac/src/sys/common/src/wlan_qct_sys.c
@@ -50,57 +50,57 @@ static qdf_event_t g_stop_evt;
/**
* sys_build_message_header() - to build the sys message header
- * @sysMsgId: message id
- * @pMsg: pointer to message context
+ * @msg_id: message id
+ * @msg: pointer to message context
*
* This API is used to build the sys message header.
*
* Return: QDF_STATUS
*/
-QDF_STATUS sys_build_message_header(SYS_MSG_ID sysMsgId, cds_msg_t *pMsg)
+QDF_STATUS sys_build_message_header(SYS_MSG_ID msg_id, cds_msg_t *msg)
{
- pMsg->type = sysMsgId;
- pMsg->reserved = SYS_MSG_COOKIE;
+ msg->type = msg_id;
+ msg->reserved = SYS_MSG_COOKIE;
return QDF_STATUS_SUCCESS;
}
/**
- * sys_stop_complete_cb() - a callback when system stop completes
- * @pUserData: pointer to user provided data context
+ * umac_stop_complete_cb() - a callback when system stop completes
+ * @user_data: pointer to user provided data context
*
* this callback is used once system stop is completed.
*
* Return: none
*/
#ifdef QDF_ENABLE_TRACING
-static void sys_stop_complete_cb(void *pUserData)
+static void umac_stop_complete_cb(void *user_data)
{
- qdf_event_t *pStopEvt = (qdf_event_t *) pUserData;
- QDF_STATUS qdf_status = qdf_event_set(pStopEvt);
+ qdf_event_t *stop_evt = (qdf_event_t *) user_data;
+ QDF_STATUS qdf_status = qdf_event_set(stop_evt);
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
}
#else
-static void sys_stop_complete_cb(void *pUserData)
+static void umac_stop_complete_cb(void *user_data)
{
return;
}
#endif
/**
- * sys_stop() - To post stop message to system module
+ * umac_stop() - To post stop message to system module
* @p_cds_context: pointer to cds context
*
* This API is used post a stop message to system module
*
* Return: QDF_STATUS
*/
-QDF_STATUS sys_stop(v_CONTEXT_t p_cds_context)
+QDF_STATUS umac_stop(v_CONTEXT_t p_cds_context)
{
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
- cds_msg_t sysMsg;
+ cds_msg_t umac_stop_msg;
/* Initialize the stop event */
qdf_status = qdf_event_create(&g_stop_evt);
@@ -109,14 +109,14 @@ QDF_STATUS sys_stop(v_CONTEXT_t p_cds_context)
return qdf_status;
/* post a message to SYS module in MC to stop SME and MAC */
- sys_build_message_header(SYS_MSG_ID_MC_STOP, &sysMsg);
+ sys_build_message_header(SYS_MSG_ID_MC_STOP, &umac_stop_msg);
/* Save the user callback and user data */
- sysMsg.callback = sys_stop_complete_cb;
- sysMsg.bodyptr = (void *)&g_stop_evt;
+ umac_stop_msg.callback = umac_stop_complete_cb;
+ umac_stop_msg.bodyptr = (void *)&g_stop_evt;
/* post the message.. */
- qdf_status = cds_mq_post_message(QDF_MODULE_ID_SYS, &sysMsg);
+ qdf_status = cds_mq_post_message(QDF_MODULE_ID_SYS, &umac_stop_msg);
if (!QDF_IS_STATUS_SUCCESS(qdf_status))
qdf_status = QDF_STATUS_E_BADMSG;
@@ -178,26 +178,21 @@ QDF_STATUS sys_mc_process_msg(v_CONTEXT_t p_cds_context, cds_msg_t *pMsg)
case SYS_MSG_ID_MC_STOP:
QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_INFO,
"Processing SYS MC STOP");
-
- /* get the HAL context... */
hHal = cds_get_context(QDF_MODULE_ID_PE);
if (NULL == hHal) {
QDF_TRACE(QDF_MODULE_ID_SYS,
QDF_TRACE_LEVEL_ERROR,
"%s: Invalid hHal", __func__);
- } else {
- qdf_status = sme_stop(hHal,
- HAL_STOP_TYPE_SYS_DEEP_SLEEP);
- QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
- qdf_status = mac_stop(hHal,
- HAL_STOP_TYPE_SYS_DEEP_SLEEP);
- QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
-
- ((sysResponseCback) pMsg->callback)(
- (void *)pMsg->bodyptr);
-
- qdf_status = QDF_STATUS_SUCCESS;
+ break;
}
+ qdf_status = sme_stop(hHal,
+ HAL_STOP_TYPE_SYS_DEEP_SLEEP);
+ QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
+ qdf_status = mac_stop(hHal,
+ HAL_STOP_TYPE_SYS_DEEP_SLEEP);
+ QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
+ ((sys_rsp_cb) pMsg->callback)(pMsg->bodyptr);
+ qdf_status = QDF_STATUS_SUCCESS;
break;
case SYS_MSG_ID_MC_THR_PROBE: