Sfoglia il codice sorgente

qcacld-3.0: Refactor two INI about channel bonding

Based on new cfg framework, refactor below WNI/INI:
 - CFG_CHANNEL_BONDING_MODE_24GHZ_NAME
 - CFG_CHANNEL_BONDING_MODE_5GHZ_NAME

Change-Id: Ia18fd79738a8079c41df557934335e54c8016e43
CRs-Fixed: 2381831
Wu Gao 6 anni fa
parent
commit
ed616a1a50

+ 4 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -906,6 +906,10 @@ static void mlme_init_feature_flag_in_cfg(
 	feature_flags->mcc_bcast_prob_rsp = cfg_get(psoc,
 						    CFG_FW_MCC_BCAST_PROB_RESP);
 	feature_flags->enable_mcc = cfg_get(psoc, CFG_MCC_FEATURE);
+	feature_flags->channel_bonding_mode_24ghz =
+			cfg_get(psoc, CFG_CHANNEL_BONDING_MODE_24GHZ);
+	feature_flags->channel_bonding_mode_5ghz =
+			cfg_get(psoc, CFG_CHANNEL_BONDING_MODE_5GHZ);
 }
 
 static void mlme_init_sap_protection_cfg(struct wlan_objmgr_psoc *psoc,

+ 54 - 2
components/mlme/dispatcher/inc/cfg_mlme_feature_flag.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -158,6 +158,56 @@
 		CFG_VALUE_OR_DEFAULT, \
 		"Enable/Disable MCC feature.")
 
+/*
+ * <ini>
+ * gChannelBondingMode24GHz - Configures Channel Bonding in 24 GHz
+ * @Min: 0
+ * @Max: 10
+ * @Default: 0
+ *
+ * This ini is used to set default channel bonding mode 24GHZ
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_CHANNEL_BONDING_MODE_24GHZ CFG_INI_UINT( \
+	"gChannelBondingMode24GHz", \
+	0, \
+	10, \
+	0, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Configures Channel Bonding in 24 GHz")
+
+/*
+ * <ini>
+ * gChannelBondingMode5GHz - Configures Channel Bonding in 5 GHz
+ * @Min: 0
+ * @Max: 10
+ * @Default: 0
+ *
+ * This ini is used to set default channel bonding mode 5GHZ
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_CHANNEL_BONDING_MODE_5GHZ CFG_INI_UINT( \
+	"gChannelBondingMode5GHz", \
+	0, \
+	10, \
+	0, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Configures Channel Bonding in 5 GHz")
+
 #define CFG_FEATURE_FLAG_ALL \
 	CFG(CFG_ACCEPT_SHORT_SLOT_ASSOC_ONLY) \
 	CFG(CFG_HCF_ENABLED) \
@@ -169,7 +219,9 @@
 	CFG(CFG_11G_SHORT_SLOT_TIME_ENABLED) \
 	CFG(CFG_CHANNEL_BONDING_MODE) \
 	CFG(CFG_BLOCK_ACK_ENABLED) \
-	CFG(CFG_ENABLE_AMPDUPS)
+	CFG(CFG_ENABLE_AMPDUPS) \
+	CFG(CFG_CHANNEL_BONDING_MODE_24GHZ) \
+	CFG(CFG_CHANNEL_BONDING_MODE_5GHZ)
 
 #endif /* __CFG_MLME_FEATURE_FLAG_H */
 

