Ver Fonte

qcacld-3.0: Fix sending vdev start again during LFR-2.0 roaming

Currently peer create response support is added for connect path
but in LFR-2.0 case also peer create response received is
processed and lim_post_join_set_link_state_callback() is called
leading to sending vdev start again.
Call the API to fill peer create wma request only for initial
connection.

Change-Id: I24140efd5541f7ed4aa3cef9efebf5a729846902
CRs-Fixed: 2856636
Pragaspathi Thilagaraj há 4 anos atrás
pai
commit
58581e5b19

+ 1 - 1
core/mac/src/pe/lim/lim_process_mlm_host_roam.c

@@ -600,7 +600,7 @@ void lim_process_mlm_ft_reassoc_req(struct mac_context *mac,
 
 	/* For connection manager CM will create the peer before reassoc */
 #ifndef FEATURE_CM_ENABLE
-	status = wma_add_bss_peer_sta(session->vdev_id, session->bssId);
+	status = wma_add_bss_peer_sta(session->vdev_id, session->bssId, false);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		qdf_mem_free(reassoc_req);
 		return;

+ 1 - 1
core/mac/src/pe/lim/lim_process_mlm_req_messages.c

@@ -431,7 +431,7 @@ lim_process_mlm_post_join_suspend_link(struct mac_context *mac_ctx,
 	mac_ctx->lim.lim_timers.gLimJoinFailureTimer.sessionId =
 		session->peSessionId;
 
-	wma_add_bss_peer_sta(session->vdev_id, session->bssId);
+	wma_add_bss_peer_sta(session->vdev_id, session->bssId, true);
 }
 #endif
 

+ 1 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -3700,7 +3700,7 @@ QDF_STATUS cm_process_peer_create(struct scheduler_msg *msg)
 
 	req = msg->bodyptr;
 
-	status = wma_add_bss_peer_sta(req->vdev_id, req->peer_mac.bytes);
+	status = wma_add_bss_peer_sta(req->vdev_id, req->peer_mac.bytes, true);
 
 	qdf_mem_free(req);
 

+ 5 - 1
core/wma/inc/wma.h

@@ -2386,10 +2386,14 @@ int wma_motion_det_base_line_host_event_handler(void *handle, u_int8_t *event,
  * @vdev_id: vdev id
  * @bssid: AP bssid
  * @roam_sync: if roam sync is in progress
+ * @is_resp_required: Peer create response is expected from firmware.
+ * This flag will be set to true for initial connection and false for
+ * LFR2 case.
  *
  * Return: 0 on success, else error on failure
  */
-QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid);
+QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
+				bool is_resp_required);
 
 /**
  * wma_send_vdev_stop() - WMA api to send vdev stop to fw

+ 8 - 0
core/wma/inc/wma_if.h

@@ -728,6 +728,14 @@ struct send_peer_unmap_conf_params {
 	uint16_t *peer_id_list;
 };
 
+/**
+ * struct peer_create_rsp_params  - Peer create response parameters
+ * @peer_mac: Peer mac address
+ */
+struct peer_create_rsp_params {
+	struct qdf_mac_addr peer_mac;
+};
+
 /**
  * struct tDisableIntraBssFwd - intra bss forward parameters
  * @sessionId: session id

+ 34 - 7
core/wma/src/wma_dev_if.c

@@ -1903,6 +1903,7 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma,
 {
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
 	struct wma_target_req *msg = NULL;
+	struct peer_create_rsp_params *peer_create_rsp = NULL;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	bool is_tgt_peer_conf_supported = false;
 
@@ -1923,6 +1924,10 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma,
 		goto end;
 	}
 
+	peer_create_rsp = qdf_mem_malloc(sizeof(*peer_create_rsp));
+	if (!peer_create_rsp)
+		goto end;
+
 	wma_acquire_wakelock(&wma->wmi_cmd_rsp_wake_lock,
 			     WMA_PEER_CREATE_RESPONSE_TIMEOUT);
 
@@ -1933,9 +1938,12 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma,
 	}
 
 	wma_increment_peer_count(wma, vdev_id);
+	qdf_mem_copy(peer_create_rsp->peer_mac.bytes, peer_addr,
+		     QDF_MAC_ADDR_SIZE);
 
 	msg = wma_fill_hold_req(wma, vdev_id, WMA_PEER_CREATE_REQ,
-				WMA_PEER_CREATE_RESPONSE, (void *)peer_addr,
+				WMA_PEER_CREATE_RESPONSE,
+				(void *)peer_create_rsp,
 				WMA_PEER_CREATE_RESPONSE_TIMEOUT);
 	if (!msg) {
 		wma_err("vdev:%d failed to fill peer create req", vdev_id);
@@ -1949,6 +1957,7 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma,
 	return status;
 
 end:
+	qdf_mem_free(peer_create_rsp);
 	lim_send_peer_create_resp(mac, vdev_id, status, peer_addr);
 
 	return status;
@@ -3010,6 +3019,7 @@ int wma_peer_create_confirm_handler(void *handle, uint8_t *evt_param_info,
 	WMI_PEER_CREATE_CONF_EVENTID_param_tlvs *param_buf;
 	struct wma_target_req *req_msg = NULL;
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
+	struct peer_create_rsp_params *rsp_data;
 	void *dp_soc = cds_get_context(QDF_MODULE_ID_SOC);
 	struct qdf_mac_addr peer_mac;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
@@ -3044,8 +3054,11 @@ int wma_peer_create_confirm_handler(void *handle, uint8_t *evt_param_info,
 
 	wma_release_wakelock(&wma->wmi_cmd_rsp_wake_lock);
 
+	rsp_data = (struct peer_create_rsp_params *)req_msg->user_data;
+
 	qdf_mc_timer_stop(&req_msg->event_timeout);
 	qdf_mc_timer_destroy(&req_msg->event_timeout);
+	qdf_mem_free(rsp_data);
 	qdf_mem_free(req_msg);
 
 	if (!peer_create_rsp->status) {
@@ -3311,20 +3324,28 @@ void wma_hold_req_timer(void *data)
 					   resp, 0);
 	} else if ((tgt_req->msg_type == WMA_PEER_CREATE_REQ) &&
 		   (tgt_req->type == WMA_PEER_CREATE_RESPONSE)) {
+		struct peer_create_rsp_params *peer_create_rsp;
+		struct qdf_mac_addr *peer_mac;
+
 		if (wma_crash_on_fw_timeout(wma->fw_timeout_crash))
 			wma_trigger_recovery_assert_on_fw_timeout(
 				WMA_PEER_CREATE_RESPONSE,
 				WMA_PEER_CREATE_RESPONSE_TIMEOUT);
 
-		wma_remove_peer(wma, (uint8_t *)tgt_req->user_data,
+		peer_create_rsp =
+			(struct peer_create_rsp_params *)tgt_req->user_data;
+		peer_mac = &peer_create_rsp->peer_mac;
+		wma_remove_peer(wma, peer_mac->bytes,
 				tgt_req->vdev_id, false);
-		if (!mac)
+		if (!mac) {
+			qdf_mem_free(tgt_req->user_data);
 			goto timer_destroy;
+		}
 
 		lim_send_peer_create_resp(mac, tgt_req->vdev_id,
 					  QDF_STATUS_E_TIMEOUT,
 					  (uint8_t *)tgt_req->user_data);
-
+		qdf_mem_free(tgt_req->user_data);
 	} else {
 		wma_err("Unhandled timeout for msg_type:%d and type:%d",
 				tgt_req->msg_type, tgt_req->type);
@@ -5363,7 +5384,8 @@ QDF_STATUS wma_set_wlm_latency_level(void *wma_ptr,
 	return ret;
 }
 
-QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid)
+QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
+				bool is_resp_required)
 {
 	tp_wma_handle wma;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
@@ -5372,8 +5394,13 @@ QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid)
 	if (!wma)
 		goto err;
 
-	status = wma_create_sta_mode_bss_peer(wma, bssid, WMI_PEER_TYPE_DEFAULT,
-					      vdev_id);
+	if (is_resp_required)
+		status = wma_create_sta_mode_bss_peer(wma, bssid,
+						      WMI_PEER_TYPE_DEFAULT,
+						      vdev_id);
+	else
+		status = wma_add_peer(wma, bssid, WMI_PEER_TYPE_DEFAULT,
+				      vdev_id);
 err:
 	return status;
 }