diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index 26928ded05..c6fda4ca75 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -1405,13 +1405,15 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev, req->scan_req.scan_type = SCAN_TYPE_P2P_SEARCH; /* Set dwell time mode according to scan policy type flags */ - if (req->scan_req.scan_policy_high_accuracy) - req->scan_req.adaptive_dwell_time_mode = - SCAN_DWELL_MODE_STATIC; - if ((req->scan_req.scan_policy_low_power) || - (req->scan_req.scan_policy_low_span)) - req->scan_req.adaptive_dwell_time_mode = - SCAN_DWELL_MODE_AGGRESSIVE; + if (ucfg_scan_cfg_honour_nl_scan_policy_flags(psoc)) { + if (req->scan_req.scan_policy_high_accuracy) + req->scan_req.adaptive_dwell_time_mode = + SCAN_DWELL_MODE_STATIC; + if (req->scan_req.scan_policy_low_power || + req->scan_req.scan_policy_low_span) + req->scan_req.adaptive_dwell_time_mode = + SCAN_DWELL_MODE_AGGRESSIVE; + } /* * FW require at least 1 MAC to send probe request. diff --git a/umac/scan/core/src/wlan_scan_main.h b/umac/scan/core/src/wlan_scan_main.h index 421080ee4a..0c990e06c8 100644 --- a/umac/scan/core/src/wlan_scan_main.h +++ b/umac/scan/core/src/wlan_scan_main.h @@ -312,6 +312,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 + * @honour_nl_scan_policy_flags: honour nl80211 scan policy flags * @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 @@ -396,6 +397,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; + bool honour_nl_scan_policy_flags; enum scan_dwelltime_adaptive_mode extscan_adaptive_dwell_mode; union { struct { diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c index c71a45e20f..27a2575b9f 100644 --- a/umac/scan/core/src/wlan_scan_manager.c +++ b/umac/scan/core/src/wlan_scan_manager.c @@ -443,6 +443,11 @@ scm_update_dbs_scan_ctrl_ext_flag(struct scan_start_request *req) goto end; } + if (!wlan_scan_cfg_honour_nl_scan_policy_flags(psoc)) { + scm_debug("nl scan policy flags not honoured, goto end"); + goto end; + } + if (req->scan_req.scan_policy_high_accuracy) { scm_debug("high accuracy scan received, going for non-dbs scan"); scan_dbs_policy = SCAN_DBS_POLICY_FORCE_NONDBS; diff --git a/umac/scan/dispatcher/inc/wlan_scan_api.h b/umac/scan/dispatcher/inc/wlan_scan_api.h index cbad19c487..a55e9e457f 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_api.h @@ -106,6 +106,15 @@ void wlan_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, void wlan_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc, uint32_t dwell_time); +/** + * wlan_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy + * flags honoured + * @psoc: pointer to psoc object + * + * Return: nl scan policy flags honoured or not + */ +bool wlan_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc); + /** * wlan_scan_cfg_get_conc_max_resttime() - API to get max rest time * @psoc: pointer to psoc object diff --git a/umac/scan/dispatcher/inc/wlan_scan_cfg.h b/umac/scan/dispatcher/inc/wlan_scan_cfg.h index d5467e45c5..fd28e5a739 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_cfg.h +++ b/umac/scan/dispatcher/inc/wlan_scan_cfg.h @@ -252,6 +252,35 @@ 0, 4, MCL_OR_WIN_VALUE(4, 0),\ CFG_VALUE_OR_DEFAULT,\ "Enable adaptive dwell mode without connection") + +/* + * + * honour_nl_scan_policy_flags - This ini will decide whether to honour + * NL80211 scan policy flags + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This parameter will decide whether to honour scan flags such as + * NL80211_SCAN_FLAG_HIGH_ACCURACY , NL80211_SCAN_FLAG_LOW_SPAN, + * NL80211_SCAN_FLAG_LOW_POWER. + * Acceptable values for this: + * 0: Config is disabled + * 1: Config is enabled + * + * Related: None + * + * Supported Feature: Scan + * + * Usage: Internal + * + * + */ +#define CFG_HONOUR_NL_SCAN_POLICY_FLAGS CFG_INI_BOOL(\ + "honour_nl_scan_policy_flags",\ + true, \ + "honour NL80211 scan policy flags") + /* * * is_bssid_hint_priority - Set priority for connection with bssid_hint @@ -1124,6 +1153,7 @@ CFG(CFG_SCAN_PROBE_REPEAT_TIME) \ CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE) \ CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE_NC) \ + CFG(CFG_HONOUR_NL_SCAN_POLICY_FLAGS) \ CFG(CFG_IS_BSSID_HINT_PRIORITY) \ CFG(CFG_PASSIVE_MAX_CHANNEL_TIME_CONC) \ CFG(CFG_ACTIVE_MAX_CHANNEL_TIME_CONC) \ diff --git a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h index f3771ea27f..22edb48082 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h @@ -805,6 +805,19 @@ void ucfg_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc, */ bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc); +/** + * ucfg_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy + * flags honoured. + * @psoc: pointer to psoc object + * + * Return: nl scan flags is honoured or not + */ +static inline +bool ucfg_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc) +{ + return wlan_scan_cfg_honour_nl_scan_policy_flags(psoc); +} + /** * ucfg_scan_cfg_get_conc_max_resttime() - API to get max rest time * @psoc: pointer to psoc object diff --git a/umac/scan/dispatcher/src/wlan_scan_api.c b/umac/scan/dispatcher/src/wlan_scan_api.c index d4f50c36e4..030e580d98 100644 --- a/umac/scan/dispatcher/src/wlan_scan_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_api.c @@ -141,6 +141,17 @@ wlan_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc, scan_obj->scan_def.allow_dfs_chan_in_scan = enable_dfs_scan; } +bool wlan_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_scan_obj *scan_obj; + + scan_obj = wlan_psoc_get_scan_obj(psoc); + if (!scan_obj) + return false; + + return scan_obj->scan_def.honour_nl_scan_policy_flags; +} + void wlan_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc, uint32_t *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 3eb3f9421e..8b8d8c6797 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -992,6 +992,8 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_ADAPTIVE_SCAN_DWELL_MODE); scan_obj->scan_def.adaptive_dwell_time_mode_nc = cfg_get(psoc, CFG_ADAPTIVE_SCAN_DWELL_MODE_NC); + scan_obj->scan_def.honour_nl_scan_policy_flags = + cfg_get(psoc, CFG_HONOUR_NL_SCAN_POLICY_FLAGS); scan_obj->scan_def.enable_mac_spoofing = cfg_get(psoc, CFG_ENABLE_MAC_ADDR_SPOOFING); scan_obj->scan_def.extscan_adaptive_dwell_mode =