+ 9 - 2
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -893,11 +893,16 @@ struct wlan_mlme_rates {
  * @enable_hcf: enable HCF feature
  * @enable_rsn: enable RSN for connection
  * @enable_short_preamble_11g: enable short preamble for 11g
+ * @enable_short_slot_time_11g
+ * @enable_ampdu: enable AMPDU feature
+ * @enable_mcc: enable MCC feature
+ * @mcc_rts_cts_prot: RTS-CTS protection in MCC
+ * @mcc_bcast_prob_rsp: broadcast Probe Response in MCC
  * @channel_bonding_mode: channel bonding mode
  * @enable_block_ack: enable block ack feature
- * @enable_ampdu: Enable AMPDU feature
+ * @channel_bonding_mode_24ghz: configures Channel Bonding in 24 GHz
+ * @channel_bonding_mode_5ghz:  configures Channel Bonding in 5 GHz
  */
-
 struct wlan_mlme_feature_flag {
 	bool accept_short_slot_assoc;
 	bool enable_hcf;
@@ -910,6 +915,8 @@ struct wlan_mlme_feature_flag {
 	uint8_t mcc_bcast_prob_rsp;
 	uint32_t channel_bonding_mode;
 	uint32_t enable_block_ack;
+	uint32_t channel_bonding_mode_24ghz;
+	uint32_t channel_bonding_mode_5ghz;
 };
 
 /*

+ 43 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -3565,4 +3565,47 @@ ucfg_mlme_set_obss_detection_offload_enabled(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 ucfg_mlme_set_obss_color_collision_offload_enabled(
 		struct wlan_objmgr_psoc *psoc, uint8_t value);
+
+/**
+ * ucfg_mlme_get_channel_bonding_24ghz() - get channel bonding mode of 24ghz
+ * @psoc:   pointer to psoc object
+ * @value:  pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
+				    uint32_t *value);
+
+/**
+ * ucfg_mlme_set_channel_bonding_24ghz() - set channel bonding mode for 24ghz
+ * @psoc:   pointer to psoc object
+ * @value:  channel bonding mode
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_set_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
+				    uint32_t value);
+/**
+ * ucfg_mlme_get_channel_bonding_5ghz() - get channel bonding mode of 5ghz
+ * @psoc:   pointer to psoc object
+ * @value:  pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
+				   uint32_t *value);
+
+/**
+ * ucfg_mlme_set_channel_bonding_5ghz() - set channel bonding mode for 5ghz
+ * @psoc:   pointer to psoc object
+ * @value:    channel bonding mode
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_mlme_set_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
+				   uint32_t value);
 #endif /* _WLAN_MLME_UCFG_API_H_ */

+ 63 - 0
components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -1534,3 +1534,66 @@ ucfg_mlme_set_obss_color_collision_offload_enabled(
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS
+ucfg_mlme_get_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
+				    uint32_t *val)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*val = cfg_default(CFG_CHANNEL_BONDING_MODE_24GHZ);
+		return QDF_STATUS_E_INVAL;
+	}
+	*val = mlme_obj->cfg.feature_flags.channel_bonding_mode_24ghz;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_set_channel_bonding_24ghz(struct wlan_objmgr_psoc *psoc,
+				    uint32_t value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_INVAL;
+
+	mlme_obj->cfg.feature_flags.channel_bonding_mode_24ghz = value;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
+				   uint32_t *value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*value = cfg_default(CFG_CHANNEL_BONDING_MODE_5GHZ);
+		return QDF_STATUS_E_INVAL;
+	}
+	*value = mlme_obj->cfg.feature_flags.channel_bonding_mode_5ghz;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_mlme_set_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc,
+				   uint32_t value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_INVAL;
+
+	mlme_obj->cfg.feature_flags.channel_bonding_mode_5ghz = value;
+
+	return QDF_STATUS_SUCCESS;
+}
+

+ 0 - 48
core/hdd/inc/wlan_hdd_cfg.h

@@ -115,52 +115,6 @@ enum hdd_dot11_mode {
 	eHDD_DOT11_MODE_11ax,
 };
 
