qcacld-3.0: Remove the cb_mode usage in channel bonding

Remove the CB mode usage in channel bonding since the center
center frequency is calculated using channel width and channel
number.

Change-Id: Ie9685a833750bf3b69cce40c5d9587fb9b232047
CRs-Fixed: 962174
diff --git a/core/cds/inc/cds_regdomain.h b/core/cds/inc/cds_regdomain.h
index 262677f..28a2290 100644
--- a/core/cds/inc/cds_regdomain.h
+++ b/core/cds/inc/cds_regdomain.h
@@ -1094,5 +1094,7 @@
 void cds_fill_send_ctl_info_to_fw(struct regulatory *reg, uint32_t modesAvail,
 				  uint32_t modeSelect);
 void cds_set_wma_dfs_region(struct regulatory *reg);
+void cds_set_ch_params(uint8_t ch, uint32_t phy_mode,
+		chan_params_t *ch_params);
 
 #endif /* REGULATORY_H */
diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c
index 016d586..0e0b10e 100644
--- a/core/cds/src/cds_reg_service.c
+++ b/core/cds/src/cds_reg_service.c
@@ -1458,3 +1458,27 @@
 
 	return CDF_STATUS_SUCCESS;
 }
+
+/**
+ * cds_set_ch_params() - set channel parameters
+ * @ch: channel
+ * @phy_mode: physical mode
+ * @ch_param: channel parameters will be returned
+ *
+ * Return: None
+ */
+void cds_set_ch_params(uint8_t ch, uint32_t phy_mode,
+		chan_params_t *ch_params)
+{
+	tHalHandle *hal_ctx = cds_get_context(CDF_MODULE_ID_PE);
+	if (!hal_ctx) {
+		CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR,
+			("Invalid hal_ctx pointer"));
+		return;
+	}
+	/*
+	 * TODO: remove SME call and move the SME set channel
+	 * param functionality to CDS.
+	 */
+	sme_set_ch_params(hal_ctx, phy_mode, ch, 0, ch_params);
+}
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index bd2853f..cdc23d7 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -287,6 +287,36 @@
 	uint8_t max_randn_interval;
 	uint8_t rm_capability[RMENABLEDCAP_MAX_LEN];
 };
+/**
+ * typedef ch_width - channel width
+ * @CH_WIDTH_20MHZ: channel width 20 MHz
+ * @CH_WIDTH_40MHZ: channel width 40 MHz
+ * @CH_WIDTH_80MHZ: channel width 80MHz
+ * @CH_WIDTH_160MHZ: channel width 160 MHz
+ * @CH_WIDTH_80P80MHZ: channel width 160MHz(80+80)
+ */
+typedef enum ch_width {
+	CH_WIDTH_20MHZ = 0,
+	CH_WIDTH_40MHZ = 1,
+	CH_WIDTH_80MHZ = 2,
+	CH_WIDTH_160MHZ = 3,
+	CH_WIDTH_80P80MHZ = 4
+} phy_ch_width;
+
+/**
+ * struct ch_params_s
+ *
+ * @ch_width: channel width
+ * @sec_ch_offset: secondary channel offset
+ * @center_freq_seg0: center freq for segment 0
+ * @center_freq_seg1: center freq for segment 1
+ */
+typedef struct ch_params_s {
+	enum ch_width ch_width;
+	uint8_t sec_ch_offset;
+	uint8_t center_freq_seg0;
+	uint8_t center_freq_seg1;
+} chan_params_t;
 
 /* each station added has a rate mode which specifies the sta attributes */
 typedef enum eStaRateMode {
@@ -3790,8 +3820,8 @@
 	uint16_t messageType;
 	uint16_t messageLen;
 	uint8_t targetChannel;
-	uint8_t cbMode;
-	uint8_t channel_width;
+	uint8_t sec_ch_offset;
+	phy_ch_width ch_width;
 	uint8_t center_freq_seg_0;
 	uint8_t center_freq_seg_1;
 	uint8_t bssid[CDF_MAC_ADDR_SIZE];
@@ -3872,7 +3902,7 @@
 	uint8_t targetChannel;
 	uint8_t csaIeRequired;
 	uint8_t bssid[CDF_MAC_ADDR_SIZE];
-	uint8_t ch_bandwidth;
+	struct ch_params_s ch_params;
 } tSirDfsCsaIeRequest, *tpSirDfsCsaIeRequest;
 
 /* Indication from lower layer indicating the completion of first beacon send
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index 64d4d62..6a4a485 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -71,7 +71,7 @@
 	PHY_CHANNEL_BONDING_STATE_MAX = 11
 } ePhyChanBondState;
 
-#define MAX_BONDED_CHANNELS 4
+#define MAX_BONDED_CHANNELS 8
 
 typedef enum {
 	MCC = 0,
diff --git a/core/mac/src/pe/include/lim_global.h b/core/mac/src/pe/include/lim_global.h
index 07bd3bc..a7747a1 100644
--- a/core/mac/src/pe/include/lim_global.h
+++ b/core/mac/src/pe/include/lim_global.h
@@ -512,6 +512,7 @@
 	uint8_t primaryChannel;
 	uint8_t ch_center_freq_seg0;
 	uint8_t ch_center_freq_seg1;
+	uint8_t sec_ch_offset;
 	phy_ch_width ch_width;
 	int8_t switchCount;
 	uint32_t switchTimeoutValue;
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index da1d9b6..9544e1a 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -498,60 +498,6 @@
 	return false;
 }
 
-#ifdef WLAN_FEATURE_11AC
-
-uint32_t lim_get_center_channel(tpAniSirGlobal pMac, uint8_t primarychanNum,
-				ePhyChanBondState secondaryChanOffset,
-				uint8_t chanWidth)
-{
-	if (chanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) {
-		switch (secondaryChanOffset) {
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
-			return primarychanNum;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
-			return primarychanNum + 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
-			return primarychanNum - 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
-			return primarychanNum + 6;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
-			return primarychanNum + 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
-			return primarychanNum - 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
-			return primarychanNum - 6;
-		default:
-			return eSIR_CFG_INVALID_ID;
-		}
-	} else if (chanWidth == WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ) {
-		switch (secondaryChanOffset) {
-		case PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
-			return primarychanNum + 2;
-		case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
-			return primarychanNum - 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
-			return primarychanNum;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
-			return primarychanNum + 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
-			return primarychanNum - 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
-			return primarychanNum + 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
-			return primarychanNum - 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
-			return primarychanNum + 2;
-		case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
-			return primarychanNum - 2;
-		default:
-			return eSIR_CFG_INVALID_ID;
-		}
-	}
-	return primarychanNum;
-}
-
-#endif
-
 /**
  *lim_configure_ap_start_bss_session() - Configure the AP Start BSS in session.
  *@mac_ctx: Pointer to Global MAC structure
@@ -5136,17 +5082,17 @@
 			"switch old chnl %d to new chnl %d, ch_bw %d"),
 			session_entry->currentOperChannel,
 			ch_change_req->targetChannel,
-			ch_change_req->channel_width);
+			ch_change_req->ch_width);
 
 	/* Store the New Channel Params in session_entry */
-	session_entry->ch_width = ch_change_req->channel_width;
+	session_entry->ch_width = ch_change_req->ch_width;
 	session_entry->ch_center_freq_seg0 =
 		ch_change_req->center_freq_seg_0;
 	session_entry->ch_center_freq_seg1 =
 		ch_change_req->center_freq_seg_1;
-	session_entry->htSecondaryChannelOffset = ch_change_req->cbMode;
+	session_entry->htSecondaryChannelOffset = ch_change_req->sec_ch_offset;
 	session_entry->htSupportedChannelWidthSet =
-		(ch_change_req->channel_width ? 1 : 0);
+		(ch_change_req->ch_width ? 1 : 0);
 	session_entry->htRecommendedTxWidthSet =
 		session_entry->htSupportedChannelWidthSet;
 	session_entry->currentOperChannel =
