diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index ba1f61b4c53f..ea7bdc87295d 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -7044,52 +7044,6 @@ enum hdd_link_speed_rpt_type {
#define CFG_5G_MAX_RSSI_PENALIZE_MAX (20)
#define CFG_5G_MAX_RSSI_PENALIZE_DEFAULT (10)
-/*
- *
- * g_max_sched_scan_plan_int - pno sched max scan plan interval.
- * @Min: 1
- * @Max: 7200
- * @Default: 3600
- *
- * This ini is used to set max sched scan plan interval for pno scan
- * (value in seconds).
- *
- * Related: gPNOScanSupport
- *
- * Supported Feature: PNO scan
- *
- * Usage: External
- *
- *
- */
-#define CFG_MAX_SCHED_SCAN_PLAN_INT_NAME "g_max_sched_scan_plan_int"
-#define CFG_MAX_SCHED_SCAN_PLAN_INT_MIN (1)
-#define CFG_MAX_SCHED_SCAN_PLAN_INT_MAX (7200)
-#define CFG_MAX_SCHED_SCAN_PLAN_INT_DEFAULT (3600)
-
-/*
- *
- * g_max_sched_scan_plan_iterations - pno sched max scan plan iterations.
- * @Min: 1
- * @Max: 100
- * @Default: 10
- *
- * This ini is used to set max sched scan plan iterations for pno scan
- * (value in seconds).
- *
- * Related: gPNOScanSupport
- *
- * Supported Feature: PNO scan
- *
- * Usage: External
- *
- *
- */
-#define CFG_MAX_SCHED_SCAN_PLAN_ITRNS_NAME "g_max_sched_scan_plan_iterations"
-#define CFG_MAX_SCHED_SCAN_PLAN_ITRNS_MIN (1)
-#define CFG_MAX_SCHED_SCAN_PLAN_ITRNS_MAX (100)
-#define CFG_MAX_SCHED_SCAN_PLAN_ITRNS_DEFAULT (10)
-
/*
*
* gPowerUsage - Preferred Power Usage
@@ -9174,8 +9128,6 @@ struct hdd_config {
bool goptimize_chan_avoid_event;
bool fw_timeout_crash;
uint32_t rx_wakelock_timeout;
- uint32_t max_sched_scan_plan_interval;
- uint32_t max_sched_scan_plan_iterations;
bool sap_internal_restart;
enum restart_beaconing_on_ch_avoid_rule
restart_beaconing_on_chan_avoid_event;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 3d26f960ee3e..735cb8968e4d 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -2908,19 +2908,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_RX_WAKELOCK_TIMEOUT_MIN,
CFG_RX_WAKELOCK_TIMEOUT_MAX),
- REG_VARIABLE(CFG_MAX_SCHED_SCAN_PLAN_INT_NAME, WLAN_PARAM_Integer,
- struct hdd_config, max_sched_scan_plan_interval,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_MAX_SCHED_SCAN_PLAN_INT_DEFAULT,
- CFG_MAX_SCHED_SCAN_PLAN_INT_MIN,
- CFG_MAX_SCHED_SCAN_PLAN_INT_MAX),
- REG_VARIABLE(CFG_MAX_SCHED_SCAN_PLAN_ITRNS_NAME, WLAN_PARAM_Integer,
- struct hdd_config, max_sched_scan_plan_iterations,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_MAX_SCHED_SCAN_PLAN_ITRNS_DEFAULT,
- CFG_MAX_SCHED_SCAN_PLAN_ITRNS_MIN,
- CFG_MAX_SCHED_SCAN_PLAN_ITRNS_MAX),
-
REG_VARIABLE(CFG_RESTART_BEACONING_ON_CH_AVOID_NAME, WLAN_PARAM_Integer,
struct hdd_config, restart_beaconing_on_chan_avoid_event,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index f57ea6aae311..b181fb38cf2c 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11825,18 +11825,33 @@ static void wlan_hdd_cfg80211_add_connected_pno_support(struct wiphy *wiphy)
static void hdd_config_sched_scan_plans_to_wiphy(struct wiphy *wiphy,
struct hdd_config *config)
{
+ struct wlan_objmgr_psoc *psoc;
+ struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
+
+ psoc = hdd_ctx->psoc;
+
+ if (!psoc) {
+ hdd_err("Invalid psoc");
+ return;
+ }
+
if (config->configPNOScanSupport) {
hdd_wiphy_set_max_sched_scans(wiphy, 1);
wiphy->max_sched_scan_ssids = SCAN_PNO_MAX_SUPP_NETWORKS;
wiphy->max_match_sets = SCAN_PNO_MAX_SUPP_NETWORKS;
wiphy->max_sched_scan_ie_len = SIR_MAC_MAX_IE_LENGTH;
wiphy->max_sched_scan_plans = SCAN_PNO_MAX_PLAN_REQUEST;
- if (config->max_sched_scan_plan_interval)
- wiphy->max_sched_scan_plan_interval =
- config->max_sched_scan_plan_interval;
- if (config->max_sched_scan_plan_iterations)
- wiphy->max_sched_scan_plan_iterations =
- config->max_sched_scan_plan_iterations;
+
+ /*
+ * Exception: Using cfg_get() here because these two
+ * schedule scan params are used only at this place
+ * to copy to wiphy structure
+ */
+ wiphy->max_sched_scan_plan_interval =
+ cfg_get(psoc, CFG_MAX_SCHED_SCAN_PLAN_INTERVAL);
+
+ wiphy->max_sched_scan_plan_iterations =
+ cfg_get(psoc, CFG_MAX_SCHED_SCAN_PLAN_ITERATIONS);
}
}
#else