-/*
- * <ini>
- * gChannelBondingMode24GHz - Configures Channel Bonding in 24 GHz
- * @Min: 0
- * @Max: 10
- * @Default: 0
- *
- * This ini is used to set default channel bonding mode 24GHZ
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_CHANNEL_BONDING_MODE_24GHZ_NAME    "gChannelBondingMode24GHz"
-#define CFG_CHANNEL_BONDING_MODE_MIN           WNI_CFG_CHANNEL_BONDING_MODE_STAMIN
-#define CFG_CHANNEL_BONDING_MODE_MAX           WNI_CFG_CHANNEL_BONDING_MODE_STAMAX
-#define CFG_CHANNEL_BONDING_MODE_DEFAULT       WNI_CFG_CHANNEL_BONDING_MODE_STADEF
-
-/*
- * <ini>
- * gChannelBondingMode5GHz - Configures Channel Bonding in 5 GHz
- * @Min: 0
- * @Max: 10
- * @Default: 0
- *
- * This ini is used to set default channel bonding mode 5GHZ
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-
-#define CFG_CHANNEL_BONDING_MODE_5GHZ_NAME     "gChannelBondingMode5GHz"
-#define CFG_CHANNEL_BONDING_MODE_MIN           WNI_CFG_CHANNEL_BONDING_MODE_STAMIN
-#define CFG_CHANNEL_BONDING_MODE_MAX           WNI_CFG_CHANNEL_BONDING_MODE_STAMAX
-#define CFG_CHANNEL_BONDING_MODE_DEFAULT       WNI_CFG_CHANNEL_BONDING_MODE_STADEF
-
 /*
  * <ini>
  * gEnableDFSPnoChnlScan - enable dfs channels in PNO scan
@@ -851,8 +805,6 @@ struct hdd_config {
 	/* Config parameters */
 	bool enable_connected_scan;
 	enum hdd_dot11_mode dot11Mode;
-	uint32_t nChannelBondingMode24GHz;
-	uint32_t nChannelBondingMode5GHz;
 	bool apProtEnabled;
 
 #ifdef FEATURE_WLAN_DYNAMIC_CVM

+ 8 - 16
core/hdd/src/wlan_hdd_cfg.c

@@ -63,20 +63,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_DOT11_MODE_MIN,
 		     CFG_DOT11_MODE_MAX),
 
-	REG_VARIABLE(CFG_CHANNEL_BONDING_MODE_24GHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nChannelBondingMode24GHz,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_CHANNEL_BONDING_MODE_DEFAULT,
-		     CFG_CHANNEL_BONDING_MODE_MIN,
-		     CFG_CHANNEL_BONDING_MODE_MAX),
-
-	REG_VARIABLE(CFG_CHANNEL_BONDING_MODE_5GHZ_NAME, WLAN_PARAM_Integer,
-		     struct hdd_config, nChannelBondingMode5GHz,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_CHANNEL_BONDING_MODE_DEFAULT,
-		     CFG_CHANNEL_BONDING_MODE_MIN,
-		     CFG_CHANNEL_BONDING_MODE_MAX),
-
 	REG_VARIABLE(CFG_AP_ENABLE_PROTECTION_MODE_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, apProtEnabled,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -1743,6 +1729,8 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
 	mac_handle_t mac_handle = hdd_ctx->mac_handle;
 	bool roam_scan_enabled;
 	bool enable_dfs_scan = true;
+	uint32_t channel_bonding_mode;
+
 #ifdef FEATURE_WLAN_ESE
 	bool ese_enabled;
 #endif
@@ -1776,10 +1764,14 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
 		smeConfig->csrConfig.channelBondingMode24GHz = 0;
 		smeConfig->csrConfig.channelBondingMode5GHz = 0;
 	} else {
+		ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
+						    &channel_bonding_mode);
 		smeConfig->csrConfig.channelBondingMode24GHz =
-			pConfig->nChannelBondingMode24GHz;
+			channel_bonding_mode;
+		ucfg_mlme_get_channel_bonding_5ghz(hdd_ctx->psoc,
+						   &channel_bonding_mode);
 		smeConfig->csrConfig.channelBondingMode5GHz =
