diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index 71157e0be4..4532a30c66 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 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 @@ -1520,8 +1521,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 8837b48fb8..b221517bea 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 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 @@ -944,6 +945,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,8 @@ 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); + scm_debug("scan_ctrl_flags_ext %0x", req->scan_req.scan_ctrl_flags_ext); /* * Set wide band flag if enabled. This will cause diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h index 586f690fcc..4b0658b015 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h +++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 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 @@ -115,6 +116,15 @@ typedef uint32_t wlan_scan_id; #define ELEM_ID_LIST_LEN_POS 3 #define ELEM_ID_LIST_POS 4 +/* 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;