diff --git a/umac/scan/core/src/wlan_scan_main.h b/umac/scan/core/src/wlan_scan_main.h index fd48153713..45bfb99f5d 100644 --- a/umac/scan/core/src/wlan_scan_main.h +++ b/umac/scan/core/src/wlan_scan_main.h @@ -321,6 +321,7 @@ struct extscan_def_config { * @scan_priority: default scan priority * @adaptive_dwell_time_mode: adaptive dwell mode with connection * @adaptive_dwell_time_mode_nc: adaptive dwell mode without connection + * @extscan_adaptive_dwell_mode: Adaptive dwell mode during ext scan * @scan_f_passive: passively scan all channels including active channels * @scan_f_bcast_probe: add wild card ssid prbreq even if ssid_list is specified * @scan_f_cck_rates: add cck rates to rates/xrates ie in prb req @@ -398,6 +399,7 @@ struct scan_default_params { enum scan_priority scan_priority; enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode; enum scan_dwelltime_adaptive_mode adaptive_dwell_time_mode_nc; + enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode; union { struct { uint32_t scan_f_passive:1, diff --git a/umac/scan/dispatcher/inc/wlan_scan_cfg.h b/umac/scan/dispatcher/inc/wlan_scan_cfg.h index da82cc3c9c..eba4e81895 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_cfg.h +++ b/umac/scan/dispatcher/inc/wlan_scan_cfg.h @@ -910,6 +910,38 @@ CFG_SCAN_AGING_TIME_DEFAULT, \ CFG_VALUE_OR_DEFAULT, \ "scan aging time") +/* + * + * 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 CFG_INI_UINT( \ + "extscan_adaptive_dwell_mode", \ + 0, \ + 4, \ + 1, \ + CFG_VALUE_OR_DEFAULT, \ + "ext scan adaptive dwell mode") #define CFG_SCAN_ALL \ CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \ @@ -931,6 +963,7 @@ CFG(CFG_IDLE_TIME_CONC) \ CFG(CFG_ENABLE_MAC_ADDR_SPOOFING) \ CFG(CFG_SCAN_AGING_TIME) \ + CFG(CFG_ADAPTIVE_EXTSCAN_DWELL_MODE) \ CFG_SCAN_PNO #endif /* __CONFIG_SCAN_H */ diff --git a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h index cdad8ba099..80fc04cbc2 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h @@ -647,6 +647,16 @@ bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc); */ bool ucfg_scan_is_mac_spoofing_enabled(struct wlan_objmgr_psoc *psoc); +/** + * ucfg_scan_get_extscan_adaptive_dwell_mode() - API to get the adaptive dwell + * mode during ext scan + * @psoc: pointer to psoc object + * + * Return: value of type enum scan_dwelltime_adaptive_mode + */ +enum scan_dwelltime_adaptive_mode +ucfg_scan_get_extscan_adaptive_dwell_mode(struct wlan_objmgr_psoc *psoc); + /** * ucfg_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime * @psoc: pointer to psoc object diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index 23b5888ac0..77df45faa8 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -990,6 +990,8 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_ADAPTIVE_SCAN_DWELL_MODE_NC); scan_obj->scan_def.enable_mac_spoofing = cfg_get(psoc, CFG_ENABLE_MAC_ADDR_SPOOFING); + scan_obj->scan_def.extscan_adaptive_dwell_mode = + cfg_get(psoc, CFG_ADAPTIVE_EXTSCAN_DWELL_MODE); /* scan contrl flags */ scan_obj->scan_def.scan_f_passive = true; @@ -1825,6 +1827,20 @@ bool ucfg_scan_is_mac_spoofing_enabled(struct wlan_objmgr_psoc *psoc) return scan_obj->scan_def.enable_mac_spoofing; } +enum scan_dwelltime_adaptive_mode +ucfg_scan_get_extscan_adaptive_dwell_mode(struct wlan_objmgr_psoc *psoc) +{ + 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 cfg_default(CFG_ADAPTIVE_EXTSCAN_DWELL_MODE); + } + + return scan_obj->scan_def.extscan_adaptive_dwell_mode; +} + QDF_STATUS ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc, enum scan_config config, uint32_t val)