From 5957f0030a03c204b558d9afb4e1966e3a0efbec Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Thu, 19 Jul 2018 19:04:18 -0700 Subject: [PATCH] qcacmn: Add concurrent cfg items of scan Add following scan cfg items: CFG_ACTIVE_MAX_CHANNEL_TIME_CONC CFG_MIN_REST_TIME CFG_REST_TIME_CONC CFG_PASSIVE_MAX_CHANNEL_TIME_CONC Change-Id: I5b20ea153269f32b503d6c9cd1667d8086148871 CRs-Fixed: 2364994 --- umac/scan/core/src/wlan_scan_main.h | 14 -- umac/scan/dispatcher/inc/wlan_scan_api.h | 59 ++++++++ umac/scan/dispatcher/inc/wlan_scan_cfg.h | 136 +++++++++++++++++- umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h | 84 +++++++++++ umac/scan/dispatcher/src/wlan_scan_api.c | 72 ++++++++++ umac/scan/dispatcher/src/wlan_scan_ucfg_api.c | 21 ++- 6 files changed, 358 insertions(+), 28 deletions(-) diff --git a/umac/scan/core/src/wlan_scan_main.h b/umac/scan/core/src/wlan_scan_main.h index e0e4d281884b..032623eb4171 100644 --- a/umac/scan/core/src/wlan_scan_main.h +++ b/umac/scan/core/src/wlan_scan_main.h @@ -114,16 +114,9 @@ struct probe_time_dwell_time { #ifdef CONFIG_MCL #define MAX_SCAN_CACHE_SIZE 300 -#define SCAN_ACTIVE_DWELL_TIME 40 -#define SCAN_PASSIVE_DWELL_TIME 110 #define SCAN_MAX_REST_TIME 0 #define SCAN_MIN_REST_TIME 0 #define SCAN_BURST_DURATION 0 -#define SCAN_CONC_ACTIVE_DWELL_TIME 20 -#define SCAN_CONC_PASSIVE_DWELL_TIME 100 -#define SCAN_CONC_IDLE_TIME 25 -#define SCAN_CONC_MAX_REST_TIME 20 -#define SCAN_CONC_MIN_REST_TIME 10 #define SCAN_PROBE_SPACING_TIME 0 #define SCAN_PROBE_DELAY 0 #define SCAN_MAX_SCAN_TIME 30000 @@ -132,16 +125,9 @@ struct probe_time_dwell_time { #define SCAN_CHAN_STATS_EVENT_ENAB (false) #else #define MAX_SCAN_CACHE_SIZE 1024 -#define SCAN_ACTIVE_DWELL_TIME 105 -#define SCAN_PASSIVE_DWELL_TIME 300 #define SCAN_MAX_REST_TIME 0 #define SCAN_MIN_REST_TIME 50 #define SCAN_BURST_DURATION 0 -#define SCAN_CONC_ACTIVE_DWELL_TIME 0 -#define SCAN_CONC_PASSIVE_DWELL_TIME 0 -#define SCAN_CONC_IDLE_TIME 0 -#define SCAN_CONC_MAX_REST_TIME 0 -#define SCAN_CONC_MIN_REST_TIME 0 #define SCAN_PROBE_SPACING_TIME 0 #define SCAN_PROBE_DELAY 0 #define SCAN_MAX_SCAN_TIME 50000 diff --git a/umac/scan/dispatcher/inc/wlan_scan_api.h b/umac/scan/dispatcher/inc/wlan_scan_api.h index cb5505b9af9a..cdde004be19d 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_api.h @@ -66,4 +66,63 @@ void wlan_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc, void wlan_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc, uint32_t *dwell_time); +/** + * wlan_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwelltime + * + * Return: scan concurrent active dwell time + */ +void wlan_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time); + +/** + * wlan_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwelltime + * + * Return: scan concurrent active dwell time + */ +void wlan_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time); + +/** + * wlan_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan passive dwelltime + * + * Return: scan concurrent passive dwell time + */ +void wlan_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time); + +/** + * wlan_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan passive dwelltime + * + * Return: scan concurrent passive dwell time + */ +void wlan_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time); + +/** + * wlan_scan_cfg_get_conc_max_resttime() - API to get max rest time + * @psoc: pointer to psoc object + * @rest_time: scan concurrent max resttime + * + * Return: scan concurrent max rest time + */ +void wlan_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc, + uint32_t *rest_time); + +/** + * wlan_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time + * @psoc: pointer to psoc object + * @rest_time: scan concurrent min rest time + * + * Return: scan concurrent min rest time + */ +void wlan_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc, + uint32_t *rest_time); #endif diff --git a/umac/scan/dispatcher/inc/wlan_scan_cfg.h b/umac/scan/dispatcher/inc/wlan_scan_cfg.h index e262acd5d685..13bd82c4db66 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_cfg.h +++ b/umac/scan/dispatcher/inc/wlan_scan_cfg.h @@ -121,7 +121,7 @@ */ #define CFG_SCAN_NUM_PROBES CFG_INI_UINT(\ "gScanNumProbes",\ - 0, 20, MCL_OR_WIN_VALUE(0, 5),\ + 0, 20, MCL_OR_WIN_VALUE(0, 2),\ CFG_VALUE_OR_DEFAULT,\ "number of probes on each channel") @@ -177,7 +177,7 @@ */ #define CFG_ADAPTIVE_SCAN_DWELL_MODE CFG_INI_UINT(\ "hostscan_adaptive_dwell_mode",\ - 0, 4, 2,\ + 0, 4, MCL_OR_WIN_VALUE(2, 0),\ CFG_VALUE_OR_DEFAULT,\ "Enable adaptive dwell mode") @@ -267,6 +267,130 @@ #define CFG_SCAN_PNO #endif +/* + * + * gActiveMaxChannelTimeConc - Maximum active scan time in milliseconds. + * @Min: 0 + * @Max: 10000 + * @Default: 40 + * + * This ini is used to set maximum active scan time in STA+SAP concurrent + * mode. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_ACTIVE_MAX_CHANNEL_TIME_CONC CFG_INI_UINT(\ + "gActiveMaxChannelTimeConc",\ + 0, 10000, MCL_OR_WIN_VALUE(40, 0),\ + CFG_VALUE_OR_DEFAULT, \ + "active scan time in STA+SAP concurrent") + +/* + * + * gPassiveMaxChannelTimeConc - Maximum passive scan time in milliseconds. + * @Min: 0 + * @Max: 10000 + * @Default: 110 + * + * This ini is used to set maximum passive scan time in STA+SAP concurrent + * mode. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_PASSIVE_MAX_CHANNEL_TIME_CONC CFG_INI_UINT(\ + "gPassiveMaxChannelTimeConc",\ + 0, 10000, MCL_OR_WIN_VALUE(110, 0),\ + CFG_VALUE_OR_DEFAULT, \ + "Set priority for connection with bssid_hint") + +/* + * + * gRestTimeConc - Rest time before moving to a new channel to scan. + * @Min: 0 + * @Max: 10000 + * @Default: 100 + * + * This ini is used to configure rest time. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_MAX_REST_TIME_CONC CFG_INI_UINT(\ + "nRestTimeConc",\ + 0, 10000, MCL_OR_WIN_VALUE(100, 0),\ + CFG_VALUE_OR_DEFAULT, \ + "Rest time before moving to a new channel") + +/* + * + * min_rest_time_conc - Mininum time spent on home channel before moving to a + * new channel to scan. + * @Min: 0 + * @Max: 50 + * @Default: 50 + * + * This ini is used to configure minimum time spent on home channel before + * moving to a new channel to scan. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_MIN_REST_TIME_CONC CFG_INI_UINT(\ + "min_rest_time_conc",\ + 0, 50, MCL_OR_WIN_VALUE(50, 0),\ + CFG_VALUE_OR_DEFAULT, \ + "minimum time spent on home channel") + +/* + * + * gIdleTimeConc - Data inactivity time in msec. + * @Min: 0 + * @Max: 25 + * @Default: 25 + * + * This ini is used to configure data inactivity time in msec on bss channel + * that will be used by scan engine in firmware. + * For example if this value is 25ms then firmware will check for data + * inactivity every 25ms till gRestTimeConc is reached. + * If inactive then scan engine will move from home channel to scan the next + * frequency. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_IDLE_TIME_CONC CFG_INI_UINT(\ + "gIdleTimeConc",\ + 0, 25, MCL_OR_WIN_VALUE(25, 0),\ + CFG_VALUE_OR_DEFAULT, \ + "data inactivity time on bss channel") + #define CFG_SCAN_ALL \ CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \ CFG(CFG_ACTIVE_MAX_CHANNEL_TIME) \ @@ -276,5 +400,11 @@ CFG(CFG_SCAN_PROBE_REPEAT_TIME) \ CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE) \ CFG(CFG_IS_BSSID_HINT_PRIORITY) \ - CFG_SCAN_PNO + CFG_SCAN_PNO \ + CFG(CFG_PASSIVE_MAX_CHANNEL_TIME_CONC) \ + CFG(CFG_ACTIVE_MAX_CHANNEL_TIME_CONC) \ + CFG(CFG_MAX_REST_TIME_CONC) \ + CFG(CFG_MIN_REST_TIME_CONC) \ + CFG(CFG_IDLE_TIME_CONC) + #endif diff --git a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h index af3282bc2781..ccd2952a1072 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h @@ -694,4 +694,88 @@ void ucfg_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc, return wlan_scan_cfg_get_passive_dwelltime(psoc, dwell_time); } +/** + * ucfg_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwelltime + * + * Return: scan concurrent active dwell time + */ +static inline +void ucfg_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time) +{ + return wlan_scan_cfg_get_conc_active_dwelltime(psoc, dwell_time); +} + +/** + * ucfg_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan active dwelltime + * + * Return: scan concurrent active dwell time + */ +static inline +void ucfg_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time) +{ + return wlan_scan_cfg_set_conc_active_dwelltime(psoc, dwell_time); +} + +/** + * ucfg_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan passive dwelltime + * + * Return: scan concurrent passive dwell time + */ +static inline +void ucfg_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t *dwell_time) +{ + return wlan_scan_cfg_get_conc_passive_dwelltime(psoc, dwell_time); +} + +/** + * ucfg_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime + * @psoc: pointer to psoc object + * @dwell_time: scan passive dwelltime + * + * Return: scan concurrent passive dwell time + */ +static inline +void ucfg_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, + uint32_t dwell_time) +{ + return wlan_scan_cfg_set_conc_passive_dwelltime(psoc, dwell_time); +} + +/** + * ucfg_scan_cfg_get_conc_max_resttime() - API to get max rest time + * @psoc: pointer to psoc object + * @rest_time: scan concurrent max resttime + * + * Return: scan concurrent max rest time + */ +static inline +void ucfg_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc, + uint32_t *rest_time) +{ + return wlan_scan_cfg_get_conc_max_resttime(psoc, rest_time); +} + +/** + * ucfg_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time + * @psoc: pointer to psoc object + * @rest_time: scan concurrent min rest time + * + * Return: scan concurrent min rest time + */ +static inline +void ucfg_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc, + uint32_t *rest_time) +{ + return wlan_scan_cfg_get_conc_min_resttime(psoc, rest_time); +} + #endif diff --git a/umac/scan/dispatcher/src/wlan_scan_api.c b/umac/scan/dispatcher/src/wlan_scan_api.c index 1aa835672341..ddbd3ed945c8 100644 --- a/umac/scan/dispatcher/src/wlan_scan_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_api.c @@ -66,3 +66,75 @@ void wlan_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc, return; scan_obj->scan_def.active_dwell = dwell_time; } + +void wlan_scan_cfg_get_conc_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) + return; + + *dwell_time = scan_obj->scan_def.conc_active_dwell; +} + +void wlan_scan_cfg_set_conc_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) + return; + + scan_obj->scan_def.conc_active_dwell = dwell_time; +} + +void wlan_scan_cfg_get_conc_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) + return; + + *dwell_time = scan_obj->scan_def.conc_passive_dwell; +} + +void wlan_scan_cfg_set_conc_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) + return; + + scan_obj->scan_def.conc_passive_dwell = dwell_time; +} + +void wlan_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc, + uint32_t *rest_time) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) + return; + + *rest_time = scan_obj->scan_def.conc_max_rest_time; +} + +void wlan_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc, + uint32_t *rest_time) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) + return; + + *rest_time = scan_obj->scan_def.conc_min_rest_time; +} diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index 2ae43db80541..eb09c7ec54ce 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -1418,11 +1418,16 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc, scan_obj->scan_def.sta_miracast_mcc_rest_time = SCAN_STA_MIRACAST_MCC_REST_TIME; scan_obj->scan_def.min_rest_time = SCAN_MIN_REST_TIME; - scan_obj->scan_def.conc_active_dwell = SCAN_CONC_ACTIVE_DWELL_TIME; - scan_obj->scan_def.conc_passive_dwell = SCAN_CONC_PASSIVE_DWELL_TIME; - scan_obj->scan_def.conc_max_rest_time = SCAN_CONC_MAX_REST_TIME; - scan_obj->scan_def.conc_min_rest_time = SCAN_CONC_MIN_REST_TIME; - scan_obj->scan_def.conc_idle_time = SCAN_CONC_IDLE_TIME; + scan_obj->scan_def.conc_active_dwell = + cfg_get(psoc, CFG_ACTIVE_MAX_CHANNEL_TIME_CONC); + scan_obj->scan_def.conc_passive_dwell = + cfg_get(psoc, CFG_PASSIVE_MAX_CHANNEL_TIME_CONC); + scan_obj->scan_def.conc_max_rest_time = + cfg_get(psoc, CFG_MAX_REST_TIME_CONC); + scan_obj->scan_def.conc_min_rest_time = + cfg_get(psoc, CFG_MIN_REST_TIME_CONC); + scan_obj->scan_def.conc_idle_time = + cfg_get(psoc, CFG_IDLE_TIME_CONC); scan_obj->scan_def.repeat_probe_time = cfg_get(psoc, CFG_SCAN_PROBE_REPEAT_TIME); scan_obj->scan_def.probe_spacing_time = SCAN_PROBE_SPACING_TIME; @@ -1936,12 +1941,6 @@ QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc, } scan_def = &scan_obj->scan_def; - 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; - scan_def->conc_max_rest_time = scan_cfg->conc_max_rest_time; - scan_def->conc_min_rest_time = scan_cfg->conc_min_rest_time; - scan_def->conc_idle_time = scan_cfg->conc_idle_time; scan_def->scan_cache_aging_time = scan_cfg->scan_cache_aging_time; scan_def->prefer_5ghz = scan_cfg->prefer_5ghz; scan_def->select_5ghz_margin = scan_cfg->select_5ghz_margin;