diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 1156dbe05cc4..02b0fdad56ae 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -759,7 +759,7 @@ typedef struct sAniSirLim { uint8_t gLimDfsChanSwTxCount; uint8_t gLimDfsTargetChanNum; QDF_STATUS(*sme_msg_callback) - (tHalHandle hal, struct scheduler_msg *msg); + (tpAniSirGlobal mac, struct scheduler_msg *msg); uint8_t retry_packet_cnt; uint8_t beacon_probe_rsp_cnt_per_scan; wlan_scan_requester req_id; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 68ea680fb8f9..3d5fea7b2879 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -412,7 +412,8 @@ typedef struct sSirSmeReadyReq { uint16_t transactionId; void *csr_roam_synch_cb; void *pe_roam_synch_cb; - void *sme_msg_cb; + QDF_STATUS (*sme_msg_cb)(tpAniSirGlobal mac, + struct scheduler_msg *msg); } tSirSmeReadyReq, *tpSirSmeReadyReq; /** diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 746c7dfcdba3..31ceba718314 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -340,7 +340,21 @@ QDF_STATUS sme_hdd_ready_ind(tHalHandle hHal); */ QDF_STATUS sme_ser_cmd_callback(void *buf, enum wlan_serialization_cb_reason reason); -QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg); + +/* + * sme_process_msg() - The main message processor for SME. + * @mac: The global mac context + * @msg: The message to be processed. + * + * This function is called by a message dispatcher when to process a message + * targeted for SME. + * This is a synchronous call + * + * Return: QDF_STATUS_SUCCESS - SME successfully processed the message. + * Other status means SME failed to process the message to HAL. + */ +QDF_STATUS sme_process_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg); + QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg); QDF_STATUS sme_scan_get_result(tHalHandle hHal, uint8_t sessionId, tCsrScanResultFilter *pFilter, @@ -1945,15 +1959,15 @@ void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id); /** * sme_process_msg_callback() - process callback message from LIM - * @hal: global hal handle + * @mac: global mac context * @msg: scheduler message * * This function process the callback messages from LIM. * * Return: QDF_STATUS enumeration. */ -QDF_STATUS sme_process_msg_callback(tHalHandle hal, - struct scheduler_msg *msg); +QDF_STATUS sme_process_msg_callback(tpAniSirGlobal mac, + struct scheduler_msg *msg); /** * sme_set_bmiss_bcnt() - set bmiss config parameters diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 8a64bdea1e2e..e7c8aa865e74 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -1952,21 +1952,9 @@ static QDF_STATUS sme_process_antenna_mode_resp(tpAniSirGlobal mac, return QDF_STATUS_SUCCESS; } -/* - * sme_process_msg() - The main message processor for SME. - * The function is called by a message dispatcher when to process a message - * targeted for SME. - * This is a synchronous call - * - * hHal - The handle returned by mac_open. - * pMsg - A pointer to a caller allocated object of tSirMsgQ. - * Return QDF_STATUS_SUCCESS - SME successfully process the message. - * Other status means SME failed to process the message to HAL. - */ -QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg) +QDF_STATUS sme_process_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg) { QDF_STATUS status = QDF_STATUS_E_FAILURE; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); struct sir_peer_info *peer_stats; struct sir_peer_info_resp *peer_info_rsp; @@ -2179,7 +2167,7 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, struct scheduler_msg *pMsg) MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_RX_WMA_MSG, NO_SESSION, pMsg->type)); if (pMsg->bodyptr) { - sme_nan_event(hHal, pMsg->bodyptr); + sme_nan_event(MAC_HANDLE(pMac), pMsg->bodyptr); qdf_mem_free(pMsg->bodyptr); } break; @@ -2403,7 +2391,7 @@ QDF_STATUS sme_mc_process_handler(struct scheduler_msg *msg) return QDF_STATUS_E_FAILURE; } - return sme_process_msg((tHalHandle)mac_ctx, msg); + return sme_process_msg(mac_ctx, msg); } /** @@ -15636,8 +15624,8 @@ QDF_STATUS sme_get_chain_rssi(tHalHandle hal, return status; } -QDF_STATUS sme_process_msg_callback(tHalHandle hal, - struct scheduler_msg *msg) +QDF_STATUS sme_process_msg_callback(tpAniSirGlobal mac, + struct scheduler_msg *msg) { QDF_STATUS status = QDF_STATUS_E_FAILURE; @@ -15645,7 +15633,7 @@ QDF_STATUS sme_process_msg_callback(tHalHandle hal, sme_err("Empty message for SME Msg callback"); return status; } - status = sme_process_msg(hal, msg); + status = sme_process_msg(mac, msg); return status; }