@@ -5548,7 +5494,6 @@
 {
 	tpSirDfsCsaIeRequest dfs_csa_ie_req;
 	tpPESession session_entry = NULL;
-	uint32_t ch_width = 0;
 	uint8_t session_id;
 	tLimWiderBWChannelSwitchInfo *wider_bw_ch_switch;
 
@@ -5581,7 +5526,7 @@
 	session_entry->dfsIncludeChanSwIe = true;
 	session_entry->gLimChannelSwitch.switchCount = LIM_MAX_CSA_IE_UPDATES;
 	session_entry->gLimChannelSwitch.ch_width =
-				 dfs_csa_ie_req->ch_bandwidth;
+				 dfs_csa_ie_req->ch_params.ch_width;
 	if (mac_ctx->sap.SapDfsInfo.disable_dfs_ch_switch == false)
 		session_entry->gLimChannelSwitch.switchMode = 1;
 
@@ -5592,16 +5537,10 @@
 	if (true != session_entry->vhtCapability)
 		goto skip_vht;
 
-	if (WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ ==
-			session_entry->vhtTxChannelWidthSet)
-		ch_width = eHT_CHANNEL_WIDTH_80MHZ;
-	else if (WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ ==
-			session_entry->vhtTxChannelWidthSet)
-		ch_width = session_entry->htSupportedChannelWidthSet;
 	/* Now encode the Wider Ch BW element depending on the ch width */
 	wider_bw_ch_switch = &session_entry->gLimWiderBWChannelSwitch;
-	switch (ch_width) {
-	case eHT_CHANNEL_WIDTH_20MHZ:
+	switch (dfs_csa_ie_req->ch_params.ch_width) {
+	case CH_WIDTH_20MHZ:
 		/*
 		 * Wide channel BW sublement in channel wrapper element is not
 		 * required in case of 20 Mhz operation. Currently It is set
@@ -5611,21 +5550,26 @@
 		wider_bw_ch_switch->newChanWidth =
 			WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
 		break;
-	case eHT_CHANNEL_WIDTH_40MHZ:
-		session_entry->dfsIncludeChanWrapperIe = true;
+	case CH_WIDTH_40MHZ:
+		session_entry->dfsIncludeChanWrapperIe = false;
 		wider_bw_ch_switch->newChanWidth =
 			WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ;
 		break;
-	case eHT_CHANNEL_WIDTH_80MHZ:
+	case CH_WIDTH_80MHZ:
 		session_entry->dfsIncludeChanWrapperIe = true;
 		wider_bw_ch_switch->newChanWidth =
 			WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ;
 		break;
-	case eHT_CHANNEL_WIDTH_160MHZ:
+	case CH_WIDTH_160MHZ:
 		session_entry->dfsIncludeChanWrapperIe = true;
 		wider_bw_ch_switch->newChanWidth =
 			WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ;
 		break;
+	case CH_WIDTH_80P80MHZ:
+		session_entry->dfsIncludeChanWrapperIe = true;
+		wider_bw_ch_switch->newChanWidth =
+			WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ;
+		break;
 	default:
 		session_entry->dfsIncludeChanWrapperIe = false;
 		/*
@@ -5637,16 +5581,15 @@
 	}
 	/* Fetch the center channel based on the channel width */
 	wider_bw_ch_switch->newCenterChanFreq0 =
-		lim_get_center_channel(mac_ctx, dfs_csa_ie_req->targetChannel,
-				       session_entry->htSecondaryChannelOffset,
-				       wider_bw_ch_switch->newChanWidth);
+		dfs_csa_ie_req->ch_params.center_freq_seg0;
 	/*
 	 * This is not applicable for 20/40/80 Mhz.Only used when we support
 	 * 80+80 Mhz operation. In case of 80+80 Mhz, this parameter indicates
 	 * center channel frequency index of 80 Mhz channel of
 	 * frequency segment 1.
 	 */
-	wider_bw_ch_switch->newCenterChanFreq1 = 0;
+	wider_bw_ch_switch->newCenterChanFreq1 =
+		dfs_csa_ie_req->ch_params.center_freq_seg1;
 skip_vht:
 	/* Send CSA IE request from here */
 	if (sch_set_fixed_beacon_fields(mac_ctx, session_entry) !=
diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c
index 62f452b..f99affb 100644
--- a/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -4259,7 +4259,6 @@
 	return eSIR_SUCCESS;
 } /* End lim_send_extended_chan_switch_action_frame */
 
-#ifdef WLAN_FEATURE_11AC
 tSirRetStatus
 lim_send_vht_opmode_notification_frame(tpAniSirGlobal pMac,
 				       tSirMacAddr peer,
@@ -4369,140 +4368,6 @@
 	return eSIR_SUCCESS;
 }
 
-/**
- * \brief Send a VHT Channel Switch Announcement
- *
- *
- * \param pMac Pointer to the global MAC datastructure
- *
- * \param peer MAC address to which this frame will be sent
- *
- * \param nChanWidth
- *
- * \param nNewChannel
- *
- *
- * \return eSIR_SUCCESS on success, eSIR_FAILURE else
- *
- *
- */
-
-tSirRetStatus
-lim_send_vht_channel_switch_mgmt_frame(tpAniSirGlobal pMac,
-				       tSirMacAddr peer,
-				       uint8_t nChanWidth,
-				       uint8_t nNewChannel,
-				       uint8_t ncbMode, tpPESession psessionEntry)
-{
-	tDot11fChannelSwitch frm;
-	uint8_t *pFrame;
-	tpSirMacMgmtHdr pMacHdr;
-	uint32_t nBytes, nPayload, nStatus;     /* , nCfg; */
-	void *pPacket;
-	CDF_STATUS cdf_status;
-	uint8_t txFlag = 0;
-
-	uint8_t smeSessionId = 0;
-
-	if (psessionEntry == NULL) {
-		PELOGE(lim_log(pMac, LOGE, FL("Session entry is NULL!!!"));)
-		return eSIR_FAILURE;
-	}
-	smeSessionId = psessionEntry->smeSessionId;
-
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
-
-	frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT;
-	frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID;
-	frm.ChanSwitchAnn.switchMode = 1;
-	frm.ChanSwitchAnn.newChannel = nNewChannel;
-	frm.ChanSwitchAnn.switchCount = 1;
-	frm.sec_chan_offset_ele.secondaryChannelOffset =
-						lim_get_htcb_state(ncbMode);
-	frm.sec_chan_offset_ele.present = 1;
-	frm.WiderBWChanSwitchAnn.newChanWidth = nChanWidth;
-	frm.WiderBWChanSwitchAnn.newCenterChanFreq0 =
-		lim_get_center_channel(pMac, nNewChannel, ncbMode, nChanWidth);
-	frm.WiderBWChanSwitchAnn.newCenterChanFreq1 = 0;
-	frm.ChanSwitchAnn.present = 1;
-	frm.WiderBWChanSwitchAnn.present = 1;
-
-	nStatus = dot11f_get_packed_channel_switch_size(pMac, &frm, &nPayload);
-	if (DOT11F_FAILED(nStatus)) {
-		lim_log(pMac, LOGP, FL("Failed to calculate the packed size f"
-				       "or a Channel Switch (0x%08x)."),
-			nStatus);
-		/* We'll fall back on the worst case scenario: */
-		nPayload = sizeof(tDot11fChannelSwitch);
-	} else if (DOT11F_WARNED(nStatus)) {
-		lim_log(pMac, LOGW, FL("There were warnings while calculating "
-				       "the packed size for a Channel Switch (0x"
-				       "%08x)."), nStatus);
-	}
-
-	nBytes = nPayload + sizeof(tSirMacMgmtHdr);
-
-	cdf_status =
-		cds_packet_alloc((uint16_t) nBytes, (void **)&pFrame,
-				 (void **)&pPacket);
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		lim_log(pMac, LOGP, FL("Failed to allocate %d bytes for a TPC"
-				       " Report."), nBytes);
-		return eSIR_FAILURE;
-	}
-	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
-
-	/* Next, we fill out the buffer descriptor: */
-	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
-		SIR_MAC_MGMT_ACTION, peer, psessionEntry->selfMacAddr);
-	pMacHdr = (tpSirMacMgmtHdr) pFrame;
-	cdf_mem_copy((uint8_t *) pMacHdr->bssId,
-		     (uint8_t *) psessionEntry->bssId, sizeof(tSirMacAddr));
-	nStatus = dot11f_pack_channel_switch(pMac, &frm, pFrame +
-					     sizeof(tSirMacMgmtHdr),
-					     nPayload, &nPayload);
-	if (DOT11F_FAILED(nStatus)) {
-		lim_log(pMac, LOGE,
-			FL("Failed to pack a Channel Switch (0x%08x)."),
-			nStatus);
-		cds_packet_free((void *)pPacket);
-		return eSIR_FAILURE;    /* allocated! */
-	} else if (DOT11F_WARNED(nStatus)) {
-		lim_log(pMac, LOGW, FL("There were warnings while packing a C"
-				       "hannel Switch (0x%08x)."), nStatus);
-	}
-
-	if ((SIR_BAND_5_GHZ == lim_get_rf_band(psessionEntry->currentOperChannel))
-	    || (psessionEntry->pePersona == CDF_P2P_CLIENT_MODE) ||
-	    (psessionEntry->pePersona == CDF_P2P_GO_MODE)
-	    ) {
-		txFlag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME;
-	}
-
-	MTRACE(cdf_trace(CDF_MODULE_ID_PE, TRACE_CODE_TX_MGMT,
-			 psessionEntry->peSessionId, pMacHdr->fc.subType));
-	cdf_status = wma_tx_frame(pMac, pPacket, (uint16_t) nBytes,
-				TXRX_FRM_802_11_MGMT,
-				ANI_TXDIR_TODS,
-				7, lim_tx_complete, pFrame, txFlag,
-				smeSessionId, 0);
-	MTRACE(cdf_trace(CDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
-			 psessionEntry->peSessionId, cdf_status));
-	if (!CDF_IS_STATUS_SUCCESS(cdf_status)) {
-		lim_log(pMac, LOGE,
-			FL("Failed to send a Channel Switch (%X)!"),
-			cdf_status);
-		/* Pkt will be freed up by the callback */
-		return eSIR_FAILURE;
-	}
-
-	return eSIR_SUCCESS;
-
-} /* End lim_send_vht_channel_switch_mgmt_frame. */
-
-#endif
-
 #if defined WLAN_FEATURE_VOWIFI
 
 /**
diff --git a/core/mac/src/pe/lim/lim_send_messages.h b/core/mac/src/pe/lim/lim_send_messages.h
index d884de7..95161fb 100644
--- a/core/mac/src/pe/lim/lim_send_messages.h
+++ b/core/mac/src/pe/lim/lim_send_messages.h
@@ -49,7 +49,6 @@
 				     tpUpdateBeaconParams pUpdatedBcnParams,
 				     tpPESession psessionEntry);
 /* tSirRetStatus lim_send_beacon_params(tpAniSirGlobal pMac, tpUpdateBeaconParams pUpdatedBcnParams); */
-#ifdef WLAN_FEATURE_11AC
 tSirRetStatus lim_send_mode_update(tpAniSirGlobal pMac,
 				   tUpdateVHTOpMode *tempParam,
 				   tpPESession psessionEntry);
@@ -57,11 +56,6 @@
 				     tUpdateRxNss *tempParam,
 				     tpPESession psessionEntry);
 
