diff --git a/cfg/inc/cfg_converged.h b/cfg/inc/cfg_converged.h index 117828faf4..7b46f39872 100644 --- a/cfg/inc/cfg_converged.h +++ b/cfg/inc/cfg_converged.h @@ -23,8 +23,10 @@ #ifndef __CFG_CONVERGED_H #define __CFG_CONVERGED_H +#include + #define CFG_CONVERGED_ALL \ - /* i.e. CFG_SCAN_ALL etc. */ + CFG_SCAN_ALL #endif /* __CFG_CONVERGED_H */ diff --git a/umac/scan/dispatcher/inc/wlan_scan_cfg.h b/umac/scan/dispatcher/inc/wlan_scan_cfg.h new file mode 100644 index 0000000000..b81845bb26 --- /dev/null +++ b/umac/scan/dispatcher/inc/wlan_scan_cfg.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2012-2018 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 + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * DOC: This file contains centralized definitions of SCAN component + */ +#ifndef __CONFIG_SCAN_H +#define __CONFIG_SCAN_H + +#include "cfg_define.h" + +#define CFG_ACTIVE_MAX_CHANNEL_TIME CFG_INI_UINT(\ + "gActiveMaxChannelTime",\ + 0, 10000, 40,\ + CFG_VALUE_OR_DEFAULT, "active dwell time") + +#define CFG_PASSIVE_MAX_CHANNEL_TIME CFG_INI_UINT(\ + "gPassiveMaxChannelTime",\ + 0, 10000, 100,\ + CFG_VALUE_OR_DEFAULT, "passive dwell time") + +#define CFG_SCAN_ALL \ + CFG(CFG_ACTIVE_MAX_CHANNEL_TIME) \ + CFG(CFG_PASSIVE_MAX_CHANNEL_TIME) + +#endif diff --git a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h index e9b9bb50c4..79be46a9ec 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h @@ -605,4 +605,43 @@ void ucfg_scan_set_vdev_del_in_progress(struct wlan_objmgr_vdev *vdev); * Return: none */ void ucfg_scan_clear_vdev_del_in_progress(struct wlan_objmgr_vdev *vdev); + +/** + * wlan_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwell time + * + * Return: none + */ +void wlan_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time); +/** + * wlan_scan_cfg_get_active_dwelltime() - API to get active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwelltime + * + * Return: scan active dwell time + */ +void wlan_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time); + +/** + * wlan_scan_cfg_set_passive_dwelltime() - API to set scan active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwell time + * + * Return: none + */ +void wlan_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time); +/** + * wlan_scan_cfg_get_passive_dwelltime() - API to get active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwelltime + * + * Return: scan active dwell time + */ +void wlan_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time); + #endif diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index 0cbfba94e1..d8841693db 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -40,6 +40,7 @@ #include #include #endif +#include "cfg_ucfg_api.h" QDF_STATUS ucfg_scan_register_bcn_cb(struct wlan_objmgr_psoc *psoc, update_beacon_cb cb, enum scan_cb_type type) @@ -1334,14 +1335,73 @@ ucfg_scan_register_event_handler(struct wlan_objmgr_pdev *pdev, return QDF_STATUS_SUCCESS; } +void wlan_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) { + scm_err("Failed to get scan object"); + return; + } + + *dwell_time = scan_obj->scan_def.passive_dwell; +} + +void wlan_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) { + scm_err("Failed to get scan object"); + return; + } + + scan_obj->scan_def.passive_dwell = dwell_time; +} + +void wlan_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) { + scm_err("Failed to get scan object"); + return; + } + + *dwell_time = scan_obj->scan_def.active_dwell; +} + +void wlan_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) { + scm_err("Failed to get scan object"); + return; + } + + scan_obj->scan_def.active_dwell = dwell_time; +} + static QDF_STATUS -wlan_scan_global_init(struct wlan_scan_obj *scan_obj) +wlan_scan_global_init(struct wlan_objmgr_psoc *psoc, + struct wlan_scan_obj *scan_obj) { scan_obj->enable_scan = true; scan_obj->drop_bcn_on_chan_mismatch = true; scan_obj->disable_timeout = false; - scan_obj->scan_def.active_dwell = SCAN_ACTIVE_DWELL_TIME; - scan_obj->scan_def.passive_dwell = SCAN_PASSIVE_DWELL_TIME; + scan_obj->scan_def.active_dwell = + cfg_get(psoc, CFG_ACTIVE_MAX_CHANNEL_TIME); + scan_obj->scan_def.passive_dwell = + cfg_get(psoc, CFG_PASSIVE_MAX_CHANNEL_TIME); scan_obj->scan_def.max_rest_time = SCAN_MAX_REST_TIME; scan_obj->scan_def.sta_miracast_mcc_rest_time = SCAN_STA_MIRACAST_MCC_REST_TIME; @@ -1837,7 +1897,6 @@ QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc, } scan_def = &scan_obj->scan_def; - scan_def->active_dwell = scan_cfg->active_dwell; scan_def->passive_dwell = scan_cfg->passive_dwell; scan_def->conc_active_dwell = scan_cfg->conc_active_dwell; scan_def->conc_passive_dwell = scan_cfg->conc_passive_dwell; @@ -2001,7 +2060,7 @@ ucfg_scan_psoc_open(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_FAILURE; } /* Initialize the scan Globals */ - wlan_scan_global_init(scan_obj); + wlan_scan_global_init(psoc, scan_obj); qdf_spinlock_create(&scan_obj->lock); ucfg_scan_register_pmo_handler(); scm_db_init(psoc);