-			pConfig->nChannelBondingMode5GHz;
+			channel_bonding_mode;
 	}
 	/* Remaining config params not obtained from registry
 	 * On RF EVB beacon using channel 1.

+ 19 - 10
core/hdd/src/wlan_hdd_cfg80211.c

@@ -9380,6 +9380,8 @@ static void hdd_update_acs_sap_config(struct hdd_context *hdd_ctx,
 {
 	uint8_t ch_width;
 	QDF_STATUS status;
+	uint32_t channel_bonding_mode;
+
 	sap_config->channel = channel_list->pri_ch;
 
 	sap_config->ch_params.center_freq_seg0 =
@@ -9397,10 +9399,10 @@ static void hdd_update_acs_sap_config(struct hdd_context *hdd_ctx,
 			hdd_err("Failed to set channel_width");
 		sap_config->ch_width_orig = ch_width;
 	} else {
-		sap_config->ch_width_orig =
-			hdd_ctx->config->nChannelBondingMode24GHz ?
-			eHT_CHANNEL_WIDTH_40MHZ :
-			eHT_CHANNEL_WIDTH_20MHZ;
+		ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
+						    &channel_bonding_mode);
+		sap_config->ch_width_orig = channel_bonding_mode ?
+			eHT_CHANNEL_WIDTH_40MHZ : eHT_CHANNEL_WIDTH_20MHZ;
 	}
 	sap_config->acs_cfg.pri_ch = channel_list->pri_ch;
 	sap_config->acs_cfg.ch_width = channel_list->chan_width;
@@ -12841,10 +12843,6 @@ int wlan_hdd_cfg80211_init(struct device *dev,
 		wiphy->iface_combinations = wlan_hdd_iface_combination;
 	}
 
-	if (!pCfg->nChannelBondingMode5GHz)
-		wlan_hdd_band_5_ghz.ht_cap.cap &=
-			~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
-
 	/*
 	 * In case of static linked driver at the time of driver unload,
 	 * module exit doesn't happens. Module cleanup helps in cleaning
@@ -13003,6 +13001,7 @@ static void wlan_hdd_update_ht_cap(struct hdd_context *hdd_ctx)
 {
 	struct mlme_ht_capabilities_info ht_cap_info = {0};
 	QDF_STATUS status;
+	uint32_t channel_bonding_mode;
 
 	status = ucfg_mlme_get_ht_cap_info(hdd_ctx->psoc, &ht_cap_info);
 	if (QDF_STATUS_SUCCESS != status)
@@ -13033,6 +13032,11 @@ static void wlan_hdd_update_ht_cap(struct hdd_context *hdd_ctx)
 
 	if (!ht_cap_info.short_gi_40_mhz)
 		wlan_hdd_band_5_ghz.ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
+
+	ucfg_mlme_get_channel_bonding_5ghz(hdd_ctx->psoc, &channel_bonding_mode);
+	if (!channel_bonding_mode)
+		wlan_hdd_band_5_ghz.ht_cap.cap &=
+			~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
 }
 
 /**
@@ -15736,6 +15740,7 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
 	uint8_t wmm_mode = 0;
 	uint8_t value = 0;
 	struct wlan_objmgr_vdev *vdev;
+	uint32_t channel_bonding_mode;
 
 	hdd_enter();
 
@@ -16004,10 +16009,14 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
 		 * cb mode. So, restoring the default INI params before starting
 		 * interfaces such as sta, cli etc.,
 		 */
+		ucfg_mlme_get_channel_bonding_5ghz(hdd_ctx->psoc,
+						   &channel_bonding_mode);
 		sme_config->csrConfig.channelBondingMode5GHz =
-			hdd_ctx->config->nChannelBondingMode5GHz;
+			channel_bonding_mode;
+		ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
+						    &channel_bonding_mode);
 		sme_config->csrConfig.channelBondingMode24GHz =
-			hdd_ctx->config->nChannelBondingMode24GHz;
+			channel_bonding_mode;
 		sme_update_config(mac_handle, sme_config);
 		qdf_mem_free(sme_config);
 		/*

+ 4 - 1
core/hdd/src/wlan_hdd_hostapd.c

@@ -4301,6 +4301,7 @@ static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter)
 	QDF_STATUS status;
 	bool sap_force_11n_for_11ac = 0;
 	bool go_force_11n_for_11ac = 0;
+	uint32_t channel_bonding_mode;
 
 	ucfg_mlme_get_sap_force_11n_for_11ac(hdd_ctx->psoc,
 					     &sap_force_11n_for_11ac);
@@ -4358,8 +4359,10 @@ static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter)
 			 * supplicant after OBSS scan and if 2.4 Ghz channel
 			 * bonding is set in INI
 			 */
