Procházet zdrojové kódy

qcacld-3.0: Refactor vdev resp handler

Add target_if vdev start resp handler: target_if->vdev_mgr->
	mlme legacy(wma->lim).

Replace channel switch parameter by vdev resp event

Wma call lim API directly, don't post message

Get add bss from vdev mlme obj priv data.

Change-Id: Iba8f70e22639e0ec9ec3db04e08b24655b2f0057
CRs-Fixed: 2516585
Jianmin Zhu před 5 roky
rodič
revize
7658df6386

+ 11 - 1
core/wma/inc/wma_api.h

@@ -689,7 +689,17 @@ QDF_STATUS wma_vdev_detach_callback(
  * Return: 0 for success or error code
  */
 QDF_STATUS wma_vdev_stop_resp_handler(struct vdev_mlme_obj *vdev_mlme,
-				      struct vdev_stop_response *rsp);
+				struct vdev_stop_response *rsp);
+
+/**
+ * wma_vdev_start_resp_handler() - vdev start response handler
+ * @vdev_mlme: vdev mlme obj
+ * @rsp: vdev start response
+ *
+ * Return: QDF status
+ */
+QDF_STATUS wma_vdev_start_resp_handler(struct vdev_mlme_obj *vdev_mlme,
+				       struct vdev_start_response *rsp);
 
 #ifdef FEATURE_WLM_STATS
 /**

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

@@ -748,23 +748,9 @@ typedef struct {
 typedef struct {
 	uint8_t channelNumber;
 	uint8_t peSessionId;
-	int8_t txMgmtPower;
 	int8_t maxTxPower;
 	tSirMacAddr selfStaMacAddr;
-	/* the request has power constraints, this should be applied only to
-	 * that session
-	 * VO Wifi comment: BSSID is needed to identify which session issued
-	 * this request. As the request has power constraints, this should be
-	 * applied only to that session
-	 * V IMP: Keep bssId field at the end of this msg.
-	 * It is used to mantain backward compatbility by way of ignoring if
-	 * using new host/old FW or old host/new FW since it is at the end of
-	 * this struct
-	 */
-	tSirMacAddr bssId;
 	QDF_STATUS status;
-	uint16_t chainMask;
-	uint16_t smpsMode;
 	uint8_t isDfsChannel;
 	uint8_t vhtCapable;
 	enum phy_ch_width ch_width;

+ 0 - 3
core/wma/inc/wma_internal.h

@@ -601,9 +601,6 @@ QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle,
 void wma_release_vdev_and_peer_ref(tp_wma_handle wma,
 				   struct wma_txrx_node *iface);
 
-int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
-				       uint32_t len);
-
 QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
 				uint32_t param_id, uint32_t param_value);
 

+ 107 - 159
core/wma/src/wma_dev_if.c

