qcacld-3.0: Set hw mode during channel switch in STA/P2P-CLI case

Set the hw mode, if needed, during channel switch in STA and
P2P-CLI scenario. The STA/P2P-CLI on receiving the channel change
event may need to do a hw mode change to get the best out of the
hw capabilities.

e.g.1, In a STA+SAP concurrency, the STA and SAP are doing SCC on
channel 6. When the STA interface receives a channel event for
channel 36, it is better the driver moves to a DBS scenario.

e.g.2, In a STA+SAP concurrency, the STA is on channel 6 and the
SAP is on channel 36. When the STA interface receives a channel
event for channel 36, it is better the driver moves from a DBS
scenario to a SCC scenario.

For MCC upgrade, the following steps are taken
1. Opportunistic timer is started
2. vdev restart is initiated on the new channel
3. PM will check if MCC upgrade can be done on timer expiry

For DBS downgrade, the following steps are taken
1. PM will initiate HW mode change to DBS right away
2. vdev restart is initiated on the new channel

Change-Id: I202842bf28c3117e8cc91954cdfd3b39a0062f4e
CRs-Fixed: 972184
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 dd1e592..2256f85 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
@@ -2016,7 +2016,8 @@
 {
 	tpPESession session_entry;
 	tSirMsgQ mmh_msg;
-	tpCSAOffloadParams csa_params = (tpCSAOffloadParams) (msg->bodyptr);
+	struct csa_offload_params *csa_params =
+				(struct csa_offload_params *) (msg->bodyptr);
 	tpSmeCsaOffloadInd csa_offload_ind;
 	tpDphHashNode sta_ds = NULL;
 	uint8_t session_id;
@@ -2027,6 +2028,8 @@
 	tLimWiderBWChannelSwitchInfo *chnl_switch_info = NULL;
 	tLimChannelSwitchInfo *lim_ch_switch = NULL;
 
+	lim_log(mac_ctx, LOG1, FL("handle csa offload msg"));
+
 	if (!csa_params) {
 		lim_log(mac_ctx, LOGE, FL("limMsgQ body ptr is NULL"));
 		return;
@@ -2037,7 +2040,8 @@
 			csa_params->bssId, &session_id);
 	if (!session_entry) {
 		lim_log(mac_ctx, LOGE,
-			FL("Session does not exist"));
+			FL("Session does not exists for %pM"),
+				csa_params->bssId);
 		goto err;
 	}
 
@@ -2059,7 +2063,7 @@
 
 		lim_ch_switch = &session_entry->gLimChannelSwitch;
 		session_entry->gLimChannelSwitch.switchMode =
-			csa_params->switchmode;
+			csa_params->switch_mode;
 		/* timer already started by firmware, switch immediately */
 		session_entry->gLimChannelSwitch.switchCount = 0;
 		session_entry->gLimChannelSwitch.primaryChannel =