From d6b243219ddb36a6e2c82f75cdc0220ca24ef7fa Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Tue, 25 Apr 2017 11:48:19 -0700 Subject: [PATCH] qcacmn: Fix compilation with scheduled scan start delay cfg80211_sched_scan_request start delay is added from KERNEL_VERSION 4.4, and schedule scan plans is backported but not the start delay. This change is to make sure start delay accessed from request only for KERNEL_VERSION 4.4 to avoid compilation issues with CFG80211_MULTI_SCAN_PLAN_BACKPORT. Change-Id: I3469ef457bb1f97fdddfb7491fbcaa2e64a16e8a CRs-Fixed: 2038458 --- os_if/linux/scan/src/wlan_cfg80211_scan.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index cdea702d2d13..0aec412d278c 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -35,6 +35,20 @@ #include #include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) +static uint32_t hdd_config_sched_scan_start_delay( + struct cfg80211_sched_scan_request *request) +{ + return request->delay; +} +#else +static uint32_t hdd_config_sched_scan_start_delay( + struct cfg80211_sched_scan_request *request) +{ + return 0; +} +#endif + #ifdef FEATURE_WLAN_SCAN_PNO #if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) || \ defined(CFG80211_MULTI_SCAN_PLAN_BACKPORT)) @@ -50,7 +64,6 @@ static void wlan_config_sched_scan_plan(struct pno_scan_req_params *pno_req, struct cfg80211_sched_scan_request *request) { - pno_req->delay_start_time = request->delay; /* * As of now max 2 scan plans were supported by firmware * if number of scan plan supported by firmware increased below logic @@ -326,6 +339,7 @@ int wlan_cfg80211_sched_scan_start(struct wlan_objmgr_pdev *pdev, * shall be in slow_scan_period mode until next PNO Start. */ wlan_config_sched_scan_plan(req, request); + req->delay_start_time = hdd_config_sched_scan_start_delay(request); cfg80211_notice("Base scan interval: %d sec, scan cycles: %d, slow scan interval %d", req->fast_scan_period, req->fast_scan_max_cycles, req->slow_scan_period);