+			ucfg_mlme_get_channel_bonding_24ghz(
+				hdd_ctx->psoc, &channel_bonding_mode);
 			if (sap_cfg->ch_width_orig >= eHT_CHANNEL_WIDTH_40MHZ &&
-			   hdd_ctx->config->nChannelBondingMode24GHz)
+			    channel_bonding_mode)
 				sap_cfg->ch_width_orig =
 					eHT_CHANNEL_WIDTH_40MHZ;
 			else

+ 11 - 3
core/hdd/src/wlan_hdd_main.c

@@ -7594,6 +7594,7 @@ static int hdd_wiphy_init(struct hdd_context *hdd_ctx)
 {
 	struct wiphy *wiphy;
 	int ret_val;
+	uint32_t channel_bonding_mode;
 
 	wiphy = hdd_ctx->wiphy;
 
@@ -7624,9 +7625,11 @@ static int hdd_wiphy_init(struct hdd_context *hdd_ctx)
 	wiphy->wowlan.pattern_min_len = WOW_MIN_PATTERN_SIZE;
 	wiphy->wowlan.pattern_max_len = WOW_MAX_PATTERN_SIZE;
 #endif
+	ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
+					    &channel_bonding_mode);
 	if (hdd_ctx->obss_scan_offload) {
 		hdd_debug("wmi_service_obss_scan supported");
-	} else if (hdd_ctx->config->nChannelBondingMode24GHz) {
+	} else if (channel_bonding_mode) {
 		hdd_debug("enable wpa_supp obss_scan");
 		wiphy->features |= NL80211_FEATURE_NEED_OBSS_SCAN;
 	}
@@ -14466,6 +14469,7 @@ QDF_STATUS hdd_update_score_config(
 	QDF_STATUS status;
 	struct wlan_mlme_nss_chains vdev_ini_cfg;
 	bool bval = false;
+	uint32_t channel_bonding_mode;
 
 	qdf_mem_zero(&vdev_ini_cfg, sizeof(struct wlan_mlme_nss_chains));
 	/* Populate the nss chain params from ini for this vdev type */
@@ -14478,8 +14482,12 @@ QDF_STATUS hdd_update_score_config(
 
 	sme_update_score_config(hdd_ctx->mac_handle, score_config);
 
-	score_config->cb_mode_24G = cfg->nChannelBondingMode24GHz;
-	score_config->cb_mode_5G = cfg->nChannelBondingMode5GHz;
+	ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
+					    &channel_bonding_mode);
+	score_config->cb_mode_24G = channel_bonding_mode;
+	ucfg_mlme_get_channel_bonding_5ghz(hdd_ctx->psoc,
+					   &channel_bonding_mode);
+	score_config->cb_mode_5G = channel_bonding_mode;
 
 	if (cfg->dot11Mode == eHDD_DOT11_MODE_AUTO ||
 	    cfg->dot11Mode == eHDD_DOT11_MODE_11ax ||

+ 21 - 11
core/hdd/src/wlan_hdd_wext.c

@@ -3698,20 +3698,23 @@ int wlan_hdd_update_phymode(struct hdd_adapter *adapter, int new_phymode)
 	int retval = 0;
 	uint8_t band_capability;
 	QDF_STATUS status;
+	uint32_t channel_bonding_mode;
 
 	if (!mac_handle)
 		return -EINVAL;
 
 	old_phymode = sme_get_phy_mode(mac_handle);
 
+	ucfg_mlme_get_channel_bonding_24ghz(phddctx->psoc,
+					    &channel_bonding_mode);
 	if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE !=
-	    sme_get_cb_phy_state_from_cb_ini_value(phddctx->config->
-						   nChannelBondingMode24GHz))
+	    sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode))
 		ch_bond24 = true;
 