-uint32_t lim_get_center_channel(tpAniSirGlobal pMac,
-				uint8_t primarychanNum,
-				ePhyChanBondState secondaryChanOffset,
-				uint8_t chanWidth);
-
 tSirRetStatus lim_set_membership(tpAniSirGlobal pMac,
 				 tUpdateMembership *pTempParam,
 				 tpPESession psessionEntry);
@@ -69,7 +63,6 @@
 tSirRetStatus lim_set_user_pos(tpAniSirGlobal pMac,
 			       tUpdateUserPos *pTempParam,
 			       tpPESession psessionEntry);
-#endif
 #if defined WLAN_FEATURE_VOWIFI
 tSirRetStatus lim_send_switch_chnl_params(tpAniSirGlobal pMac,
 					  uint8_t chnlNumber,
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 ff4848c..ec9f22e 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
@@ -2021,9 +2021,10 @@
 	uint8_t session_id;
 	uint16_t aid = 0;
 	uint16_t chan_space = 0;
-	int cb_mode = 0;
+	chan_params_t ch_params;
 
 	tLimWiderBWChannelSwitchInfo *chnl_switch_info = NULL;
+	tLimChannelSwitchInfo *lim_ch_switch = NULL;
 
 	if (!csa_params) {
 		lim_log(mac_ctx, LOGE, FL("limMsgQ body ptr is NULL"));
@@ -2055,6 +2056,7 @@
 		 */
 		lim_delete_tdls_peers(mac_ctx, session_entry);
 
+		lim_ch_switch = &session_entry->gLimChannelSwitch;
 		session_entry->gLimChannelSwitch.switchMode =
 			csa_params->switchmode;
 		/* timer already started by firmware, switch immediately */
@@ -2064,7 +2066,8 @@
 		session_entry->gLimChannelSwitch.state =
 			eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
 		session_entry->gLimChannelSwitch.ch_width = CH_WIDTH_20MHZ;
-
+		lim_ch_switch->sec_ch_offset =
+			session_entry->htSecondaryChannelOffset;
 		session_entry->gLimChannelSwitch.ch_center_freq_seg0 = 0;
 		session_entry->gLimChannelSwitch.ch_center_freq_seg1 = 0;
 		chnl_switch_info =
@@ -2102,20 +2105,17 @@
 				} else {
 					chnl_switch_info->newChanWidth =
 								CH_WIDTH_20MHZ;
-					session_entry->gLimChannelSwitch.state =
+					lim_ch_switch->state =
 					    eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
 				}
 
-				cb_mode = lim_select_cb_mode_for_sta(
-						session_entry,
-						csa_params->channel,
-						chan_space);
-
+				ch_params.ch_width =
+					chnl_switch_info->newChanWidth;
+				cds_set_ch_params(csa_params->channel,
+						eCSR_DOT11_MODE_11ac,
+						&ch_params);
 				chnl_switch_info->newCenterChanFreq0 =
-				lim_get_center_channel(mac_ctx,
-					    csa_params->channel,
-					    cb_mode,
-					    chnl_switch_info->newChanWidth);
+					ch_params.center_freq_seg0;
 				/*
 				* This is not applicable for 20/40/80 MHz.
 				* Only used when we support 80+80 MHz operation.
@@ -2123,7 +2123,10 @@
 				* center channel frequency index of 80 MHz
 				* channel offrequency segment 1.
 				*/
-				chnl_switch_info->newCenterChanFreq1 = 0;
+				chnl_switch_info->newCenterChanFreq1 =
+					ch_params.center_freq_seg1;
+				lim_ch_switch->sec_ch_offset =
+					ch_params.sec_ch_offset;
 
 			}
 			session_entry->gLimChannelSwitch.ch_center_freq_seg0 =
@@ -2141,56 +2144,47 @@
 					mac_ctx->scan.countryCodeCurrent,
 					csa_params->channel,
 					csa_params->new_op_class);
