From 6bf33b327c306f99b486d60ca17a6a42b5e7be4a Mon Sep 17 00:00:00 2001 From: Ryan Hsu Date: Thu, 21 Jan 2016 13:59:35 -0800 Subject: [PATCH] qcacld-3.0: Update cfg80211_sched_scan_request for Kernel upgrade Commit: 3b06d27 ("cfg80211: Add multiple scan plans for scheduled scan") Above commit introduces the scan_plan to include the interval parameters, to support configuring multiple sched scan, and is merged since Kernel 4.4. Change-Id: I9e232cfd6f82408fb2e21bef905b6e044951089d CRs-fixed: 966054 --- core/hdd/src/wlan_hdd_scan.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 08c45ccd4ba7..8898fa862fe4 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -2227,13 +2227,26 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, } /* - * Driver gets only one time interval which is hard coded in - * supplicant for 10000ms. Taking power consumption into account - * firmware after gPNOScanTimerRepeatValue times fast_scan_period - * switches slow_scan_period. This is less frequent scans and firmware - * shall be in slow_scan_period mode until next PNO Start. + * Before Kernel 4.4 + * Driver gets only one time interval which is hard coded in + * supplicant for 10000ms. + * + * After Kernel 4.4 + * User can configure multiple scan_plans, each scan would have + * separate scan cycle and interval. For our use case, we would + * only have supplicant set one scan_plan, and firmware also support + * only one as well, so pick up the first index. + * + * Taking power consumption into account + * firmware after gPNOScanTimerRepeatValue times fast_scan_period + * switches slow_scan_period. This is less frequent scans and firmware + * shall be in slow_scan_period mode until next PNO Start. */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) || defined(WITH_BACKPORTS) + pPnoRequest->fast_scan_period = request->scan_plans[0].interval; +#else pPnoRequest->fast_scan_period = request->interval; +#endif pPnoRequest->fast_scan_max_cycles = config->configPNOScanTimerRepeatValue; pPnoRequest->slow_scan_period = @@ -2241,7 +2254,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy, pPnoRequest->fast_scan_period; hdd_info("Base scan interval: %d sec PNOScanTimerRepeatValue: %d", - (request->interval / 1000), + (pPnoRequest->fast_scan_period / 1000), config->configPNOScanTimerRepeatValue); pPnoRequest->modePNO = SIR_PNO_MODE_IMMEDIATE;