diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index 757daa3595..f6499a059e 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -837,6 +837,8 @@ typedef struct sAniSirLim { QDF_STATUS(*add_bssdescr_callback) (tpAniSirGlobal pMac, tpSirBssDescription buf, uint32_t scan_id, uint32_t flags); + QDF_STATUS(*sme_msg_callback) + (tHalHandle hal, struct scheduler_msg *msg); uint8_t retry_packet_cnt; uint8_t scan_disabled; uint8_t beacon_probe_rsp_cnt_per_scan; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index f37117922c..411f7e51fe 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -470,6 +470,7 @@ typedef struct sSirSmeReadyReq { void *add_bssdescr_cb; void *csr_roam_synch_cb; void *pe_roam_synch_cb; + void *sme_msg_cb; } tSirSmeReadyReq, *tpSirSmeReadyReq; /** diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index a9490c560e..de3d40e17d 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -790,7 +790,7 @@ lim_fill_assoc_ind_params(tpAniSirGlobal mac_ctx, void lim_process_mlm_assoc_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf) { uint32_t len; - struct scheduler_msg msgQ = {0}; + struct scheduler_msg msg = {0}; tSirSmeAssocInd *pSirSmeAssocInd; tpDphHashNode pStaDs = 0; tpPESession psessionEntry; @@ -814,11 +814,12 @@ void lim_process_mlm_assoc_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf) } pSirSmeAssocInd->messageType = eWNI_SME_ASSOC_IND; - lim_fill_assoc_ind_params(pMac, (tpLimMlmAssocInd) pMsgBuf, pSirSmeAssocInd, + lim_fill_assoc_ind_params(pMac, (tpLimMlmAssocInd) pMsgBuf, + pSirSmeAssocInd, psessionEntry); - msgQ.type = eWNI_SME_ASSOC_IND; - msgQ.bodyptr = pSirSmeAssocInd; - msgQ.bodyval = 0; + msg.type = eWNI_SME_ASSOC_IND; + msg.bodyptr = pSirSmeAssocInd; + msg.bodyval = 0; pStaDs = dph_get_hash_entry(pMac, ((tpLimMlmAssocInd) pMsgBuf)->aid, &psessionEntry->dph.dphHashTable); @@ -833,13 +834,11 @@ void lim_process_mlm_assoc_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf) pSirSmeAssocInd->reassocReq = pStaDs->mlmStaContext.subType; pSirSmeAssocInd->timingMeasCap = pStaDs->timingMeasCap; MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG, - psessionEntry->peSessionId, msgQ.type)); + psessionEntry->peSessionId, msg.type)); #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM /* FEATURE_WLAN_DIAG_SUPPORT */ lim_diag_event_report(pMac, WLAN_PE_DIAG_ASSOC_IND_EVENT, psessionEntry, 0, 0); #endif /* FEATURE_WLAN_DIAG_SUPPORT */ - lim_sys_process_mmh_msg_api(pMac, &msgQ, ePROT); - pe_debug("Create CNF_WAIT_TIMER after received LIM_MLM_ASSOC_IND"); /* ** turn on a timer to detect the loss of ASSOC CNF @@ -848,6 +847,7 @@ void lim_process_mlm_assoc_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf) (uint16_t) ((tpLimMlmAssocInd) pMsgBuf)->aid, psessionEntry); + pMac->lim.sme_msg_callback(pMac, &msg); } /*** end lim_process_mlm_assoc_ind() ***/ /** diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 8eb9e39f5d..46095b7013 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -554,6 +554,7 @@ static bool __lim_process_sme_sys_ready_ind(tpAniSirGlobal pMac, uint32_t *pMsgB pe_register_mgmt_rx_frm_callback(pMac); pe_register_callbacks_with_wma(pMac, ready_req); pMac->lim.add_bssdescr_callback = ready_req->add_bssdescr_cb; + pMac->lim.sme_msg_callback = ready_req->sme_msg_cb; } pe_debug("sending WMA_SYS_READY_IND msg to HAL"); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 109a1a4893..7ac4c00276 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1682,7 +1682,6 @@ QDF_STATUS sme_get_peer_info_ext(tHalHandle hal, */ void sme_set_5g_band_pref(tHalHandle hal_handle, struct sme_5g_band_pref_params *pref_params); - /** * sme_get_chain_rssi() - Get chain rssi * @hal: Global HAL handle @@ -1731,4 +1730,16 @@ tpAniSirGlobal sme_get_mac_context(void); * Return: None */ void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id); + +/** + * sme_process_msg_callback() - process callback message from LIM + * @hal: global hal handle + * @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); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 05ab1f8c2d..47c5890055 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -1261,6 +1261,7 @@ QDF_STATUS sme_hdd_ready_ind(tHalHandle hHal) msg->length = sizeof(*msg); msg->add_bssdescr_cb = csr_scan_process_single_bssdescr; msg->csr_roam_synch_cb = csr_roam_synch_callback; + msg->sme_msg_cb = sme_process_msg_callback; if (eSIR_FAILURE != u_mac_post_ctrl_msg(hHal, (tSirMbMsg *) msg)) { status = QDF_STATUS_SUCCESS; @@ -16631,6 +16632,19 @@ QDF_STATUS sme_get_chain_rssi(tHalHandle hal, return status; } +QDF_STATUS sme_process_msg_callback(tHalHandle hal, + struct scheduler_msg *msg) +{ + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + if (msg == NULL) { + sme_err("Empty message for SME Msg callback"); + return status; + } + status = sme_process_msg(hal, msg); + return status; +} + void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id) { struct csr_roam_session *session; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 59d4c705c4..4ecc2418fb 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -15676,6 +15676,7 @@ QDF_STATUS csr_send_assoc_cnf_msg(tpAniSirGlobal pMac, tpSirSmeAssocInd { QDF_STATUS status = QDF_STATUS_SUCCESS; tSirSmeAssocCnf *pMsg; + struct scheduler_msg msg = { 0 }; sme_debug("Posting eWNI_SME_ASSOC_CNF to LIM.HalStatus: %d", Halstatus); do { @@ -15701,8 +15702,13 @@ QDF_STATUS csr_send_assoc_cnf_msg(tpAniSirGlobal pMac, tpSirSmeAssocInd QDF_MAC_ADDR_SIZE); /* alternateChannelId */ pMsg->alternateChannelId = 11; + + msg.type = pMsg->messageType; + msg.bodyval = 0; + msg.bodyptr = pMsg; /* pMsg is freed by umac_send_mb_message_to_mac in anycase*/ - status = umac_send_mb_message_to_mac(pMsg); + status = scheduler_post_msg_by_priority(QDF_MODULE_ID_PE, &msg, + true); } while (0); return status; }