diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index 7edbf61f8b..f40c7a778a 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -359,6 +359,8 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_ENABLE_BEACON_RECEPTION_STATS);
gen->enable_remove_time_stamp_sync_cmd =
cfg_get(psoc, CFG_REMOVE_TIME_STAMP_SYNC_CMD);
+ gen->enable_change_channel_bandwidth =
+ cfg_get(psoc, CFG_CHANGE_CHANNEL_BANDWIDTH);
}
static void mlme_init_edca_ani_cfg(struct wlan_mlme_edca_params *edca_params)
diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h
index d06b1ba761..7e1574c5a0 100644
--- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h
+++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h
@@ -595,6 +595,36 @@
0, \
"Enable to remove time stamp sync cmd")
+/*
+ *
+ * gEnableChangeChannelBandWidth Enable/Disable change
+ * channel&bandwidth in the mission mode
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * 0 not allow change channel&bandwidth by setMonChan
+ * 1 allow change channel&bandwidth by setMonChan
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: External
+ *
+ *
+ */
+#ifdef FEATURE_MONITOR_MODE_SUPPORT
+#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT true
+#else
+#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT false
+#endif
+
+#define CFG_CHANGE_CHANNEL_BANDWIDTH CFG_INI_BOOL( \
+ "gEnableChangeChannelBandWidth", \
+ CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT, \
+ "enable change channel bw")
+
#define CFG_GENERIC_ALL \
CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \
CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \
@@ -620,6 +650,7 @@
CFG(CFG_DROPPED_PKT_DISCONNECT_THRESHOLD) \
CFG(CFG_ITO_REPEAT_COUNT) \
CFG(CFG_ENABLE_BEACON_RECEPTION_STATS) \
- CFG(CFG_REMOVE_TIME_STAMP_SYNC_CMD)
+ CFG(CFG_REMOVE_TIME_STAMP_SYNC_CMD) \
+ CFG(CFG_CHANGE_CHANNEL_BANDWIDTH)
#endif /* __CFG_MLME_GENERIC_H */
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h
index a20f753980..35814ea033 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h
@@ -1975,6 +1975,16 @@ QDF_STATUS wlan_mlme_ibss_power_save_setup(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
wlan_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value);
+/**
+ * wlan_mlme_is_change_channel_bandwidth_enabled() - get the
+ * enable_change_channel_bandwidth flag
+ * @psoc: psoc context
+ *
+ * Return: true if enabled
+ */
+bool
+wlan_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc);
+
/**
* wlan_mlme_get_sta_miracast_mcc_rest_time() - Get STA/MIRACAST MCC rest time
*
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
index b92767e1c3..5c92fd42cd 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
@@ -996,6 +996,8 @@ struct wlan_mlme_chainmask {
* @enabled_11d: enable 11d flag
* @enable_beacon_reception_stats: enable beacon reception stats
* @enable_remove_time_stamp_sync_cmd: Enable remove time stamp sync cmd
+ * @enable_change_channel_bandwidth: enable/disable change channel bw in mission
+ * mode
*/
struct wlan_mlme_generic {
enum band_info band_capability;
@@ -1024,6 +1026,7 @@ struct wlan_mlme_generic {
bool enable_deauth_to_disassoc_map;
bool enable_beacon_reception_stats;
bool enable_remove_time_stamp_sync_cmd;
+ bool enable_change_channel_bandwidth;
};
/*
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
index 47d4d0654f..4383fd29a2 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -2521,6 +2521,19 @@ ucfg_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value)
return wlan_mlme_set_11d_enabled(psoc, value);
}
+/**
+ * ucfg_mlme_is_change_channel_bandwidth_enabled() - ucfg api to get the
+ * enable_change_channel_bandwidth flag
+ * @psoc: psoc context
+ *
+ * Return: true if enabled
+ */
+static inline bool
+ucfg_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc)
+{
+ return wlan_mlme_is_change_channel_bandwidth_enabled(psoc);
+}
+
/**
* ucfg_mlme_get_opr_rate_set() - Get operational rate set
* @psoc: pointer to psoc object
diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c
index 3436e70348..ab15430eb2 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_api.c
@@ -2387,6 +2387,19 @@ wlan_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value)
return QDF_STATUS_SUCCESS;
}
+
+bool
+wlan_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj;
+
+ mlme_obj = mlme_get_psoc_obj(psoc);
+ if (!mlme_obj)
+ return cfg_default(CFG_CHANGE_CHANNEL_BANDWIDTH);
+
+ return mlme_obj->cfg.gen.enable_change_channel_bandwidth;
+}
+
QDF_STATUS
wlan_mlme_cfg_set_vht_chan_width(struct wlan_objmgr_psoc *psoc, uint8_t value)
{
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 6390b1b8d3..7ffb1c137e 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -96,36 +96,6 @@ enum hdd_dot11_mode {
eHDD_DOT11_MODE_11ax,
};
-/*
- *
- * extscan_adaptive_dwell_mode - Enable adaptive dwell mode
- * during ext scan
- * @Min: 0
- * @Max: 4
- * @Default: 1
- *
- * This ini will set the algo used in dwell time optimization
- * during ext scan. see enum scan_dwelltime_adaptive_mode.
- * Acceptable values for this:
- * 0: Default (Use firmware default mode)
- * 1: Conservative optimization
- * 2: Moderate optimization
- * 3: Aggressive optimization
- * 4: Static
- *
- * Related: None
- *
- * Supported Feature: Scan
- *
- * Usage: External
- *
- *
- */
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_NAME "extscan_adaptive_dwell_mode"
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MIN (0)
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MAX (4)
-#define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_DEFAULT (1)
-
/*
*
* gDot11Mode - SAP phy mode
@@ -223,34 +193,6 @@ enum hdd_dot11_mode {
#endif
-/*
- *
- * gEnableChangeChannelBandWidth - Enable/Disable change
- * channel&bandwidth in the mission mode
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * 0 - not allow change channel&bandwidth by setMonChan
- * 1 - allow change channel&bandwidth by setMonChan
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: External
- *
- *
- */
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_NAME "gEnableChangeChannelBandWidth"
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_MIN (0)
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_MAX (1)
-#ifdef FEATURE_MONITOR_MODE_SUPPORT
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT (1)
-#else
-#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT (0)
-#endif
-
/*
* Type declarations
*/
@@ -277,7 +219,6 @@ struct hdd_config {
uint8_t dhcpServerIP[IPADDR_STRING_LENGTH];
#endif /* DHCP_SERVER_OFFLOAD */
bool apf_enabled;
- enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode;
uint16_t sap_tx_leakage_threshold;
bool sap_internal_restart;
bool tx_orphan_enable;
@@ -285,7 +226,6 @@ struct hdd_config {
bool action_oui_enable;
uint8_t action_oui_str[ACTION_OUI_MAXIMUM_ID][ACTION_OUI_MAX_STR_LEN];
bool is_unit_test_framework_enabled;
- bool enable_change_channel_bandwidth;
/* HDD converged ini items are listed below this*/
bool bug_on_reinit_failure;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 486306c358..02d27e9513 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -77,20 +77,6 @@ struct reg_table_entry g_registry_table[] = {
(void *)CFG_DHCP_SERVER_IP_DEFAULT),
#endif /* DHCP_SERVER_OFFLOAD */
- REG_VARIABLE(CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_NAME, WLAN_PARAM_Integer,
- struct hdd_config, extscan_adaptive_dwell_mode,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_DEFAULT,
- CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MIN,
- CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MAX),
-
- REG_VARIABLE(CFG_CHANGE_CHANNEL_BANDWIDTH_NAME,
- WLAN_PARAM_Integer,
- struct hdd_config, enable_change_channel_bandwidth,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT,
- CFG_CHANGE_CHANNEL_BANDWIDTH_MIN,
- CFG_CHANGE_CHANNEL_BANDWIDTH_MAX),
};
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index f94999ccf7..ca89ac7262 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -15434,7 +15434,7 @@ void hdd_select_cbmode(struct hdd_adapter *adapter, uint8_t operationChannel,
sec_ch, ch_params);
if (adapter->device_mode == QDF_STA_MODE &&
- hdd_ctx->config->enable_change_channel_bandwidth) {
+ ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc)) {
connstate = station_ctx->conn_info.connState;
if (!(eConnectionState_Associated == connstate ||
eConnectionState_Connecting == connstate)) {
diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c
index e588e07ba1..9779107abc 100644
--- a/core/hdd/src/wlan_hdd_ext_scan.c
+++ b/core/hdd/src/wlan_hdd_ext_scan.c
@@ -3150,7 +3150,7 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
nla_get_u32(tb[id]));
params->extscan_adaptive_dwell_mode =
- hdd_ctx->config->extscan_adaptive_dwell_mode;
+ ucfg_scan_get_extscan_adaptive_dwell_mode(hdd_ctx->psoc);
hdd_debug("Configuration flags: %u",
params->configuration_flags);
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 11b5283d71..5a28ffb4e5 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -6432,7 +6432,7 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan,
return -EINVAL;
}
if (adapter->device_mode == QDF_STA_MODE &&
- hdd_ctx->config->enable_change_channel_bandwidth) {
+ ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc)) {
connstate = sta_ctx->conn_info.connState;
if (eConnectionState_Associated == connstate ||
eConnectionState_Connecting == connstate) {
@@ -6473,7 +6473,7 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan,
roam_profile.phyMode = ch_info->phy_mode;
roam_profile.ch_params.ch_width = bandwidth;
hdd_select_cbmode(adapter, chan, &roam_profile.ch_params);
- if (hdd_ctx->config->enable_change_channel_bandwidth &&
+ if (ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc) &&
(!sme_find_session_by_bssid(mac_handle, adapter->mac_addr.bytes))) {
status = sme_create_mon_session(mac_handle,
adapter->mac_addr.bytes,