qcacmn: Add an ini to ignore user configured sched scan params

Currently there is no mechanism in driver to decide whether
to consider the user configured number of sched scan plan or
to configure only 1 schad scan plan.
There is a requirement to configure only one sched scan plan,
add ini support to meet this requiremet.

Change-Id: Iea3bc3f18696837150ce6f4bd60416a8a45bd1d3
CRs-Fixed: 2868125
This commit is contained in:
Ashish Kumar Dhanotiya
2021-02-04 17:06:33 +05:30
committed by snandini
parent b6b3ce1a00
commit 4ea435bd55
5 changed files with 83 additions and 22 deletions

View File

@@ -150,24 +150,14 @@ static void wlan_scan_rand_attrs(struct wlan_objmgr_vdev *vdev,
* Return: None
*/
static void
wlan_config_sched_scan_plan(struct pno_scan_req_params *pno_req,
wlan_config_sched_scan_plan(struct wlan_objmgr_psoc *psoc,
struct pno_scan_req_params *pno_req,
struct cfg80211_sched_scan_request *request)
{
/*
* As of now max 2 scan plans were supported by firmware
* if number of scan plan supported by firmware increased below logic
* must change.
*/
if (request->n_scan_plans == SCAN_PNO_MAX_PLAN_REQUEST) {
if (!ucfg_scan_get_user_config_sched_scan_plan(psoc) ||
request->n_scan_plans == 1) {
pno_req->fast_scan_period =
request->scan_plans[0].interval * MSEC_PER_SEC;
pno_req->fast_scan_max_cycles =
request->scan_plans[0].iterations;
pno_req->slow_scan_period =
request->scan_plans[1].interval * MSEC_PER_SEC;
} else if (request->n_scan_plans == 1) {
pno_req->fast_scan_period =
request->scan_plans[0].interval * MSEC_PER_SEC;
request->scan_plans[0].interval * MSEC_PER_SEC;
/*
* if only one scan plan is configured from framework
* then both fast and slow scan should be configured with the
@@ -176,13 +166,26 @@ wlan_config_sched_scan_plan(struct pno_scan_req_params *pno_req,
pno_req->fast_scan_max_cycles = 1;
pno_req->slow_scan_period =
request->scan_plans[0].interval * MSEC_PER_SEC;
}
/*
* As of now max 2 scan plans were supported by firmware
* if number of scan plan supported by firmware increased below logic
* must change.
*/
else if (request->n_scan_plans == SCAN_PNO_MAX_PLAN_REQUEST) {
pno_req->fast_scan_period =
request->scan_plans[0].interval * MSEC_PER_SEC;
pno_req->fast_scan_max_cycles =
request->scan_plans[0].iterations;
pno_req->slow_scan_period =
request->scan_plans[1].interval * MSEC_PER_SEC;
} else {
osif_err("Invalid number of scan plans %d !!",
request->n_scan_plans);
}
}
#else
#define wlan_config_sched_scan_plan(pno_req, request) \
#define wlan_config_sched_scan_plan(psoc, pno_req, request) \
__wlan_config_sched_scan_plan(pno_req, request, psoc)
static void
@@ -566,7 +569,7 @@ int wlan_cfg80211_sched_scan_start(struct wlan_objmgr_vdev *vdev,
* switches slow_scan_period. This is less frequent scans and firmware
* shall be in slow_scan_period mode until next PNO Start.
*/
wlan_config_sched_scan_plan(req, request);
wlan_config_sched_scan_plan(psoc, req, request);
req->delay_start_time = wlan_config_sched_scan_start_delay(request);
req->scan_backoff_multiplier = scan_backoff_multiplier;