@@ -975,12 +975,12 @@ send_rsp:
  */
 static void wma_send_start_resp(tp_wma_handle wma,
 				struct bss_params *add_bss,
-				wmi_vdev_start_response_event_fixed_param *
-				resp_event)
+				struct vdev_start_response *rsp)
 {
-	struct wma_txrx_node *iface = &wma->interfaces[resp_event->vdev_id];
+	struct wma_txrx_node *iface = &wma->interfaces[rsp->vdev_id];
 
-	if (!resp_event->status && QDF_IS_STATUS_SUCCESS(add_bss->status)) {
+	if (QDF_IS_STATUS_SUCCESS(rsp->status) &&
+	    QDF_IS_STATUS_SUCCESS(add_bss->status)) {
 		add_bss->status =
 		  wlan_vdev_mlme_sm_deliver_evt(iface->vdev,
 						WLAN_VDEV_SM_EV_START_RESP,
@@ -991,18 +991,18 @@ static void wma_send_start_resp(tp_wma_handle wma,
 
 	/* Send vdev stop if vdev start was success */
 	if (QDF_IS_STATUS_ERROR(add_bss->status) &&
-	    !resp_event->status) {
+	    QDF_IS_STATUS_SUCCESS(rsp->status)) {
 		wlan_vdev_mlme_sm_deliver_evt(iface->vdev,
 					      WLAN_VDEV_SM_EV_DOWN,
-					      sizeof(*add_bss),	add_bss);
+					      sizeof(*add_bss), add_bss);
 		return;
 	}
 
 	wma_remove_peer_on_add_bss_failure(add_bss);
 
 	WMA_LOGD(FL("Sending add bss rsp to umac(vdev %d status %d)"),
-		 resp_event->vdev_id, add_bss->status);
-	wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP, (void *)add_bss, 0);
+		 rsp->vdev_id, add_bss->status);
+	lim_handle_mlm_add_bss_rsp(wma->mac_context, add_bss);
 }
 
 /**
@@ -1015,8 +1015,7 @@ static void wma_send_start_resp(tp_wma_handle wma,
  */
 static void wma_vdev_start_rsp(tp_wma_handle wma,
 			       struct bss_params *add_bss,
-			       wmi_vdev_start_response_event_fixed_param *
-			       resp_event)
+			       struct vdev_start_response *rsp)
 {
 	struct beacon_info *bcn;
 
@@ -1026,7 +1025,7 @@ static void wma_vdev_start_rsp(tp_wma_handle wma,
 		 BSS_OPERATIONAL_MODE_IBSS ? "IBSS" : "non-IBSS");
 #endif /* QCA_IBSS_SUPPORT */
 
-	if (resp_event->status) {
+	if (rsp->status) {
 		add_bss->status = QDF_STATUS_E_FAILURE;
 		goto send_fail_resp;
 	}
@@ -1036,10 +1035,10 @@ static void wma_vdev_start_rsp(tp_wma_handle wma,
 	    || (add_bss->operMode == BSS_OPERATIONAL_MODE_IBSS)
 #endif /* QCA_IBSS_SUPPORT */
 	    ) {
-		wma->interfaces[resp_event->vdev_id].beacon =
+		wma->interfaces[rsp->vdev_id].beacon =
 			qdf_mem_malloc(sizeof(struct beacon_info));
 
-		bcn = wma->interfaces[resp_event->vdev_id].beacon;
+		bcn = wma->interfaces[rsp->vdev_id].beacon;
 		if (!bcn) {
 			add_bss->status = QDF_STATUS_E_NOMEM;
 			goto send_fail_resp;
@@ -1053,26 +1052,26 @@ static void wma_vdev_start_rsp(tp_wma_handle wma,
 		}
 		bcn->seq_no = MIN_SW_SEQ;
 		qdf_spinlock_create(&bcn->lock);
-		qdf_atomic_set(&wma->interfaces[resp_event->vdev_id].bss_status,
+		qdf_atomic_set(&wma->interfaces[rsp->vdev_id].bss_status,
 			       WMA_BSS_STATUS_STARTED);
 		WMA_LOGD("%s: AP mode (type %d subtype %d) BSS is started",
-			 __func__, wma->interfaces[resp_event->vdev_id].type,
-			 wma->interfaces[resp_event->vdev_id].sub_type);
+			 __func__, wma->interfaces[rsp->vdev_id].type,
+			 wma->interfaces[rsp->vdev_id].sub_type);
 
 		WMA_LOGD("%s: Allocated beacon struct %pK, template memory %pK",
 			 __func__, bcn, bcn->buf);
 	}
 	add_bss->status = QDF_STATUS_SUCCESS;
-	add_bss->bss_idx = resp_event->vdev_id;
-	add_bss->chainMask = resp_event->chain_mask;
-	if ((2 != resp_event->cfgd_rx_streams) ||
-		(2 != resp_event->cfgd_tx_streams)) {
+	add_bss->bss_idx = rsp->vdev_id;
+	add_bss->chainMask = rsp->chain_mask;
+	if ((2 != rsp->cfgd_rx_streams) ||
+	    (2 != rsp->cfgd_tx_streams)) {
 		add_bss->nss = 1;
 	}
-	add_bss->smpsMode = host_map_smps_mode(resp_event->smps_mode);
+	add_bss->smpsMode = host_map_smps_mode(rsp->smps_mode);
 
 send_fail_resp:
-	wma_send_start_resp(wma, add_bss, resp_event);
+	wma_send_start_resp(wma, add_bss, rsp);
 }
 
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
@@ -1133,23 +1132,18 @@ static void wma_find_mcc_ap(tp_wma_handle wma, uint8_t vdev_id, bool add)
  * wma_handle_hidden_ssid_restart() - handle hidden ssid restart
  * @wma: wma handle
  * @iface: interfcae pointer
- * @req: target req
  *
  * Return: none
  */
 static void wma_handle_hidden_ssid_restart(tp_wma_handle wma,
-					   struct wma_txrx_node *iface,
-					   struct wma_target_req *req)
+					   struct wma_txrx_node *iface)
 {
-	tpHalHiddenSsidVdevRestart hidden_ssid_restart =
-				(tpHalHiddenSsidVdevRestart)req->user_data;
 	WMA_LOGE("%s: vdev restart event recevied for hidden ssid set using IOCTL",
 		 __func__);
 
 	wlan_vdev_mlme_sm_deliver_evt(iface->vdev,
 				      WLAN_VDEV_SM_EV_RESTART_RESP,
-				      sizeof(*hidden_ssid_restart),
-				      hidden_ssid_restart);
+				      0, NULL);
 }
 
 /**
@@ -1162,105 +1156,84 @@ static void wma_handle_hidden_ssid_restart(tp_wma_handle wma,
  */
 static QDF_STATUS
 wma_handle_channel_switch_resp(tp_wma_handle wma,
-			       wmi_vdev_start_response_event_fixed_param
-			       *resp_event,
-			       struct wma_target_req *req)
+			       struct vdev_start_response *rsp)
 {
 	enum wlan_vdev_sm_evt  event;
 	struct wma_txrx_node *iface;
-	tpSwitchChannelParams params = (tpSwitchChannelParams) req->user_data;
 
-	if (!params) {
-		WMA_LOGE("%s: channel switch params is NULL for vdev %d",
-			 __func__, resp_event->vdev_id);
-		policy_mgr_set_do_hw_mode_change_flag(wma->psoc, false);
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	iface = &wma->interfaces[resp_event->vdev_id];
+	iface = &wma->interfaces[rsp->vdev_id];
 	WMA_LOGD("%s: Send channel switch resp vdev %d status %d",
-		 __func__, resp_event->vdev_id, resp_event->status);
-	params->chainMask = resp_event->chain_mask;
-	if ((resp_event->cfgd_rx_streams != 2) ||
-	    (resp_event->cfgd_tx_streams != 2))
-		params->nss = 1;
-
-	params->smpsMode = host_map_smps_mode(resp_event->smps_mode);
-	params->status = resp_event->status;
+		 __func__, rsp->vdev_id, rsp->status);
 
 	/* Indicate channel switch failure to LIM */
-	if (QDF_IS_STATUS_ERROR(params->status) &&
+	if (QDF_IS_STATUS_ERROR(rsp->status) &&
 	    (iface->type == WMI_VDEV_TYPE_MONITOR ||
-	     wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id) ||
+	     wma_is_vdev_in_ap_mode(wma, rsp->vdev_id) ||
 	     mlme_is_chan_switch_in_progress(iface->vdev))) {
 		mlme_set_chan_switch_in_progress(iface->vdev, false);
-		wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
-					   (void *)params, 0);
+		lim_process_switch_channel_rsp(wma->mac_context, rsp);
 		return QDF_STATUS_SUCCESS;
 	}
 