-				session_entry->gLimChannelSwitch.state =
+				lim_ch_switch->state =
 				    eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
 				if (chan_space == 40) {
-					session_entry->
-					    gLimChannelSwitch.ch_width =
+					lim_ch_switch->ch_width =
 								CH_WIDTH_40MHZ;
 					chnl_switch_info->newChanWidth =
 								CH_WIDTH_40MHZ;
-					cb_mode = lim_select_cb_mode_for_sta(
-							session_entry,
-							csa_params->channel,
-							chan_space);
-					if (cb_mode ==
-					    PHY_DOUBLE_CHANNEL_LOW_PRIMARY) {
-						session_entry->
-						    gLimChannelSwitch.
-						    ch_center_freq_seg0 =
-							csa_params->channel + 2;
-					} else if (cb_mode ==
-					    PHY_DOUBLE_CHANNEL_HIGH_PRIMARY) {
-						session_entry->
-						    gLimChannelSwitch.
-						    ch_center_freq_seg0 =
-							csa_params->channel - 2;
-					}
-
+					ch_params.ch_width =
+						chnl_switch_info->newChanWidth;
+					cds_set_ch_params(csa_params->channel,
+							eCSR_DOT11_MODE_11n,
+							&ch_params);
+					lim_ch_switch->ch_center_freq_seg0 =
+						ch_params.center_freq_seg0;
+					lim_ch_switch->sec_ch_offset =
+						ch_params.sec_ch_offset;
 				} else {
-					session_entry->
-					    gLimChannelSwitch.ch_width =
+					lim_ch_switch->ch_width =
 								CH_WIDTH_20MHZ;
 					chnl_switch_info->newChanWidth =
 								CH_WIDTH_40MHZ;
-					session_entry->gLimChannelSwitch.state =
+					lim_ch_switch->state =
 					    eLIM_CHANNEL_SWITCH_PRIMARY_ONLY;
+					lim_ch_switch->sec_ch_offset =
+						PHY_SINGLE_CHANNEL_CENTERED;
 				}
-
-
-			}
-
-			if (csa_params->sec_chan_offset) {
-				session_entry->gLimChannelSwitch.ch_width =
-					CH_WIDTH_40MHZ;
-				session_entry->gLimChannelSwitch.state =
-				     eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
 			} else {
-				session_entry->htSupportedChannelWidthSet =
-					WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
-				session_entry->htRecommendedTxWidthSet =
-				    session_entry->htSupportedChannelWidthSet;
+				lim_ch_switch->ch_width =
+					CH_WIDTH_40MHZ;
+				lim_ch_switch->state =
+				     eLIM_CHANNEL_SWITCH_PRIMARY_AND_SECONDARY;
+				ch_params.ch_width = CH_WIDTH_40MHZ;
+				cds_set_ch_params(csa_params->channel,
+						eCSR_DOT11_MODE_11n,
+						&ch_params);
+				lim_ch_switch->ch_center_freq_seg0 =
+					ch_params.center_freq_seg0;
+				lim_ch_switch->sec_ch_offset =
+					ch_params.sec_ch_offset;
 			}
+
 		}
 		lim_log(mac_ctx, LOG1, FL("new ch width = %d"),
 			session_entry->gLimChannelSwitch.ch_width);
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index 99ff485..c4b5750 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -497,17 +497,9 @@
 	tSirMacAddr peer, uint8_t mode, uint8_t new_op_class,
 	uint8_t new_channel, uint8_t count, tpPESession session_entry);
 
-#ifdef WLAN_FEATURE_11AC
 tSirRetStatus lim_send_vht_opmode_notification_frame(tpAniSirGlobal pMac,
 						     tSirMacAddr peer, uint8_t nMode,
 						     tpPESession psessionEntry);
-tSirRetStatus lim_send_vht_channel_switch_mgmt_frame(tpAniSirGlobal pMac,
-						     tSirMacAddr peer,
-						     uint8_t nChanWidth,
-						     uint8_t nNewChannel,
-						     uint8_t ncbMode,
-						     tpPESession psessionEntry);
-#endif
 
 #if defined WLAN_FEATURE_VOWIFI
 tSirRetStatus lim_send_neighbor_report_request_frame(tpAniSirGlobal,
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 00d4169..0b90d19 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -2810,11 +2810,13 @@
 			psessionEntry->currentOperChannel, newChannel);
 		psessionEntry->currentOperChannel = newChannel;
 	}
