From 44de5a5d451245ef3215ac5cc0828c44a6e86289 Mon Sep 17 00:00:00 2001 From: Krishna Rao Date: Fri, 3 Jan 2020 16:50:50 +0530 Subject: [PATCH] qcacmn: Add dwell time parameters to cfg80211 scan request API Add active and passive scan dwell time parameters to cfg80211 scan request API. Change-Id: I39f479d7b941e4671f1ad4495ab48031153dd5e7 CRs-Fixed: 2598504 --- os_if/linux/scan/inc/wlan_cfg80211_scan.h | 15 ++++++++++++++- os_if/linux/scan/src/wlan_cfg80211_scan.c | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/os_if/linux/scan/inc/wlan_cfg80211_scan.h b/os_if/linux/scan/inc/wlan_cfg80211_scan.h index aee2d3b5ef..a43e057b90 100644 --- a/os_if/linux/scan/inc/wlan_cfg80211_scan.h +++ b/os_if/linux/scan/inc/wlan_cfg80211_scan.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. 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 @@ -128,6 +128,14 @@ struct scan_req { * @half_rate: Half rate flag * @quarter_rate: Quarter rate flag * @strict_pscan: strict passive scan flag + * @dwell_time_active: Active dwell time. Ignored if zero or inapplicable. + * @dwell_time_active_2g: 2.4 GHz specific active dwell time. Ignored if zero or + * inapplicable. + * @dwell_time_passive: Passive dwell time. Ignored if zero or inapplicable. + * @dwell_time_active_6g: 6 GHz specific active dwell time. Ignored if zero or + * inapplicable. + * @dwell_time_passive_6g: 6 GHz specific passive dwell time. Ignored if zero or + * inapplicable. */ struct scan_params { uint8_t source; @@ -137,6 +145,11 @@ struct scan_params { bool half_rate; bool quarter_rate; bool strict_pscan; + uint32_t dwell_time_active; + uint32_t dwell_time_active_2g; + uint32_t dwell_time_passive; + uint32_t dwell_time_active_6g; + uint32_t dwell_time_passive_6g; }; /** diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index 3c45a4900e..a7f6616602 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -1407,6 +1407,24 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev, if (is_p2p_scan && request->no_cck) req->scan_req.scan_type = SCAN_TYPE_P2P_SEARCH; + if (params->dwell_time_active) + req->scan_req.dwell_time_active = params->dwell_time_active; + + if (params->dwell_time_active_2g) + req->scan_req.dwell_time_active_2g = + params->dwell_time_active_2g; + + if (params->dwell_time_passive) + req->scan_req.dwell_time_passive = params->dwell_time_passive; + + if (params->dwell_time_active_6g) + req->scan_req.dwell_time_active_6g = + params->dwell_time_active_6g; + + if (params->dwell_time_passive_6g) + req->scan_req.dwell_time_passive_6g = + params->dwell_time_passive_6g; + /* Set dwell time mode according to scan policy type flags */ if (ucfg_scan_cfg_honour_nl_scan_policy_flags(psoc)) { if (req->scan_req.scan_policy_high_accuracy)