-	if ((QDF_IS_STATUS_SUCCESS(resp_event->status) &&
-	     (resp_event->resp_type == WMI_VDEV_RESTART_RESP_EVENT) &&
-	     ((iface->type == WMI_VDEV_TYPE_STA) ||
-	      (iface->type == WMI_VDEV_TYPE_MONITOR))) ||
-	    ((resp_event->resp_type == WMI_VDEV_START_RESP_EVENT) &&
-	     (iface->type == WMI_VDEV_TYPE_MONITOR))) {
+	if ((QDF_IS_STATUS_SUCCESS(rsp->status) &&
+	     rsp->resp_type == WMI_VDEV_RESTART_RESP_EVENT &&
+	     (iface->type == WMI_VDEV_TYPE_STA ||
+	      iface->type == WMI_VDEV_TYPE_MONITOR)) ||
+	    (rsp->resp_type == WMI_VDEV_START_RESP_EVENT &&
+	     iface->type == WMI_VDEV_TYPE_MONITOR)) {
 		wmi_host_channel_width chanwidth;
 		int err;
 
 		/* for CSA case firmware expects phymode before ch_wd */
 		err = wma_set_peer_param(wma, iface->bssid,
 					 WMI_PEER_PHYMODE, iface->chanmode,
-					resp_event->vdev_id);
+					rsp->vdev_id);
 		WMA_LOGD("%s:vdev_id %d chanmode %d status %d",
-			 __func__, resp_event->vdev_id, iface->chanmode, err);
+			 __func__, rsp->vdev_id, iface->chanmode, err);
 
 		chanwidth = wmi_get_ch_width_from_phy_mode(wma->wmi_handle,
 							   iface->chanmode);
 		err = wma_set_peer_param(wma, iface->bssid, WMI_PEER_CHWIDTH,
-					 chanwidth, resp_event->vdev_id);
+					 chanwidth, rsp->vdev_id);
 		WMA_LOGD("%s:vdev_id %d chanwidth %d status %d",
-			 __func__, resp_event->vdev_id, chanwidth, err);
+			 __func__, rsp->vdev_id, chanwidth, err);
 	}
 