-	if (psessionEntry->htSecondaryChannelOffset != subband) {
+	if (psessionEntry->htSecondaryChannelOffset !=
+			psessionEntry->gLimChannelSwitch.sec_ch_offset) {
 		lim_log(pMac, LOGW,
 			FL("switch old sec chnl %d --> new sec chnl %d "),
 			psessionEntry->htSecondaryChannelOffset, subband);
-		psessionEntry->htSecondaryChannelOffset = subband;
+		psessionEntry->htSecondaryChannelOffset =
+			psessionEntry->gLimChannelSwitch.sec_ch_offset;
 		if (psessionEntry->htSecondaryChannelOffset ==
 		    PHY_SINGLE_CHANNEL_CENTERED) {
 			psessionEntry->htSupportedChannelWidthSet =
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 42a5eab..cd9d6a1 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -294,59 +294,6 @@
 	return false;
 }
 
-/**
- * lim_select_cb_mode_for_sta() - return cb_mode based on current session
- * @session_entry: Session entry
- * @channel: channel
- * @chan_bw: channel bandwidth
- *
- * Given a value of channel and bandwidth this API will return the value of
- * cb_mode on basis of channel, bandwidth ht/vht capabilities
- *
- * Return: cb_mode
- *
- */
-
-static inline int lim_select_cb_mode_for_sta(tpPESession session_entry,
-				uint8_t channel, uint8_t chan_bw)
-{
-	if (session_entry->vhtCapability && chan_bw) {
-		if (channel == 36 || channel == 52 || channel == 100 ||
-				channel == 116 || channel == 149) {
-			return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW - 1;
-		} else if (channel == 40 || channel == 56 || channel == 104 ||
-				channel == 120 || channel == 153) {
-			return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW - 1;
-		} else if (channel == 44 || channel == 60 || channel == 108 ||
-				channel == 124 || channel == 157) {
-			return PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH - 1;
-		} else if (channel == 48 || channel == 64 || channel == 112 ||
-				channel == 128 || channel == 161) {
-			return PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH - 1;
-		} else if (channel == 165) {
-			return PHY_SINGLE_CHANNEL_CENTERED;
-		}
-	} else if (session_entry->htSupportedChannelWidthSet) {
-		if (channel == 40 || channel == 48 || channel == 56 ||
-			channel == 64 || channel == 104 || channel == 112 ||
-			channel == 120 || channel == 128 || channel == 136 ||
-			channel == 144 || channel == 153 || channel == 161) {
-			return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
-		} else if (channel == 36 || channel == 44 || channel == 52 ||
-				channel == 60 || channel == 100 ||
-				channel == 108 || channel == 116 ||
-				channel == 124 || channel == 132 ||
-				channel == 140 || channel == 149 ||
-				channel == 157) {
-			return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
-		} else if (channel == 165) {
-			return PHY_SINGLE_CHANNEL_CENTERED;
-		}
-	}
-	return PHY_SINGLE_CHANNEL_CENTERED;
-}
-
-
 static inline int lim_select_cb_mode(tDphHashNode *pStaDs,
 		tpPESession psessionEntry, uint8_t channel,
 		uint8_t chan_bw)
diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h
index 40f3b2d..ffe912c 100644
--- a/core/sap/inc/sap_api.h
+++ b/core/sap/inc/sap_api.h
@@ -625,10 +625,9 @@
 	 * New channel width and new channel bonding mode
 	 * will only be updated via channel fallback mechanism
 	 */
-	uint8_t orig_cbMode;
-	uint8_t orig_chanWidth;
-	uint8_t new_chanWidth;
-	uint8_t new_cbMode;
+	phy_ch_width orig_chanWidth;
+	phy_ch_width new_chanWidth;
+	chan_params_t new_ch_params;
 
 	/*
 	 * INI param to enable/disable SAP W53
diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c
index 8335de5..771fc58 100644
--- a/core/sap/src/sap_fsm.c
+++ b/core/sap/src/sap_fsm.c
@@ -878,23 +878,19 @@
 
 #ifdef WLAN_ENABLE_CHNL_MATRIX_RESTRICTION
 /*
- * This function gives the leakage matrix for given NOL channel and cbMode
+ * sap_find_target_channel_in_channel_matrix() - finds the leakage matrix
+ * @sapContext: Pointer to vos global context structure
+ * @ch_width: target channel width
+ * @NOL_channel: the NOL channel whose leakage matrix is required
+ * @pTarget_chnl_mtrx: pointer to target channel matrix returned.
  *
- * PARAMETERS
- * IN
- * sapContext        : Pointer to vos global context structure
- * cbMode            : target channel bonding mode
- * NOL_channel       : the NOL channel whose leakage matrix is required
- * pTarget_chnl_mtrx : pointer to target channel matrix returned.
+ * This function gives the leakage matrix for given NOL channel and ch_width
  *
- * RETURN VALUE
- * BOOLEAN
- * TRUE:  leakage matrix was found
- * FALSE: leakage matrix was not found
+ * Return: TRUE or FALSE
  */
 bool
 sap_find_target_channel_in_channel_matrix(ptSapContext sapContext,
-					  ePhyChanBondState cbMode,
+					  phy_ch_width ch_width,
 					  uint8_t NOL_channel,
 					  tSapTxLeakInfo **pTarget_chnl_mtrx)
 {
@@ -903,28 +899,22 @@
 	uint32_t nchan_matrix;
 	int i = 0;
 
-	switch (cbMode) {
-	case PHY_SINGLE_CHANNEL_CENTERED:
+	switch (ch_width) {
+	case CH_WIDTH_20MHZ:
 		/* HT20 */
 		pchan_matrix = ht20_chan;
 		nchan_matrix = CDF_ARRAY_SIZE(ht20_chan);
 		break;
-	case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
-	case PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
+	case CH_WIDTH_40MHZ:
 		/* HT40 */
 		pchan_matrix = ht40_chan;
 		nchan_matrix = CDF_ARRAY_SIZE(ht40_chan);
 		break;
-#ifdef WLAN_FEATURE_11AC
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
+	case CH_WIDTH_80MHZ:
 		/* HT80 */
 		pchan_matrix = ht80_chan;
 		nchan_matrix = CDF_ARRAY_SIZE(ht80_chan);
 		break;
-#endif
 	default:
 		/* handle exception and fall back to HT20 table */
 		pchan_matrix = ht20_chan;
@@ -951,7 +941,7 @@
 /**
  * sap_mark_channels_leaking_into_nol() - to mark channel leaking in to nol
  * @sap_ctx: pointer to SAP context
- * @cb_mode: channel bonding mode
+ * @ch_width: channel width
  * @nol: nol info
  * @temp_ch_lst_sz: the target channel list
  * @temp_ch_lst: the target channel list
@@ -965,7 +955,7 @@
 
 CDF_STATUS
 sap_mark_channels_leaking_into_nol(ptSapContext sap_ctx,
-		ePhyChanBondState cb_mode,
+		phy_ch_width ch_width,
 		tSapDfsNolInfo *nol,
 		uint8_t temp_ch_lst_sz,
 		uint8_t *temp_ch_lst)
@@ -990,7 +980,7 @@
 			FL("sapdfs: processing NOL channel: %d"),
 			dfs_nol_channel);
 		if (false == sap_find_target_channel_in_channel_matrix(
-					sap_ctx, cb_mode, dfs_nol_channel,
+					sap_ctx, ch_width, dfs_nol_channel,
 					&target_chan_matrix)) {
 			/*
 			 * should never happen, we should always find a table
@@ -1066,9 +1056,9 @@
 }
 
 /**
- * sap_populate_available_channels - To populate available channel
+ * sap_populate_available_channels() - To populate available channel
  * @bitmap: bitmap to populate
- * @current_cbmode: cb mode to check for channel availability
+ * @ch_width: channel width
  * @avail_chnl: available channel list to populate
  *
  * This function reads the bitmap and populates available channel
@@ -1079,20 +1069,16 @@
  * Return: number of channels found
  */
 static uint8_t sap_populate_available_channels(chan_bonding_bitmap *bitmap,
-		ePhyChanBondState current_cbmode,
+		phy_ch_width ch_width,
 		uint8_t *avail_chnl)
 {
 	uint8_t i = 0;
 	uint8_t chnl_count = 0;
 	uint8_t start_channel = 0;
 
-	switch (current_cbmode) {
-#ifdef WLAN_FEATURE_11AC
-	/* HT80 */
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
-	case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
+	switch (ch_width) {
+	/* VHT80 */
+	case CH_WIDTH_80MHZ:
 		for (i = 0; i < MAX_80MHZ_BANDS; i++) {
 			start_channel = bitmap->chanBondingSet[i].startChannel;
 			if (bitmap->chanBondingSet[i].channelMap ==
@@ -1104,10 +1090,8 @@
 			}
 		}
 		break;
-#endif
 	/* HT40 */
-	case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
-	case PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
+	case CH_WIDTH_40MHZ:
 		for (i = 0; i < MAX_80MHZ_BANDS; i++) {
 			start_channel = bitmap->chanBondingSet[i].startChannel;
 			if ((bitmap->chanBondingSet[i].channelMap &
@@ -1262,8 +1246,7 @@
 	uint8_t channelID;
 	tHalHandle hHal = CDS_GET_HAL_CB(sapContext->p_cds_gctx);
 	tpAniSirGlobal pMac;
-	uint32_t chanWidth;
-	ePhyChanBondState cbModeCurrent;
+	phy_ch_width ch_width;
 	uint8_t   *tmp_ch_lst = NULL;
 	uint8_t   dfs_region;
 
@@ -1285,25 +1268,12 @@
 	 * use the stored original value when you call this function next time
 	 * so fall back mechanism always starts with original ini value.
 	 */
-	if (pMac->sap.SapDfsInfo.orig_cbMode == 0) {
-		pMac->sap.SapDfsInfo.orig_cbMode =
-			(sapContext->ch_width_orig > CH_WIDTH_20MHZ ? 1 : 0);
-		cbModeCurrent = pMac->sap.SapDfsInfo.orig_cbMode;
-	} else {
-		cbModeCurrent = pMac->sap.SapDfsInfo.orig_cbMode;
-	}
-
-	/*
-	 * Retrieve the original one and store it.
-	 * use the stored original value when you call this function next time
-	 * so fall back mechanism always starts with original ini value.
-	 */
 	if (pMac->sap.SapDfsInfo.orig_chanWidth == 0) {
 		pMac->sap.SapDfsInfo.orig_chanWidth =
 					sapContext->ch_width_orig;
-		chanWidth = pMac->sap.SapDfsInfo.orig_chanWidth;
+		ch_width = pMac->sap.SapDfsInfo.orig_chanWidth;
 	} else {
-		chanWidth = pMac->sap.SapDfsInfo.orig_chanWidth;
+		ch_width = pMac->sap.SapDfsInfo.orig_chanWidth;
 	}
 
 	if (sap_get5_g_hz_channel_list(sapContext)) {
@@ -1471,7 +1441,7 @@
 			  );
 		if (CDF_STATUS_SUCCESS !=
 			sap_mark_channels_leaking_into_nol(sapContext,
-							   cbModeCurrent,
+							   ch_width,
 							   nol,
 							   valid_chnl_count,
 							   tmp_ch_lst)) {
@@ -1505,8 +1475,7 @@
 				 * for 20MHz, directly create available
 				 * channel list
 				 */
-				if (cbModeCurrent ==
-					PHY_SINGLE_CHANNEL_CENTERED) {
+				if (ch_width == CH_WIDTH_20MHZ) {
 					CDF_TRACE(CDF_MODULE_ID_SAP,
 						  CDF_TRACE_LEVEL_DEBUG,
 						  FL
@@ -1529,18 +1498,17 @@
 		 * if 40 MHz or 80 MHz, populate available
 		 * channel list from bitmap
 		 */
-		if (cbModeCurrent != PHY_SINGLE_CHANNEL_CENTERED) {
+		if (ch_width != CH_WIDTH_20MHZ) {
 			available_ch_cnt =
 				sap_populate_available_channels(&channelBitmap,
-							cbModeCurrent,
+							ch_width,
 							availableChannels);
 			/*
 			 * if no valid channel bonding found,
 			 * fallback to lower bandwidth
 			 */
 			if (available_ch_cnt == 0) {
-				if (cbModeCurrent >=
-				    PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED) {
+				if (ch_width == CH_WIDTH_80MHZ) {
 					CDF_TRACE(CDF_MODULE_ID_SAP,
 						  CDF_TRACE_LEVEL_WARN,
 						  FL
@@ -1549,22 +1517,12 @@
 						  CDF_TRACE_LEVEL_WARN,
 						  FL
 						  ("sapdfs:Changing chanWidth from [%d] to [%d]"),
-						  chanWidth,
+						  ch_width,
 						  CH_WIDTH_40MHZ);
-					CDF_TRACE(CDF_MODULE_ID_SAP,
-						  CDF_TRACE_LEVEL_WARN,
-						  FL
-						  ("sapdfs:Changing CB mode from [%d] to [%d]"),
-						  cbModeCurrent,
-						  PHY_DOUBLE_CHANNEL_LOW_PRIMARY
-						  );
-					cbModeCurrent =
-						PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
-					chanWidth = CH_WIDTH_40MHZ;
+					ch_width = CH_WIDTH_40MHZ;
 					/* continue to start of do loop */
 					continue;
-				} else if (cbModeCurrent >=
-					   PHY_DOUBLE_CHANNEL_LOW_PRIMARY) {
+				} else if (ch_width == CH_WIDTH_40MHZ) {
 					CDF_TRACE(CDF_MODULE_ID_SAP,
 						  CDF_TRACE_LEVEL_WARN,
 						  FL
@@ -1573,17 +1531,9 @@
 						  CDF_TRACE_LEVEL_WARN,
 						  FL
 						  ("sapdfs:Changing chanWidth from [%d] to [%d]"),
-						  chanWidth,
+						  ch_width,
 						  CH_WIDTH_20MHZ);
-					CDF_TRACE(CDF_MODULE_ID_SAP,
-						  CDF_TRACE_LEVEL_WARN,
-						  FL
-						  ("sapdfs:Changing CB mode from [%d] to [%d]"),
-						  cbModeCurrent,
-						  PHY_SINGLE_CHANNEL_CENTERED);
-					cbModeCurrent =
-						PHY_SINGLE_CHANNEL_CENTERED;
-					chanWidth = CH_WIDTH_20MHZ;
+					ch_width = CH_WIDTH_20MHZ;
 					/* continue to start of do loop */
 					continue;
 				}
@@ -1629,12 +1579,7 @@
 			target_channel = avail_dfs_chan_list[i];
 		}
 
-		pMac->sap.SapDfsInfo.new_chanWidth = chanWidth;
-		pMac->sap.SapDfsInfo.new_cbMode = cbModeCurrent;
-		CDF_TRACE(CDF_MODULE_ID_SAP,
-				CDF_TRACE_LEVEL_INFO_LOW,
-				FL("sapdfs: New CB mode = %d"),
-				pMac->sap.SapDfsInfo.new_cbMode);
+		pMac->sap.SapDfsInfo.new_chanWidth = ch_width;
 		CDF_TRACE(CDF_MODULE_ID_SAP,
 				CDF_TRACE_LEVEL_INFO_LOW,
 				FL("sapdfs: New Channel width = %d"),
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index 8365830..40fcc28 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -1425,7 +1425,6 @@
 {
 	void *hal;
 	tpAniSirGlobal mac_ctx;
-	tSmeConfigParams *sme_config;
 	uint8_t bw;
 
 	hal = CDS_GET_HAL_CB(sap_context->p_cds_gctx);
@@ -1437,23 +1436,12 @@
 
 	mac_ctx = PMAC_STRUCT(hal);
 
-	sme_config = cdf_mem_malloc(sizeof(*sme_config));
-	if (!sme_config) {
-		CDF_TRACE(CDF_MODULE_ID_SAP, CDF_TRACE_LEVEL_ERROR,
-			FL("memory allocation failed for sme_config"));
-		return CDF_STATUS_E_NOMEM;
-	}
-
-	sme_get_config_param(mac_ctx, sme_config);
 	if (channel <= RF_CHAN_14) {
 		/*
 		 * currently OBSS scan is done in hostapd, so to avoid
 		 * SAP coming up in HT40 on channel switch we are
 		 * disabling channel bonding in 2.4Ghz.
 		 */
-		sme_config->csrConfig.channelBondingMode24GHz =
-			eCSR_INI_SINGLE_CHANNEL_CENTERED;
-		mac_ctx->sap.SapDfsInfo.new_cbMode = 0;
 		mac_ctx->sap.SapDfsInfo.new_chanWidth = 0;
 
 	} else {
@@ -1475,37 +1463,23 @@
 				continue;
 
 			if (bw == BW80) {
-				wlansap_update_bw80_cbmode(channel, sme_config);
-				mac_ctx->sap.SapDfsInfo.new_cbMode =
-				   sme_config->csrConfig.channelBondingMode5GHz;
 				mac_ctx->sap.SapDfsInfo.new_chanWidth =
 					CH_WIDTH_80MHZ;
 			} else if (bw == BW40_HIGH_PRIMARY) {
 				mac_ctx->sap.SapDfsInfo.new_chanWidth =
 					CH_WIDTH_40MHZ;
-				sme_config->csrConfig.channelBondingMode5GHz =
-				mac_ctx->sap.SapDfsInfo.new_cbMode =
-				   eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY;
 			} else if (bw == BW40_LOW_PRIMARY) {
 				mac_ctx->sap.SapDfsInfo.new_chanWidth =
 				   CH_WIDTH_40MHZ;
-				sme_config->csrConfig.channelBondingMode5GHz =
-				mac_ctx->sap.SapDfsInfo.new_cbMode =
-				   eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY;
 			} else {
 				mac_ctx->sap.SapDfsInfo.new_chanWidth =
 				   CH_WIDTH_20MHZ;
-				sme_config->csrConfig.channelBondingMode5GHz =
-				mac_ctx->sap.SapDfsInfo.new_cbMode =
-				   eCSR_INI_SINGLE_CHANNEL_CENTERED;
 			}
 			break;
 		}
 
 	}
 
-	sme_update_config(mac_ctx, sme_config);
-	cdf_mem_free(sme_config);
 	return CDF_STATUS_SUCCESS;
 }
 
@@ -1599,6 +1573,13 @@
 			 * to sap context.
 			 */
 			pMac->sap.SapDfsInfo.target_channel = targetChannel;
+			pMac->sap.SapDfsInfo.new_ch_params.ch_width =
+				pMac->sap.SapDfsInfo.new_chanWidth;
+			sme_set_ch_params(hHal,
+					sapContext->csr_roamProfile.phyMode,
+					targetChannel,
+					0,
+					&pMac->sap.SapDfsInfo.new_ch_params);
 			/*
 			 * Set the CSA IE required flag.
 			 */
@@ -2307,8 +2288,6 @@
 	void *hHal = NULL;
 	tpAniSirGlobal mac_ctx = NULL;
 	eCsrPhyMode phy_mode;
-	uint32_t cb_mode;
-	uint32_t vht_channel_width;
 	chan_params_t ch_params;
 	sapContext = (ptSapContext) pSapCtx;
 
@@ -2332,18 +2311,16 @@
 	 * because we've implemented channel width fallback mechanism for DFS
 	 * which will result in channel width changing dynamically.
 	 */
-	cb_mode = mac_ctx->sap.SapDfsInfo.new_cbMode;
-	vht_channel_width = mac_ctx->sap.SapDfsInfo.new_chanWidth;
-	ch_params.ch_width = vht_channel_width;
+	ch_params.ch_width = mac_ctx->sap.SapDfsInfo.new_chanWidth;
 	sme_set_ch_params(hHal, phy_mode, target_channel, 0, &ch_params);
-	sapContext->ch_params.ch_width = vht_channel_width;
+	sapContext->ch_params.ch_width = ch_params.ch_width;
 	/* Update the channel as this will be used to
 	 * send event to supplicant
 	 */
 	sapContext->channel = target_channel;
-	sapContext->csr_roamProfile.ch_params.ch_width = vht_channel_width;
+	sapContext->csr_roamProfile.ch_params.ch_width = ch_params.ch_width;
 	cdf_ret_status = sme_roam_channel_change_req(hHal, sapContext->bssid,
-				cb_mode, &sapContext->csr_roamProfile);
+				&ch_params, &sapContext->csr_roamProfile);
 
 	if (cdf_ret_status == CDF_STATUS_SUCCESS) {
 		sap_signal_hdd_event(sapContext, NULL,
@@ -2446,8 +2423,6 @@
 	CDF_STATUS cdf_ret_status = CDF_STATUS_E_FAILURE;
 	void *hHal = NULL;
 	tpAniSirGlobal pMac = NULL;
-	uint32_t cbmode, vht_ch_width;
-	uint8_t ch_bandwidth;
 	sapContext = (ptSapContext) pSapCtx;
 
 	if (NULL == sapContext) {
@@ -2464,38 +2439,11 @@
 	}
 	pMac = PMAC_STRUCT(hHal);
 
-	/*
-	 * We are getting channel bonding mode from sapDfsInfor structure
-	 * because we've implemented channel width fallback mechanism for DFS
-	 * which will result in channel width changing dynamically.
-	 */
-	vht_ch_width = pMac->sap.SapDfsInfo.new_chanWidth;
-	cbmode = pMac->sap.SapDfsInfo.new_cbMode;
-
-	if (pMac->sap.SapDfsInfo.target_channel <= 14 ||
-		vht_ch_width == eHT_CHANNEL_WIDTH_40MHZ ||
-		vht_ch_width == eHT_CHANNEL_WIDTH_20MHZ) {
-		switch (cbmode) {
-		case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY:
-			ch_bandwidth = BW40_HIGH_PRIMARY;
-			break;
-		case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY:
-			ch_bandwidth = BW40_LOW_PRIMARY;
-			break;
-		case eCSR_INI_SINGLE_CHANNEL_CENTERED:
-		default:
-			ch_bandwidth = BW20;
-			break;
-		}
-	} else {
-		ch_bandwidth = BW80;
-	}
-
 	cdf_ret_status = sme_roam_csa_ie_request(hHal,
 				sapContext->bssid,
 				pMac->sap.SapDfsInfo.target_channel,
 				pMac->sap.SapDfsInfo.csaIERequired,
-				ch_bandwidth);
+				&pMac->sap.SapDfsInfo.new_ch_params);
 
 	if (cdf_ret_status == CDF_STATUS_SUCCESS) {
 		return CDF_STATUS_SUCCESS;
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index 1bb5b5c..82d3cfc 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -41,21 +41,6 @@
 #define CSR_INVALID_SCANRESULT_HANDLE       (NULL)
 
 typedef enum {
-	CH_WIDTH_20MHZ = 0,
-	CH_WIDTH_40MHZ = 1,
-	CH_WIDTH_80MHZ = 2,
-	CH_WIDTH_160MHZ = 3,
-	CH_WIDTH_80P80MHZ = 4
-} phy_ch_width;
-
-typedef struct ch_params_s {
-	phy_ch_width ch_width;
-	uint8_t sec_ch_offset;
-	uint8_t center_freq_seg0;
-	uint8_t center_freq_seg1;
-} chan_params_t;
-
-typedef enum {
 	/* never used */
 	eCSR_AUTH_TYPE_NONE,
 	/* MAC layer authentication types */
@@ -145,10 +130,8 @@
 	eCSR_DOT11_MODE_11g_ONLY = 0x0020,
 	eCSR_DOT11_MODE_11n_ONLY = 0x0040,
 	eCSR_DOT11_MODE_11b_ONLY = 0x0080,
-#ifdef WLAN_FEATURE_11AC
 	eCSR_DOT11_MODE_11ac = 0x0100,
 	eCSR_DOT11_MODE_11ac_ONLY = 0x0200,
-#endif
 	/*
 	 * This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL
 	 * except when it starts IBSS in 11B of 2.4GHz
diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h
index 1140a54..a7e5d4d 100644
--- a/core/sme/inc/csr_internal.h
+++ b/core/sme/inc/csr_internal.h
@@ -1333,7 +1333,7 @@
 
 /* Post Channel Change Indication */
 CDF_STATUS csr_roam_channel_change_req(tpAniSirGlobal pMac,
-		struct cdf_mac_addr bssid, uint8_t cb_mode,
+		struct cdf_mac_addr bssid, chan_params_t *ch_params,
 		tCsrRoamProfile *profile);
 
 /* Post Beacon Tx Start Indication */
@@ -1342,7 +1342,8 @@
 
 CDF_STATUS
 csr_roam_send_chan_sw_ie_request(tpAniSirGlobal pMac, struct cdf_mac_addr bssid,
-		uint8_t targetChannel, uint8_t csaIeReqd, uint8_t ch_bandwidth);
+		uint8_t targetChannel, uint8_t csaIeReqd,
+		chan_params_t *ch_params);
 CDF_STATUS
 csr_roam_modify_add_ies(tpAniSirGlobal pMac,
 		tSirModifyIE *pModifyIE, eUpdateIEsType updateType);
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 9ef7599..413a801 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -786,12 +786,13 @@
 CDF_STATUS sme_set_auto_shutdown_timer(tHalHandle hHal, uint32_t timer_value);
 #endif
 CDF_STATUS sme_roam_channel_change_req(tHalHandle hHal,
-		struct cdf_mac_addr bssid, uint32_t cb_mode,
+		struct cdf_mac_addr bssid, chan_params_t *ch_params,
 		tCsrRoamProfile *profile);
 CDF_STATUS sme_roam_start_beacon_req(tHalHandle hHal,
 		struct cdf_mac_addr bssid, uint8_t dfsCacWaitStatus);
 CDF_STATUS sme_roam_csa_ie_request(tHalHandle hHal, struct cdf_mac_addr bssid,
-		uint8_t targetChannel, uint8_t csaIeReqd, uint8_t ch_bandwidth);
+		uint8_t targetChannel, uint8_t csaIeReqd,
+		chan_params_t *ch_params);
 CDF_STATUS sme_init_thermal_info(tHalHandle hHal,
 		tSmeThermalParams thermalParam);
 CDF_STATUS sme_set_thermal_level(tHalHandle hHal, uint8_t level);
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index a1d4a53..1d45f67 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -11995,32 +11995,28 @@
 	return CDF_STATUS_SUCCESS;
 }
 
-/* -------------------------------------------------------------------------
-   \fn sme_roam_channel_change_req
-   \brief API to Indicate Channel change to new target channel
-   \param hHal - The handle returned by mac_open
-   \param targetChannel - New Channel to move the SAP to.
-   \return CDF_STATUS
-   ---------------------------------------------------------------------------*/
+/**
+ * sme_roam_channel_change_req() - Channel change to new target channel
+ * @hHal: handle returned by mac_open
+ * @bssid: mac address of BSS
+ * @ch_params: target channel information
+ * @profile: CSR profile
+ *
+ * API to Indicate Channel change to new target channel
+ *
+ * Return: CDF_STATUS
+ */
 CDF_STATUS sme_roam_channel_change_req(tHalHandle hHal,
-	struct cdf_mac_addr bssid, uint32_t cb_mode, tCsrRoamProfile *profile)
+	struct cdf_mac_addr bssid, chan_params_t *ch_params,
+	tCsrRoamProfile *profile)
 {
 	CDF_STATUS status = CDF_STATUS_E_FAILURE;
 	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-	uint8_t ch_mode;
-
-	ch_mode = (profile->ChannelInfo.ChannelList[0] <=
-			CSR_MAX_2_4_GHZ_SUPPORTED_CHANNELS) ?
-			pMac->roam.configParam.channelBondingMode24GHz :
-			pMac->roam.configParam.channelBondingMode5GHz;
 
 	status = sme_acquire_global_lock(&pMac->sme);
 	if (CDF_IS_STATUS_SUCCESS(status)) {
 
-		CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_INFO_MED,
-			  FL("sapdfs: requested cbmode=[%d] & new negotiated cbmode[%d]"),
-			  cb_mode, ch_mode);
-		status = csr_roam_channel_change_req(pMac, bssid, ch_mode,
+		status = csr_roam_channel_change_req(pMac, bssid, ch_params,
 				profile);
 		sme_release_global_lock(&pMac->sme);
 	}
@@ -12109,25 +12105,26 @@
 	return status;
 }
 
-/* -------------------------------------------------------------------------
-   \fn sme_roam_csa_ie_request
-   \brief API to request CSA IE transmission from PE
-   \param hHal - The handle returned by mac_open
-   \param pDfsCsaReq - CSA IE request
-   \param bssid - SAP bssid
-   \param ch_bandwidth - Channel offset
-   \return CDF_STATUS
-   ---------------------------------------------------------------------------*/
+/**
+ * sme_roam_csa_ie_request() - request CSA IE transmission from PE
+ * @hHal: handle returned by mac_open
+ * @bssid: SAP bssid
+ * @targetChannel: target channel information
+ * @csaIeReqd: CSA IE Request
+ * @ch_params: channel information
+ *
+ * Return: CDF_STATUS
+ */
 CDF_STATUS sme_roam_csa_ie_request(tHalHandle hHal, struct cdf_mac_addr bssid,
 				uint8_t targetChannel, uint8_t csaIeReqd,
-				uint8_t ch_bandwidth)
+				chan_params_t *ch_params)
 {
 	CDF_STATUS status = CDF_STATUS_E_FAILURE;
 	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
 	status = sme_acquire_global_lock(&pMac->sme);
 	if (CDF_IS_STATUS_SUCCESS(status)) {
-		status = csr_roam_send_chan_sw_ie_request(pMac, bssid, targetChannel,
-				csaIeReqd, ch_bandwidth);
+		status = csr_roam_send_chan_sw_ie_request(pMac, bssid,
+				targetChannel, csaIeReqd, ch_params);
 		sme_release_global_lock(&pMac->sme);
 	}
 	return status;
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 813c2c7..08f422d 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -17964,14 +17964,21 @@
 }
 #endif /*FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
 
-/*
- * Post Channel Change Request to LIM
+/**
+ * csr_roam_channel_change_req() - Post channel change request to LIM
+ * @pMac: mac context
+ * @bssid: SAP bssid
+ * @ch_params: channel information
+ * @profile: CSR profile
+ *
  * This API is primarily used to post
  * Channel Change Req for SAP
+ *
+ * Return: CDF_STATUS
  */
-CDF_STATUS
-csr_roam_channel_change_req(tpAniSirGlobal pMac, struct cdf_mac_addr bssid,
-			    uint8_t cbMode, tCsrRoamProfile *profile)
+CDF_STATUS csr_roam_channel_change_req(tpAniSirGlobal pMac,
+			struct cdf_mac_addr bssid,
+			chan_params_t *ch_params, tCsrRoamProfile *profile)
 {
 	CDF_STATUS status = CDF_STATUS_SUCCESS;
 	tSirChanChangeRequest *pMsg;
@@ -17988,12 +17995,12 @@
 	pMsg->messageType = eWNI_SME_CHANNEL_CHANGE_REQ;
 	pMsg->messageLen = sizeof(tSirChanChangeRequest);
 	pMsg->targetChannel = profile->ChannelInfo.ChannelList[0];
-	pMsg->cbMode = cbMode;
-	pMsg->channel_width = profile->ch_params.ch_width;
+	pMsg->sec_ch_offset = ch_params->sec_ch_offset;
+	pMsg->ch_width = profile->ch_params.ch_width;
 	pMsg->dot11mode = csr_translate_to_wni_cfg_dot11_mode(pMac,
 					pMac->roam.configParam.uCfgDot11Mode);
-	pMsg->center_freq_seg_0 = pMsg->targetChannel;
-	pMsg->center_freq_seg_1 = 0;
+	pMsg->center_freq_seg_0 = ch_params->center_freq_seg0;
+	pMsg->center_freq_seg_1 = ch_params->center_freq_seg1;
 	cdf_mem_copy(pMsg->bssid, bssid.bytes, CDF_MAC_ADDR_SIZE);
 	cdf_mem_copy(&pMsg->operational_rateset,
 		&param.operationalRateSet, sizeof(pMsg->operational_rateset));
@@ -18194,7 +18201,7 @@
  * @bssid:          BSSID
  * @target_channel: Channel on which to send the IE
  * @csa_ie_reqd:    Include/Exclude CSA IE.
- * @ch_bandwidth:   Channel offset
+ * @ch_params:  operating Channel related information
  *
  * This function sends request to transmit channel switch announcement
  * IE to lower layers
@@ -18204,7 +18211,7 @@
 CDF_STATUS
 csr_roam_send_chan_sw_ie_request(tpAniSirGlobal mac_ctx,
 		struct cdf_mac_addr bssid, uint8_t target_channel,
-		uint8_t csa_ie_reqd, uint8_t ch_bandwidth)
+		uint8_t csa_ie_reqd, chan_params_t *ch_params)
 {
 	CDF_STATUS status = CDF_STATUS_SUCCESS;
 	tSirDfsCsaIeRequest *msg;
@@ -18221,7 +18228,7 @@
 	msg->targetChannel = target_channel;
 	msg->csaIeRequired = csa_ie_reqd;
 	cdf_mem_copy(msg->bssid, bssid.bytes, CDF_MAC_ADDR_SIZE);
-	msg->ch_bandwidth = ch_bandwidth;
+	cdf_mem_copy(&msg->ch_params, ch_params, sizeof(chan_params_t));
 
 	status = cds_send_mb_message_to_mac(msg);
 
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 8d906c2..4aac03f 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -1922,32 +1922,6 @@
 }
 
 /**
- * wma_get_center_channel() - get center channel
- * @chan: channel number
- * @chan_offset: channel offset
- *
- * Return: center channel
- */
-uint8_t wma_get_center_channel(uint8_t chan, uint8_t chan_offset)
-{
-	uint8_t band_center_chan = 0;
-
-	if ((chan_offset == PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED) ||
-	    (chan_offset == PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW))
-		band_center_chan = chan + 2;
-	else if (chan_offset == PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW)
-		band_center_chan = chan + 6;
-	else if ((chan_offset == PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH) ||
-		 (chan_offset ==
-		  PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED))
-		band_center_chan = chan - 2;
-	else if (chan_offset == PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH)
-		band_center_chan = chan - 6;
-
-	return band_center_chan;
-}
-
-/**
  * wma_vdev_start() - send vdev start request to fw
  * @wma: wma handle
  * @req: vdev start params