Эх сурвалжийг харах

qcacld-3.0: Reject all vdev commands for TDLS in roaming

All the vdev and peer related commands are forbidden, when the
roaming happens in the system.
Firmware roaming module does vdev_stop, once the roaming is
successfully completed. Part of vdev stop, firmware will delete
all TDLS peers. So after roaming is completed, as part of
roam_sync_complete, host should not send peer_delete. If host
sends peer_delete then FW will not be able to send
peer_delete_resp_event as peer is already deleted
during roaming.

Make changes to reject all vdev and management commands
to firmware, when roaming is in progress in the system.

Change-Id: I17b36d0ce484efeda9dc537684792c7a90d2eae8
CRs-Fixed: 2049039
Nitesh Shah 7 жил өмнө
parent
commit
622d31246e

+ 32 - 8
core/mac/src/pe/lim/lim_process_tdls.c

@@ -2824,6 +2824,13 @@ tSirRetStatus lim_process_sme_tdls_mgmt_send_req(tpAniSirGlobal mac_ctx,
 		goto lim_tdls_send_mgmt_error;
 	}
 
+	if (lim_is_roam_synch_in_progress(session_entry)) {
+		pe_err("roaming in progress, reject mgmt! for session %d",
+		       send_req->sessionId);
+		result_code = eSIR_SME_REFUSED;
+		goto lim_tdls_send_mgmt_error;
+	}
+
 	/*
 	 * if we are still good, go ahead and check if we are in proper state to
 	 * do TDLS discovery req/rsp/....frames.
@@ -3019,6 +3026,12 @@ tSirRetStatus lim_process_sme_tdls_add_sta_req(tpAniSirGlobal pMac,
 		goto lim_tdls_add_sta_error;
 	}
 
+	if (lim_is_roam_synch_in_progress(psessionEntry)) {
+		pe_err("roaming in progress, reject add sta! for session %d",
+		       pAddStaReq->sessionId);
+		goto lim_tdls_add_sta_error;
+	}
+
 	/*
 	 * if we are still good, go ahead and check if we are in proper state to
 	 * do TDLS discovery req/rsp/....frames.
@@ -3079,6 +3092,15 @@ tSirRetStatus lim_process_sme_tdls_del_sta_req(tpAniSirGlobal pMac,
 		goto lim_tdls_del_sta_error;
 	}
 
+	if (lim_is_roam_synch_in_progress(psessionEntry)) {
+		pe_err("roaming in progress, reject del sta! for session %d",
+		       pDelStaReq->sessionId);
+		lim_send_sme_tdls_del_sta_rsp(pMac, pDelStaReq->sessionId,
+					      pDelStaReq->peermac, NULL,
+					      eSIR_FAILURE);
+		return eSIR_FAILURE;
+	}
+
 	/*
 	 * if we are still good, go ahead and check if we are in proper state to
 	 * do TDLS discovery req/rsp/....frames.
@@ -3295,16 +3317,18 @@ static void lim_check_aid_and_delete_peer(tpAniSirGlobal p_mac,
 			pe_debug("Deleting "MAC_ADDRESS_STR,
 				MAC_ADDR_ARRAY(stads->staAddr));
 
-			lim_send_deauth_mgmt_frame(p_mac,
-				eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
-				stads->staAddr, session_entry, false);
+			if (!lim_is_roam_synch_in_progress(session_entry)) {
+				lim_send_deauth_mgmt_frame(p_mac,
+					eSIR_MAC_DEAUTH_LEAVING_BSS_REASON,
+					stads->staAddr, session_entry, false);
 
-			/* Delete TDLS peer */
-			qdf_mem_copy(mac_addr.bytes, stads->staAddr,
-				     QDF_MAC_ADDR_SIZE);
+				/* Delete TDLS peer */
+				qdf_mem_copy(mac_addr.bytes, stads->staAddr,
+					     QDF_MAC_ADDR_SIZE);
 
-			lim_tdls_del_sta(p_mac, mac_addr,
-					 session_entry, false);
+				lim_tdls_del_sta(p_mac, mac_addr,
+						 session_entry, false);
+			}
 
 			dph_delete_hash_entry(p_mac,
 				stads->staAddr, stads->assocId,

+ 12 - 0
core/wma/src/wma_dev_if.c

@@ -3903,6 +3903,12 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 		goto send_rsp;
 	}
 
+	if (wma_is_roam_synch_in_progress(wma, add_sta->smesessionId)) {
+		WMA_LOGE("%s: roaming in progress, reject add sta!", __func__);
+		add_sta->status = QDF_STATUS_E_PERM;
+		goto send_rsp;
+	}
+
 	if (0 == add_sta->updateSta) {
 		/* its a add sta request * */
 
@@ -4354,6 +4360,12 @@ static void wma_del_tdls_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
 		goto send_del_rsp;
 	}
 
+	if (wma_is_roam_synch_in_progress(wma, del_sta->smesessionId)) {
+		WMA_LOGE("%s: roaming in progress, reject del sta!", __func__);
+		del_sta->status = QDF_STATUS_E_PERM;
+		goto send_del_rsp;
+	}
+
 	peerStateParams->peerState = WMA_TDLS_PEER_STATE_TEARDOWN;
 	peerStateParams->vdevId = del_sta->smesessionId;
 	peerStateParams->resp_reqd = del_sta->respReqd;

+ 23 - 0
core/wma/src/wma_features.c

@@ -3989,6 +3989,14 @@ QDF_STATUS wma_set_tdls_offchan_mode(WMA_HANDLE handle,
 		goto end;
 	}
 
+	if (wma_is_roam_synch_in_progress(wma_handle,
+					  chan_switch_params->vdev_id)) {
+		WMA_LOGE("%s: roaming in progress, reject offchan mode cmd!",
+			 __func__);
+		ret = -EPERM;
+		goto end;
+	}
+
 	params.vdev_id = chan_switch_params->vdev_id;
 	params.tdls_off_ch_bw_offset =
 			chan_switch_params->tdls_off_ch_bw_offset;
@@ -4031,6 +4039,13 @@ QDF_STATUS wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams)
 		goto end_fw_tdls_state;
 	}
 
+	if (wma_is_roam_synch_in_progress(wma_handle, wma_tdls->vdev_id)) {
+		WMA_LOGE("%s: roaming in progress, reject fw tdls state cmd!",
+			 __func__);
+		ret = -EPERM;
+		goto end_fw_tdls_state;
+	}
+
 	params.tdls_state = wma_tdls->tdls_state;
 	tdls_mode = wma_tdls->tdls_state;
 
@@ -4108,6 +4123,14 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 		goto end_tdls_peer_state;
 	}
 
+	if (wma_is_roam_synch_in_progress(wma_handle,
+					  peerStateParams->vdevId)) {
+		WMA_LOGE("%s: roaming in progress, reject peer update cmd!",
+			 __func__);
+		ret = -EPERM;
+		goto end_tdls_peer_state;
+	}
+
 	/* peer capability info is valid only when peer state is connected */
 	if (WMA_TDLS_PEER_STATE_CONNECTED != peerStateParams->peerState) {
 		qdf_mem_zero(&peerStateParams->peerCap,