+	ucfg_mlme_get_channel_bonding_5ghz(phddctx->psoc,
+					   &channel_bonding_mode);
 	if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE !=
-	    sme_get_cb_phy_state_from_cb_ini_value(phddctx->config->
-						   nChannelBondingMode5GHz))
+	    sme_get_cb_phy_state_from_cb_ini_value(channel_bonding_mode))
 		ch_bond5g = true;
 
 	status = wlan_mlme_get_band_capability(phddctx->psoc, &band_capability);
@@ -3979,10 +3982,12 @@ int wlan_hdd_update_phymode(struct hdd_adapter *adapter, int new_phymode)
 		sme_update_config(mac_handle, sme_config);
 
 		phddctx->config->dot11Mode = hdd_dot11mode;
-		phddctx->config->nChannelBondingMode24GHz =
-			sme_config->csrConfig.channelBondingMode24GHz;
-		phddctx->config->nChannelBondingMode5GHz =
-			sme_config->csrConfig.channelBondingMode5GHz;
+		ucfg_mlme_set_channel_bonding_24ghz(
+			phddctx->psoc,
+			sme_config->csrConfig.channelBondingMode24GHz);
+		ucfg_mlme_set_channel_bonding_5ghz(
+			phddctx->psoc,
+			sme_config->csrConfig.channelBondingMode5GHz);
 		if (hdd_update_config_cfg(phddctx) == false) {
 			hdd_err("could not update config_dat");
 			retval = -EIO;
@@ -3992,8 +3997,10 @@ int wlan_hdd_update_phymode(struct hdd_adapter *adapter, int new_phymode)
 		if (band_5g) {
 			struct ieee80211_supported_band *band;
 
+			ucfg_mlme_get_channel_bonding_5ghz(
+					phddctx->psoc, &channel_bonding_mode);
 			band = phddctx->wiphy->bands[HDD_NL80211_BAND_5GHZ];
-			if (phddctx->config->nChannelBondingMode5GHz)
+			if (channel_bonding_mode)
 				band->ht_cap.cap |=
 					IEEE80211_HT_CAP_SUP_WIDTH_20_40;
 			else
@@ -4052,6 +4059,7 @@ static int hdd_we_set_ch_width(struct hdd_adapter *adapter, int ch_width)
 	uint32_t bonding_mode;
 	tSmeConfigParams *sme_config;
 	mac_handle_t mac_handle;
+	uint32_t channel_bonding_mode;
 
 	mac_handle = hdd_ctx->mac_handle;
 	if (!mac_handle)
@@ -4067,13 +4075,15 @@ static int hdd_we_set_ch_width(struct hdd_adapter *adapter, int ch_width)
 
 	case eHT_CHANNEL_WIDTH_40MHZ:
 	case eHT_CHANNEL_WIDTH_80MHZ:
+		ucfg_mlme_get_channel_bonding_5ghz(hdd_ctx->psoc,
+						   &channel_bonding_mode);
 		bonding_state = csr_convert_cb_ini_value_to_phy_cb_state(
-			hdd_ctx->config->nChannelBondingMode5GHz);
+			channel_bonding_mode);
 
 		if (bonding_state == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE)
 			return -EINVAL;
 
-		bonding_mode = hdd_ctx->config->nChannelBondingMode5GHz;
+		bonding_mode = channel_bonding_mode;
 		break;
 
 	default:

+ 0 - 4
core/mac/inc/wni_cfg.h

@@ -78,10 +78,6 @@ enum {
 #define WNI_CFG_ADMIT_POLICY_REJECT_ALL    1
 #define WNI_CFG_ADMIT_POLICY_BW_FACTOR    2
 
-#define WNI_CFG_CHANNEL_BONDING_MODE_STAMIN    0
-#define WNI_CFG_CHANNEL_BONDING_MODE_STAMAX    10
-#define WNI_CFG_CHANNEL_BONDING_MODE_STADEF    0
-
 #define WNI_CFG_CHANNEL_BONDING_MODE_DISABLE    0
 #define WNI_CFG_CHANNEL_BONDING_MODE_ENABLE    1