diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 622d442fb1..3c57bcf54a 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -66,6 +66,7 @@ #include "lim_ft.h" #include "wlan_mlme_main.h" #include "qdf_util.h" +#include "wlan_qct_sys.h" #define ASCII_SPACE_CHARACTER 0x20 diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 604f25a8ad..f933aebcd3 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -37,6 +37,7 @@ #include "lim_trace.h" #include "include/wlan_vdev_mlme.h" #include "wlan_mlme_vdev_mgr_interface.h" +#include "wlan_qct_sys.h" typedef enum { ONE_BYTE = 1, 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 d2638df71d..12974587a3 100644 --- a/core/mac/src/sys/common/inc/wlan_qct_sys.h +++ b/core/mac/src/sys/common/inc/wlan_qct_sys.h @@ -36,6 +36,8 @@ #include #include +struct mac_context; + /*--------------------------------------------------------------------------- Preprocessor definitions and constants -------------------------------------------------------------------------*/ @@ -84,4 +86,20 @@ QDF_STATUS umac_stop(void); QDF_STATUS sys_mc_process_handler(struct scheduler_msg *msg); +/** + * sys_process_mmh_msg() - api to process an mmh message + * @mac: pointer to mac context + * @msg: pointer to message + * + * This API is used to process an mmh message. + * + * NOTE WELL: Ownership of the @msg bodyptr, if present, is always + * transferred, and the caller must not attempt to dereference or free + * the bodyptr after invoking this API. + * + * Return: none + */ +void sys_process_mmh_msg(struct mac_context *mac, + struct scheduler_msg *msg); + #endif /* WLAN_QCT_SYS_H__ */ 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 16802356f9..b4cd2c940f 100644 --- a/core/mac/src/sys/common/src/wlan_qct_sys.c +++ b/core/mac/src/sys/common/src/wlan_qct_sys.c @@ -194,46 +194,30 @@ QDF_STATUS sys_mc_process_handler(struct scheduler_msg *msg) return sys_mc_process_msg(msg); } -/** - * sys_process_mmh_msg() - this api to process mmh message - * @mac: pointer to mac context - * @pMsg: pointer to message - * - * This API is used to process mmh message - * - * Return: none - */ -void sys_process_mmh_msg(struct mac_context *mac, struct scheduler_msg *pMsg) +void sys_process_mmh_msg(struct mac_context *mac, struct scheduler_msg *msg) { - QDF_MODULE_ID targetMQ = QDF_MODULE_ID_SYS; + QDF_MODULE_ID dest_module = QDF_MODULE_ID_SYS; - /* - * The body of this pMsg is a tSirMbMsg - * Contrary to previous generation, we cannot free it here! - * It is up to the callee to free it - */ - if (NULL == pMsg) { - QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_ERROR, - "NULL Message Pointer"); + if (!msg) { QDF_ASSERT(0); return; } - switch (pMsg->type) { + switch (msg->type) { case eWNI_SME_SYS_READY_IND: /* Forward this message to the PE module */ - targetMQ = QDF_MODULE_ID_PE; + dest_module = QDF_MODULE_ID_PE; break; default: - if ((pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN) - && (pMsg->type <= eWNI_SME_MSG_TYPES_END)) { - targetMQ = QDF_MODULE_ID_SME; + if ((msg->type >= eWNI_SME_MSG_TYPES_BEGIN) && + (msg->type <= eWNI_SME_MSG_TYPES_END)) { + dest_module = QDF_MODULE_ID_SME; break; } QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_ERROR, - "Message of ID %d is not yet handled by SYS", - pMsg->type); + "Message of ID %d is not yet handled by SYS", + msg->type); QDF_ASSERT(0); } @@ -242,15 +226,7 @@ void sys_process_mmh_msg(struct mac_context *mac, struct scheduler_msg *pMsg) */ if (QDF_STATUS_SUCCESS != scheduler_post_message(QDF_MODULE_ID_SYS, QDF_MODULE_ID_SYS, - targetMQ, - pMsg)) { - /* - * Caller doesn't allocate memory for the pMsg. - * It allocate memory for bodyptr free the mem and return - */ - if (pMsg->bodyptr) - qdf_mem_free(pMsg->bodyptr); - } - + dest_module, + msg)) + qdf_mem_free(msg->bodyptr); } - diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 7e783a79b5..999d326d75 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -61,6 +61,7 @@ #include "wlan_mlme_api.h" #include "wlan_mlme_public_struct.h" #include +#include "wlan_qct_sys.h" #define RSN_AUTH_KEY_MGMT_SAE WLAN_RSN_SEL(WLAN_AKM_SAE) #define MAX_PWR_FCC_CHAN_12 8 diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 02e06e1eb8..b61158eee0 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -1017,9 +1017,6 @@ typedef struct tHalHiddenSsidVdevRestart { } tHalHiddenSsidVdevRestart, *tpHalHiddenSsidVdevRestart; -extern void sys_process_mmh_msg(struct mac_context *mac, - struct scheduler_msg *pMsg); - /** * struct tDisableIntraBssFwd - intra bss forward parameters * @sessionId: session id