qcacld-3.0: Refactor channel switch resp in lim

Use vdev_start_response to replace tpSwitchChannelParams
parameter in channel switch response handler.

Lim channel switch resp handler will be called directly, don't
use post msg.

Use vdev id to replace tpHalHiddenSsidVdevRestart in hidden
ssid response handler.

Change-Id: Ida0bfed3fea1cc0ff28ed15832765d446296f3be
CRs-Fixed: 2516582
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index dc71711..bd1c082 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -1928,7 +1928,7 @@
 void
 lim_send_sme_ap_channel_switch_resp(struct mac_context *mac,
 				    struct pe_session *pe_session,
-				    tpSwitchChannelParams pChnlParams)
+				    struct vdev_start_response *rsp)
 {
 	struct scheduler_msg mmhMsg = {0};
 	tpSwitchChannelParams pSmeSwithChnlParams;
@@ -1944,10 +1944,10 @@
 	if (!pSmeSwithChnlParams)
 		return;
 
-	qdf_mem_copy(pSmeSwithChnlParams, pChnlParams,
-		     sizeof(tSwitchChannelParams));
 
-	channelId = pSmeSwithChnlParams->channelNumber;
+	channelId = wlan_reg_freq_to_chan(mac->pdev, pe_session->curr_op_freq);
+	pSmeSwithChnlParams->channelNumber = channelId;
+	pSmeSwithChnlParams->status = rsp->status;
 	ch_width = pSmeSwithChnlParams->ch_width;
 	ch_center_freq_seg1 = pSmeSwithChnlParams->ch_center_freq_seg1;
 
@@ -1955,14 +1955,14 @@
 	 * Pass the sme sessionID to SME instead
 	 * PE session ID.
 	 */
-	pSmeSwithChnlParams->peSessionId = pe_session->smeSessionId;
+	pSmeSwithChnlParams->peSessionId = rsp->vdev_id;
 
 	mmhMsg.type = eWNI_SME_CHANNEL_CHANGE_RSP;
 	mmhMsg.bodyptr = (void *)pSmeSwithChnlParams;
 	mmhMsg.bodyval = 0;
 	lim_sys_process_mmh_msg_api(mac, &mmhMsg);
 
-	if (QDF_IS_STATUS_ERROR(pChnlParams->status)) {
+	if (QDF_IS_STATUS_ERROR(rsp->status)) {
 		pe_err("failed to change sap channel to %u", channelId);
 		return;
 	}
@@ -1994,15 +1994,8 @@
 		lim_sap_move_to_cac_wait_state(pe_session);
 
 	} else {
-		if (channelId == wlan_reg_freq_to_chan(
-				mac->pdev, pe_session->curr_op_freq)) {
-			lim_apply_configuration(mac, pe_session);
-			lim_send_beacon(mac, pe_session);
-		} else {
-			pe_debug("Failed to Transmit Beacons on channel: %d after AP channel change response",
-				       pe_session->bcnLen);
-		}
-
+		lim_apply_configuration(mac, pe_session);
+		lim_send_beacon(mac, pe_session);
 		lim_obss_send_detection_cfg(mac, pe_session, true);
 	}
 	return;