From 257a9483f611e058da2985fe6dc47893deea2ef6 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Mon, 6 Mar 2017 16:52:39 +0530 Subject: [PATCH] qcacld-3.0: Add support to update the def scan params from INI file Add support to update the scan params depending on the values in INI file Change-Id: Idebc7e6c02bc6a7405b33a9f99c1e5186341c494 CRs-Fixed: 2013212 --- core/hdd/src/wlan_hdd_main.c | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 61e0195a312b..3efd39d2a40c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10643,11 +10643,53 @@ static int hdd_update_pmo_config(hdd_context_t *hdd_ctx) return 0; } +#ifdef NAPIER_SCAN +/** + * hdd_update_scan_config - API to update scan configuration parameters + * @hdd_ctx: HDD context + * + * Return: 0 if success else err + */ +static int hdd_update_scan_config(hdd_context_t *hdd_ctx) +{ + struct wlan_objmgr_psoc *psoc = hdd_ctx->hdd_psoc; + struct scan_user_cfg scan_cfg; + struct hdd_config *cfg = hdd_ctx->config; + QDF_STATUS status; + + scan_cfg.active_dwell = cfg->nActiveMaxChnTime; + scan_cfg.passive_dwell = cfg->nPassiveMaxChnTime; + scan_cfg.conc_active_dwell = cfg->nActiveMaxChnTimeConc; + scan_cfg.conc_passive_dwell = cfg->nPassiveMaxChnTimeConc; + scan_cfg.conc_max_rest_time = cfg->nRestTimeConc; + scan_cfg.conc_min_rest_time = cfg->min_rest_time_conc; + scan_cfg.conc_idle_time = cfg->idle_time_conc; + scan_cfg.scan_cache_aging_time = cfg->scanAgingTimeout; + scan_cfg.scan_dwell_time_mode = cfg->scan_adaptive_dwell_mode; + + status = ucfg_scan_update_user_config(psoc, &scan_cfg); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("failed pmo psoc configuration"); + return -EINVAL; + } + + return 0; +} +#else +static int hdd_update_scan_config(hdd_context_t *hdd_ctx) +{ + return 0; +} +#endif + int hdd_update_components_config(hdd_context_t *hdd_ctx) { int ret; ret = hdd_update_pmo_config(hdd_ctx); + if (ret) + return ret; + ret = hdd_update_scan_config(hdd_ctx); return ret; }