-	if (wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id) ||
+	if (wma_is_vdev_in_ap_mode(wma, rsp->vdev_id) ||
 	    mlme_is_chan_switch_in_progress(iface->vdev))
 		event = WLAN_VDEV_SM_EV_RESTART_RESP;
 	else
 		event = WLAN_VDEV_SM_EV_START_RESP;
 	wlan_vdev_mlme_sm_deliver_evt(iface->vdev, event,
-				      sizeof(*params), params);
+				      sizeof(rsp), rsp);
 
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * wma_vdev_start_resp_handler() - vdev start response handler
- * @handle: wma handle
- * @cmd_param_info: event buffer
- * @len: buffer length
- *
- * Return: 0 for success or error code
- */
-int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
-				uint32_t len)
+QDF_STATUS wma_vdev_start_resp_handler(struct vdev_mlme_obj *vdev_mlme,
+				       struct vdev_start_response *rsp)
 {
-	tp_wma_handle wma = (tp_wma_handle) handle;
-	WMI_VDEV_START_RESP_EVENTID_param_tlvs *param_buf;
-	wmi_vdev_start_response_event_fixed_param *resp_event;
-	struct wma_target_req *req_msg;
+	tp_wma_handle wma;
 	struct wma_txrx_node *iface;
 	struct vdev_up_params param = {0};
 	target_resource_config *wlan_res_cfg;
-	struct wlan_objmgr_psoc *psoc = wma->psoc;
+	struct wlan_objmgr_psoc *psoc;
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 	struct mac_context *mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
 #endif
 	QDF_STATUS status;
+	enum vdev_assoc_type assoc_type;
+	struct bss_params *bss_params;
 
+	wma = cds_get_context(QDF_MODULE_ID_WMA);
+	if (!wma) {
+		wma_err("wma wma is NULL for VDEV_%d", rsp->vdev_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+	psoc = wma->psoc;
 	if (!psoc) {
 		WMA_LOGE("%s: psoc is NULL", __func__);
-		return -EINVAL;
+		return QDF_STATUS_E_FAILURE;
 	}
 
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
@@ -1268,7 +1241,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
 		WMA_LOGE("%s: Failed to get mac_ctx", __func__);
 		policy_mgr_set_do_hw_mode_change_flag(
 			psoc, false);
-		return -EINVAL;
+		return QDF_STATUS_E_FAILURE;
 	}
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 
@@ -1277,118 +1250,93 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
 	wlan_res_cfg = lmac_get_tgt_res_cfg(psoc);
 	if (!wlan_res_cfg) {
 		WMA_LOGE("%s: Wlan resource config is NULL", __func__);
-		return -EINVAL;
-	}
-
-	param_buf = (WMI_VDEV_START_RESP_EVENTID_param_tlvs *) cmd_param_info;
-	if (!param_buf) {
-		WMA_LOGE("Invalid start response event buffer");
-		policy_mgr_set_do_hw_mode_change_flag(
-			wma->psoc, false);
-		return -EINVAL;
-	}
-
-	resp_event = param_buf->fixed_param;
-	if (!resp_event) {
-		WMA_LOGE("Invalid start response event buffer");
-		policy_mgr_set_do_hw_mode_change_flag(
-			wma->psoc, false);
-		return -EINVAL;
+		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (resp_event->vdev_id >= wma->max_bssid) {
+	if (rsp->vdev_id >= wma->max_bssid) {
 		WMA_LOGE("Invalid vdev id received from firmware");
-		return -EINVAL;
+		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id))
+	if (wma_is_vdev_in_ap_mode(wma, rsp->vdev_id))
 		tgt_dfs_radar_enable(wma->pdev, 0, 0);
 
-	if (resp_event->status == QDF_STATUS_SUCCESS) {
-		wma->interfaces[resp_event->vdev_id].tx_streams =
-			resp_event->cfgd_tx_streams;
-		wma->interfaces[resp_event->vdev_id].rx_streams =
-			resp_event->cfgd_rx_streams;
-		wma->interfaces[resp_event->vdev_id].chain_mask =
-			resp_event->chain_mask;
+	if (rsp->status == QDF_STATUS_SUCCESS) {
+		wma->interfaces[rsp->vdev_id].tx_streams =
+			rsp->cfgd_tx_streams;
+		wma->interfaces[rsp->vdev_id].rx_streams =
+			rsp->cfgd_rx_streams;
+		wma->interfaces[rsp->vdev_id].chain_mask =
+			rsp->chain_mask;
+
 		if (wlan_res_cfg->use_pdev_id) {
-			if (resp_event->pdev_id == WMI_PDEV_ID_SOC) {
-				WMA_LOGE("%s: soc level id received for mac id",
-					__func__);
-				return -EINVAL;
+			if (rsp->mac_id == WMI_PDEV_ID_SOC) {
+				wma_err("soc level id received for mac id");
+				return -QDF_STATUS_E_INVAL;
 			}
-			wma->interfaces[resp_event->vdev_id].mac_id =
-				WMA_PDEV_TO_MAC_MAP(resp_event->pdev_id);
+			wma->interfaces[rsp->vdev_id].mac_id =
+				WMA_PDEV_TO_MAC_MAP(rsp->mac_id);
 		} else {
-			wma->interfaces[resp_event->vdev_id].mac_id =
-				resp_event->mac_id;
+			wma->interfaces[rsp->vdev_id].mac_id =
+			rsp->mac_id;
 		}
 
 		WMA_LOGD("%s: vdev:%d tx ss=%d rx ss=%d chain mask=%d mac=%d",
 				__func__,
-				resp_event->vdev_id,
-				wma->interfaces[resp_event->vdev_id].tx_streams,
-				wma->interfaces[resp_event->vdev_id].rx_streams,
-				wma->interfaces[resp_event->vdev_id].chain_mask,
-				wma->interfaces[resp_event->vdev_id].mac_id);
+				rsp->vdev_id,
+				wma->interfaces[rsp->vdev_id].tx_streams,
+				wma->interfaces[rsp->vdev_id].rx_streams,
+				wma->interfaces[rsp->vdev_id].chain_mask,
+				wma->interfaces[rsp->vdev_id].mac_id);
 	}
 
-	iface = &wma->interfaces[resp_event->vdev_id];
-
-	req_msg = wma_find_vdev_req(wma, resp_event->vdev_id,
-				    WMA_TARGET_REQ_TYPE_VDEV_START,
-				    true);
-
-	if (!req_msg) {
-		WMA_LOGE("%s: Failed to lookup request message for vdev %d",
-			 __func__, resp_event->vdev_id);
-		policy_mgr_set_do_hw_mode_change_flag(wma->psoc, false);
-		return -EINVAL;
-	}
-	qdf_mc_timer_stop(&req_msg->event_timeout);
+	iface = &wma->interfaces[rsp->vdev_id];
 
 	if (wma_get_hidden_ssid_restart_in_progress(iface) &&
-	    wma_is_vdev_in_ap_mode(wma, resp_event->vdev_id) &&
-	    (req_msg->msg_type == WMA_HIDDEN_SSID_VDEV_RESTART))
-		wma_handle_hidden_ssid_restart(wma, iface, req_msg);
+	    wma_is_vdev_in_ap_mode(wma, rsp->vdev_id))
+		wma_handle_hidden_ssid_restart(wma, iface);
 
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
-	if (resp_event->status == QDF_STATUS_SUCCESS
+	if (rsp->status == QDF_STATUS_SUCCESS
 		&& mac_ctx->sap.sap_channel_avoidance)
-		wma_find_mcc_ap(wma, resp_event->vdev_id, true);
+		wma_find_mcc_ap(wma, rsp->vdev_id, true);
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 
-	if (req_msg->msg_type == WMA_CHNL_SWITCH_REQ) {
+	if (iface->type == WMI_VDEV_TYPE_STA)
+		assoc_type = mlme_get_assoc_type(vdev_mlme->vdev);
+
+	if (mlme_is_chan_switch_in_progress(iface->vdev) ||
+	    iface->type == WMI_VDEV_TYPE_MONITOR ||
+	    (iface->type == WMI_VDEV_TYPE_STA &&
+	     (assoc_type == VDEV_ASSOC || assoc_type == VDEV_REASSOC))) {
 		status = wma_handle_channel_switch_resp(wma,
-							resp_event, req_msg);
+							rsp);
 		if (QDF_IS_STATUS_ERROR(status))
-			return -EINVAL;
-	} else if (req_msg->msg_type == WMA_ADD_BSS_REQ) {
-		struct bss_params *bssParams = (struct bss_params *) req_msg->user_data;
-
-		qdf_mem_copy(iface->bssid, bssParams->bssId,
-				QDF_MAC_ADDR_SIZE);
-		wma_vdev_start_rsp(wma, bssParams, resp_event);
-	} else if (req_msg->msg_type == WMA_OCB_SET_CONFIG_CMD) {
-		param.vdev_id = resp_event->vdev_id;
+			return QDF_STATUS_E_FAILURE;
+	}  else if (iface->type == WMI_VDEV_TYPE_OCB) {
+		param.vdev_id = rsp->vdev_id;
 		param.assoc_id = iface->aid;
 		if (wma_send_vdev_up_to_fw(wma, &param, iface->bssid) !=
 		    QDF_STATUS_SUCCESS) {
 			WMA_LOGE(FL("failed to send vdev up"));
 			policy_mgr_set_do_hw_mode_change_flag(
 				wma->psoc, false);
-			return -EEXIST;
+			return QDF_STATUS_E_FAILURE;
 		}
 		ucfg_ocb_config_channel(wma->pdev);
-	}
-	if ((wma->interfaces[resp_event->vdev_id].type == WMI_VDEV_TYPE_AP) &&
-		wma_is_vdev_up(resp_event->vdev_id))
-		wma_set_sap_keepalive(wma, resp_event->vdev_id);
+	} else {
+		/* store it in struct mlme_legacy_priv *mlme_priv */
+		bss_params =
+			mlme_get_bss_params(vdev_mlme->vdev);
 
-	qdf_mc_timer_destroy(&req_msg->event_timeout);
-	qdf_mem_free(req_msg);
+		qdf_mem_copy(iface->bssid, bss_params->bssId,
+			     QDF_MAC_ADDR_SIZE);
+		wma_vdev_start_rsp(wma, bss_params, rsp);
+	}
+	if (iface->type == WMI_VDEV_TYPE_AP && wma_is_vdev_up(rsp->vdev_id))
+		wma_set_sap_keepalive(wma, rsp->vdev_id);
 
-	return 0;
+	return QDF_STATUS_SUCCESS;
 }
 
 bool wma_is_vdev_valid(uint32_t vdev_id)

+ 2 - 1
core/wma/src/wma_main.c

@@ -3398,7 +3398,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 	/* Register vdev start response event handler */
 	wmi_unified_register_event_handler(wma_handle->wmi_handle,
 					   wmi_vdev_start_resp_event_id,
-					   wma_vdev_start_resp_handler,
+					   target_if_vdev_mgr_start_response_handler,
 					   WMA_RX_SERIALIZER_CTX);
 
 	/* Register vdev stop response event handler */
@@ -8503,6 +8503,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 	case WMA_CHNL_SWITCH_REQ:
 		wma_set_channel(wma_handle,
 				(tpSwitchChannelParams) msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		break;
 	case WMA_ADD_BSS_REQ:
 		wma_add_bss(wma_handle, (struct bss_params *) msg->bodyptr);

+ 5 - 4
core/wma/src/wma_scan_roam.c

@@ -3510,6 +3510,7 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint16_t beacon_interval_ori;
 	uint8_t chan;
+	struct vdev_start_response rsp = {0};
 
 	WMA_LOGD("%s: Enter", __func__);
 	if (!wma_find_vdev_by_addr(wma, params->selfStaMacAddr, &vdev_id)) {
@@ -3643,11 +3644,11 @@ send_resp:
 		 params->channelNumber, params->ch_width,
 		 params->maxTxPower,
 		 status);
-	params->status = status;
-	WMA_LOGI("%s: sending WMA_SWITCH_CHANNEL_RSP, status = 0x%x",
+	WMA_LOGI("%s: wma switch channel rsp,, status = 0x%x",
 		 __func__, status);
-	wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
-				   (void *)params, 0);
+	rsp.status = status;
+	rsp.vdev_id = vdev_id;
+	lim_process_switch_channel_rsp(wma->mac_context, &rsp);
 }
 
 #ifdef FEATURE_WLAN_ESE

+ 9 - 9
core/wma/src/wma_utils.c

@@ -4069,7 +4069,7 @@ static QDF_STATUS wma_vdev_send_start_resp(tp_wma_handle wma,
 {
 	WMA_LOGD(FL("Sending add bss rsp to umac(vdev %d status %d)"),
 		 add_bss->bss_idx, add_bss->status);
-	wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP, (void *)add_bss, 0);
+	lim_handle_mlm_add_bss_rsp(wma->mac_context, add_bss);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -4081,9 +4081,8 @@ QDF_STATUS wma_sta_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
 	enum vdev_assoc_type assoc_type;
 
 	if (mlme_is_chan_switch_in_progress(vdev_mlme->vdev)) {
-		wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
-					   data, 0);
 		mlme_set_chan_switch_in_progress(vdev_mlme->vdev, false);
+		lim_process_switch_channel_rsp(wma->mac_context, data);
 		return QDF_STATUS_SUCCESS;
 	}
 
@@ -4091,8 +4090,7 @@ QDF_STATUS wma_sta_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
 	switch (assoc_type) {
 	case VDEV_ASSOC:
 	case VDEV_REASSOC:
-		wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
-					   data, 0);
+		lim_process_switch_channel_rsp(wma->mac_context, data);
 		break;
 	case VDEV_FT_REASSOC:
 		wma_send_msg_high_priority(wma, WMA_ADD_BSS_RSP,
@@ -4133,6 +4131,7 @@ QDF_STATUS wma_ap_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
 	tp_wma_handle wma;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct wlan_objmgr_vdev *vdev = vdev_mlme->vdev;
+	uint8_t vdev_id;
 
 	wma = cds_get_context(QDF_MODULE_ID_WMA);
 	if (!wma) {
@@ -4141,11 +4140,12 @@ QDF_STATUS wma_ap_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
 	}
 
 	if (mlme_is_chan_switch_in_progress(vdev)) {
-		wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP,
-					   data, 0);
 		mlme_set_chan_switch_in_progress(vdev, false);
+		lim_process_switch_channel_rsp(wma->mac_context, data);
 	} else if (ap_mlme_is_hidden_ssid_restart_in_progress(vdev)) {
-		wma_send_msg(wma, WMA_HIDDEN_SSID_RESTART_RSP, data, 0);
+		vdev_id = vdev->vdev_objmgr.vdev_id;
+		lim_process_mlm_update_hidden_ssid_rsp(wma->mac_context,
+						       vdev_id);
 		ap_mlme_set_hidden_ssid_restart_in_progress(vdev, false);
 	} else {
 		status = wma_vdev_send_start_resp(wma, (struct bss_params *)data);
@@ -4267,7 +4267,7 @@ QDF_STATUS wma_mon_mlme_vdev_start_continue(struct vdev_mlme_obj *vdev_mlme,
 	if (mlme_is_chan_switch_in_progress(vdev_mlme->vdev))
 		mlme_set_chan_switch_in_progress(vdev_mlme->vdev, false);
 
-	wma_send_msg_high_priority(wma, WMA_SWITCH_CHANNEL_RSP, data, 0);
+	lim_process_switch_channel_rsp(wma->mac_context, data);
 
 	return QDF_STATUS_SUCCESS;
 }