diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index a9b58d275bae..d76a1b825393 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -1535,8 +1535,7 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev, 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) + if (req->scan_req.scan_policy_low_power) req->scan_req.adaptive_dwell_time_mode = SCAN_DWELL_MODE_AGGRESSIVE; } diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c index de436566c474..3227a43aafda 100644 --- a/umac/scan/core/src/wlan_scan_manager.c +++ b/umac/scan/core/src/wlan_scan_manager.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 @@ -945,6 +946,38 @@ scm_update_channel_list(struct scan_start_request *req, scm_scan_chlist_concurrency_modify(req->vdev, req); } +/** + * scm_req_update_dwell_time_as_per_scan_mode() - update scan req params + * dwell time as per scan mode. + * @req: scan request + * + * Return: void + */ +static void +scm_req_update_dwell_time_as_per_scan_mode( + struct wlan_objmgr_vdev *vdev, + struct scan_start_request *req) +{ + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_vdev_get_psoc(vdev); + + if (req->scan_req.scan_policy_low_span && + wlan_scan_cfg_honour_nl_scan_policy_flags(psoc)) { + req->scan_req.adaptive_dwell_time_mode = + SCAN_DWELL_MODE_STATIC; + req->scan_req.dwell_time_active = + QDF_MIN(req->scan_req.dwell_time_active, + LOW_SPAN_ACTIVE_DWELL_TIME); + req->scan_req.dwell_time_active_2g = + QDF_MIN(req->scan_req.dwell_time_active_2g, + LOW_SPAN_ACTIVE_DWELL_TIME); + req->scan_req.dwell_time_passive = + QDF_MIN(req->scan_req.dwell_time_passive, + LOW_SPAN_PASSIVE_DWELL_TIME); + } +} + /** * scm_scan_req_update_params() - update scan req params depending on modes * and scan type. @@ -1051,6 +1084,9 @@ scm_scan_req_update_params(struct wlan_objmgr_vdev *vdev, if (req->scan_req.scan_type == SCAN_TYPE_RRM) req->scan_req.scan_ctrl_flags_ext |= SCAN_FLAG_EXT_RRM_SCAN_IND; + + scm_req_update_dwell_time_as_per_scan_mode(vdev, req); + /* * Set wide band flag if enabled. This will cause * phymode TLV being sent to FW. diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h index 4a150b7f6b41..962edac467ab 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h +++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h @@ -61,6 +61,15 @@ typedef uint32_t wlan_scan_id; #define TBTT_INFO_COUNT 16 +/* Active dwell time in low span scan mode(NL80211_SCAN_FLAG_LOW_SPAN) + * in msec + */ +#define LOW_SPAN_ACTIVE_DWELL_TIME 40 +/* passive dwell time in low span scan mode (NL80211_SCAN_FLAG_LOW_SPAN) + * in msec + */ +#define LOW_SPAN_PASSIVE_DWELL_TIME 110 + /* forward declaration */ struct wlan_objmgr_vdev; struct wlan_objmgr_pdev;