Selaa lähdekoodia

qcacld-3.0: Process assoc indication in sme callback

In a noisy enviornment assoc indication in SME queueu
is not getting processed due to multiple beacons/probes
getting processed in PE queue which is high priority
than SME queue.

Instead of posting a message to SME queue, assoc indication
will run to completion using sme callback mechanism.

Change-Id: I4dc7e3ef0c91964ebc842afa38b7815464e0e406
CRs-Fixed: 2114425
Sandeep Puligilla 8 vuotta sitten
vanhempi
sitoutus
1426d619f3

+ 2 - 0
core/mac/inc/ani_global.h

@@ -837,6 +837,8 @@ typedef struct sAniSirLim {
 	QDF_STATUS(*add_bssdescr_callback)
 	QDF_STATUS(*add_bssdescr_callback)
 		(tpAniSirGlobal pMac, tpSirBssDescription buf,
 		(tpAniSirGlobal pMac, tpSirBssDescription buf,
 		uint32_t scan_id, uint32_t flags);
 		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 retry_packet_cnt;
 	uint8_t scan_disabled;
 	uint8_t scan_disabled;
 	uint8_t beacon_probe_rsp_cnt_per_scan;
 	uint8_t beacon_probe_rsp_cnt_per_scan;

+ 1 - 0
core/mac/inc/sir_api.h

@@ -470,6 +470,7 @@ typedef struct sSirSmeReadyReq {
 	void *add_bssdescr_cb;
 	void *add_bssdescr_cb;
 	void *csr_roam_synch_cb;
 	void *csr_roam_synch_cb;
 	void *pe_roam_synch_cb;
 	void *pe_roam_synch_cb;
+	void *sme_msg_cb;
 } tSirSmeReadyReq, *tpSirSmeReadyReq;
 } tSirSmeReadyReq, *tpSirSmeReadyReq;
 
 
 /**
 /**

+ 8 - 8
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)
 void lim_process_mlm_assoc_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
 {
 {
 	uint32_t len;
 	uint32_t len;
-	struct scheduler_msg msgQ = {0};
+	struct scheduler_msg msg = {0};
 	tSirSmeAssocInd *pSirSmeAssocInd;
 	tSirSmeAssocInd *pSirSmeAssocInd;
 	tpDphHashNode pStaDs = 0;
 	tpDphHashNode pStaDs = 0;
 	tpPESession psessionEntry;
 	tpPESession psessionEntry;
@@ -814,11 +814,12 @@ void lim_process_mlm_assoc_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
 	}
 	}
 
 
 	pSirSmeAssocInd->messageType = eWNI_SME_ASSOC_IND;
 	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);
 				  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,
 	pStaDs = dph_get_hash_entry(pMac,
 				    ((tpLimMlmAssocInd) pMsgBuf)->aid,
 				    ((tpLimMlmAssocInd) pMsgBuf)->aid,
 				    &psessionEntry->dph.dphHashTable);
 				    &psessionEntry->dph.dphHashTable);
@@ -833,13 +834,11 @@ void lim_process_mlm_assoc_ind(tpAniSirGlobal pMac, uint32_t *pMsgBuf)
 	pSirSmeAssocInd->reassocReq = pStaDs->mlmStaContext.subType;
 	pSirSmeAssocInd->reassocReq = pStaDs->mlmStaContext.subType;
 	pSirSmeAssocInd->timingMeasCap = pStaDs->timingMeasCap;
 	pSirSmeAssocInd->timingMeasCap = pStaDs->timingMeasCap;
 	MTRACE(mac_trace(pMac, TRACE_CODE_TX_SME_MSG,
 	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 */
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM    /* FEATURE_WLAN_DIAG_SUPPORT */
 	lim_diag_event_report(pMac, WLAN_PE_DIAG_ASSOC_IND_EVENT, psessionEntry, 0,
 	lim_diag_event_report(pMac, WLAN_PE_DIAG_ASSOC_IND_EVENT, psessionEntry, 0,
 			      0);
 			      0);
 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
 #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");
 	pe_debug("Create CNF_WAIT_TIMER after received LIM_MLM_ASSOC_IND");
 	/*
 	/*
 	** turn on a timer to detect the loss of ASSOC CNF
 	** 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,
 			       (uint16_t) ((tpLimMlmAssocInd) pMsgBuf)->aid,
 			       psessionEntry);
 			       psessionEntry);
 
 
+	pMac->lim.sme_msg_callback(pMac, &msg);
 } /*** end lim_process_mlm_assoc_ind() ***/
 } /*** end lim_process_mlm_assoc_ind() ***/
 
 
 /**
 /**

+ 1 - 0
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_mgmt_rx_frm_callback(pMac);
 		pe_register_callbacks_with_wma(pMac, ready_req);
 		pe_register_callbacks_with_wma(pMac, ready_req);
 		pMac->lim.add_bssdescr_callback = ready_req->add_bssdescr_cb;
 		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");
 	pe_debug("sending WMA_SYS_READY_IND msg to HAL");

+ 12 - 1
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,
 void sme_set_5g_band_pref(tHalHandle hal_handle,
 			  struct sme_5g_band_pref_params *pref_params);
 			  struct sme_5g_band_pref_params *pref_params);
-
 /**
 /**
  * sme_get_chain_rssi() - Get chain rssi
  * sme_get_chain_rssi() - Get chain rssi
  * @hal: Global HAL handle
  * @hal: Global HAL handle
@@ -1731,4 +1730,16 @@ tpAniSirGlobal sme_get_mac_context(void);
  * Return: None
  * Return: None
  */
  */
 void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id);
 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 ) */
 #endif /* #if !defined( __SME_API_H ) */

+ 14 - 0
core/sme/src/common/sme_api.c

@@ -1261,6 +1261,7 @@ QDF_STATUS sme_hdd_ready_ind(tHalHandle hHal)
 		msg->length = sizeof(*msg);
 		msg->length = sizeof(*msg);
 		msg->add_bssdescr_cb = csr_scan_process_single_bssdescr;
 		msg->add_bssdescr_cb = csr_scan_process_single_bssdescr;
 		msg->csr_roam_synch_cb = csr_roam_synch_callback;
 		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)) {
 		if (eSIR_FAILURE != u_mac_post_ctrl_msg(hHal, (tSirMbMsg *) msg)) {
 			status = QDF_STATUS_SUCCESS;
 			status = QDF_STATUS_SUCCESS;
@@ -16631,6 +16632,19 @@ QDF_STATUS sme_get_chain_rssi(tHalHandle hal,
 	return status;
 	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)
 void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id)
 {
 {
 	struct csr_roam_session *session;
 	struct csr_roam_session *session;

+ 7 - 1
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;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	tSirSmeAssocCnf *pMsg;
 	tSirSmeAssocCnf *pMsg;
+	struct scheduler_msg msg = { 0 };
 
 
 	sme_debug("Posting eWNI_SME_ASSOC_CNF to LIM.HalStatus: %d", Halstatus);
 	sme_debug("Posting eWNI_SME_ASSOC_CNF to LIM.HalStatus: %d", Halstatus);
 	do {
 	do {
@@ -15701,8 +15702,13 @@ QDF_STATUS csr_send_assoc_cnf_msg(tpAniSirGlobal pMac, tpSirSmeAssocInd
 			     QDF_MAC_ADDR_SIZE);
 			     QDF_MAC_ADDR_SIZE);
 		/* alternateChannelId */
 		/* alternateChannelId */
 		pMsg->alternateChannelId = 11;
 		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*/
 		/* 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);
 	} while (0);
 	return status;
 	return status;
 }
 }