From edfaf0bc96635ca555bf8c9233beb83ec837cb89 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 29 Jun 2018 12:47:11 -0700 Subject: [PATCH] qcacld-3.0: Consolidate PE message handling During the review of "qcacld-3.0: lim: Replace tSirRetStatus with QDF_STATUS" it was observed that the documentation for function pe_process_messages() referenced an incorrect return type and return value. While addressing this issue it was further observed that pe_process_messages() was only being called from within lim_api.c by pe_mc_process_handler(). Since these are both trivial functions, consolidate them into one function. Change-Id: Ia66088b79003e0c8c517a8e3ae32540c19fec070 CRs-Fixed: 2271550 --- core/mac/src/pe/include/lim_api.h | 25 ++++++++--------- core/mac/src/pe/lim/lim_api.c | 45 ++++++++----------------------- 2 files changed, 22 insertions(+), 48 deletions(-) diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 5572c261ff13..e24fba26d229 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -306,20 +306,17 @@ static inline void lim_get_rf_band_new(tpAniSirGlobal pMac, *band = psessionEntry ? psessionEntry->limRFBand : BAND_UNKNOWN; } -/*-------------------------------------------------------------------------- - - \brief pe_process_messages() - Message Processor for PE - - Voss calls this function to dispatch the message to PE - - \param pMac - Pointer to Global MAC structure - \param pMsg - Pointer to the message structure - - \return QDF_STATUS_SUCCESS on success, other QDF_STATUS on error - - --------------------------------------------------------------------------*/ -QDF_STATUS pe_process_messages(tpAniSirGlobal pMac, - struct scheduler_msg *pMsg); +/** + * pe_mc_process_handler() - Message Processor for PE + * @msg: Pointer to the message structure + * + * Verifies the system is in a mode where messages are expected to be + * processed, and if so, routes the message to the appropriate handler + * based upon message type. + * + * Return: QDF_STATUS_SUCCESS if the message was handled, otherwise an + * appropriate QDF_STATUS error code + */ QDF_STATUS pe_mc_process_handler(struct scheduler_msg *msg); /** ------------------------------------------------------------- diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 80b7a5a4417b..6644b4858f2b 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -1059,49 +1059,26 @@ QDF_STATUS lim_post_msg_high_priority(tpAniSirGlobal mac, msg, true); } -/*-------------------------------------------------------------------------- - - \brief pe_process_messages() - Message Processor for PE - - Voss calls this function to dispatch the message to PE - - \param pMac - Pointer to Global MAC structure - \param pMsg - Pointer to the message structure - - \return uint32_t - TX_SUCCESS for success. - - --------------------------------------------------------------------------*/ - -QDF_STATUS pe_process_messages(tpAniSirGlobal pMac, - struct scheduler_msg *pMsg) -{ - if (ANI_DRIVER_TYPE(pMac) == QDF_DRIVER_TYPE_MFG) { - return QDF_STATUS_SUCCESS; - } - /** - * If the Message to be handled is for CFG Module call the CFG Msg - * Handler and for all the other cases post it to LIM - */ - if (SIR_CFG_PARAM_UPDATE_IND != pMsg->type && IS_CFG_MSG(pMsg->type)) - cfg_process_mb_msg(pMac, (tSirMbMsg *) pMsg->bodyptr); - else - lim_message_processor(pMac, pMsg); - return QDF_STATUS_SUCCESS; -} - QDF_STATUS pe_mc_process_handler(struct scheduler_msg *msg) { - QDF_STATUS status; tpAniSirGlobal mac_ctx = cds_get_context(QDF_MODULE_ID_PE); if (mac_ctx == NULL) return QDF_STATUS_E_FAILURE; - status = pe_process_messages(mac_ctx, msg); - if (status == QDF_STATUS_SUCCESS) + if (ANI_DRIVER_TYPE(mac_ctx) == QDF_DRIVER_TYPE_MFG) return QDF_STATUS_SUCCESS; - return QDF_STATUS_E_FAILURE; + /* + * If the Message to be handled is for CFG Module call the CFG Msg + * Handler and for all the other cases post it to LIM + */ + if (SIR_CFG_PARAM_UPDATE_IND != msg->type && IS_CFG_MSG(msg->type)) + cfg_process_mb_msg(mac_ctx, msg->bodyptr); + else + lim_message_processor(mac_ctx, msg); + + return QDF_STATUS_SUCCESS; } /**