qcacmn: Add support to acquire wake lock during user scan
Acquire wakelock to handle the case where APP's send scan to connect. If suspend is received during scan, scan will be aborted and APP will not get scan result and will not connect. eg if PNO is implemented in framework. Fix is to avoid the system suspend by taking the wake-lock during scan. Added INI wake_lock_in_user_scan to control this. The INI is disabled by default. Change-Id: I62fdbbcbc6f049cb4e36e774d5a417600a2dfa86 CRs-Fixed: 2381622
This commit is contained in:
@@ -279,6 +279,7 @@ struct extscan_def_config {
|
||||
* @active_dwell: default active dwell time
|
||||
* @allow_dfs_chan_in_first_scan: first scan should contain dfs channels or not.
|
||||
* @allow_dfs_chan_in_scan: Scan DFS channels or not.
|
||||
* @use_wake_lock_in_user_scan: if wake lock will be acquired during user scan
|
||||
* @active_dwell_2g: default active dwell time for 2G channels, if it's not zero
|
||||
* @passive_dwell:default passive dwell time
|
||||
* @max_rest_time: default max rest time
|
||||
@@ -356,6 +357,7 @@ struct scan_default_params {
|
||||
uint32_t active_dwell;
|
||||
bool allow_dfs_chan_in_first_scan;
|
||||
bool allow_dfs_chan_in_scan;
|
||||
bool use_wake_lock_in_user_scan;
|
||||
uint32_t active_dwell_2g;
|
||||
uint32_t passive_dwell;
|
||||
uint32_t max_rest_time;
|
||||
|
@@ -434,6 +434,26 @@
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"minimum time spent on home channel")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* wake_lock_in_user_scan - use wake lock during user scan
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* This ini is used to define if wake lock is held used during user scan req
|
||||
*
|
||||
* Related: Scan
|
||||
*
|
||||
* Usage: Internal/External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_ENABLE_WAKE_LOCK_IN_SCAN CFG_INI_BOOL( \
|
||||
"wake_lock_in_user_scan", \
|
||||
false, \
|
||||
"use wake lock during scan")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gIdleTimeConc - Data inactivity time in msec.
|
||||
@@ -464,6 +484,7 @@
|
||||
|
||||
#define CFG_SCAN_ALL \
|
||||
CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \
|
||||
CFG(CFG_ENABLE_WAKE_LOCK_IN_SCAN) \
|
||||
CFG(CFG_ACTIVE_MAX_CHANNEL_TIME) \
|
||||
CFG(CFG_ENABLE_DFS_SCAN) \
|
||||
CFG(CFG_INITIAL_NO_DFS_SCAN) \
|
||||
|
@@ -778,6 +778,15 @@ void ucfg_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
return wlan_scan_cfg_set_dfs_chan_scan_allowed(psoc, dfs_scan_enable);
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_scan_wake_lock_in_user_scan() - API to determine if wake lock in user
|
||||
* scan is used.
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: true if wake lock in user scan is required
|
||||
*/
|
||||
bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_scan_cfg_get_conc_max_resttime() - API to get max rest time
|
||||
* @psoc: pointer to psoc object
|
||||
|
@@ -1475,6 +1475,8 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc,
|
||||
!cfg_get(psoc, CFG_INITIAL_NO_DFS_SCAN);
|
||||
scan_obj->scan_def.allow_dfs_chan_in_scan =
|
||||
cfg_get(psoc, CFG_ENABLE_DFS_SCAN);
|
||||
scan_obj->scan_def.use_wake_lock_in_user_scan =
|
||||
cfg_get(psoc, CFG_ENABLE_WAKE_LOCK_IN_SCAN);
|
||||
scan_obj->scan_def.active_dwell_2g =
|
||||
cfg_get(psoc, CFG_ACTIVE_MAX_2G_CHANNEL_TIME);
|
||||
scan_obj->scan_def.passive_dwell =
|
||||
@@ -2319,6 +2321,17 @@ bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc)
|
||||
return scan_obj->bt_a2dp_enabled;
|
||||
}
|
||||
|
||||
bool ucfg_scan_wake_lock_in_user_scan(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_scan_obj *scan_obj;
|
||||
|
||||
scan_obj = wlan_psoc_get_scan_obj(psoc);
|
||||
if (!scan_obj)
|
||||
return false;
|
||||
|
||||
return scan_obj->scan_def.use_wake_lock_in_user_scan;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc,
|
||||
enum scan_config config, uint32_t val)
|
||||
|
Reference in New Issue
Block a user