From 7d30bf7ecb13b8d5b28fef2d0dc0106faf71f3db Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 18 Aug 2017 15:19:10 +0530 Subject: [PATCH] qcacmn: Use min rest time same as max rest time in SAP+STA case In SAP+STA case the min rest time is 50 and thus during scan possibility increases that the device is not present in base channel during the time of beacon transmission and thus beacons are not transmitted. Thus if SAP is present the min rest time should be 100ms max rest time), so that during scan device can come to base channel and transmit beacons. Change-Id: I6fa2ee57771d093fce7d63089797528f8f4bc409 CRs-Fixed: 2079803 --- umac/scan/dispatcher/src/wlan_scan_ucfg_api.c | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index fead940f99a6..2df259a7f9cb 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -837,6 +837,45 @@ ucfg_scan_unregister_event_handler(struct wlan_objmgr_pdev *pdev, (found ? "removed" : "not found"), handler_cnt); } +#ifdef WLAN_POLICY_MGR_ENABLE +/** + * ucfg_scan_req_update_params() - update scan req params depending + * on active modes + * @vdev: vdev object pointer + * @req: scan request + * + * Return: void + */ +static void ucfg_scan_req_update_params(struct wlan_objmgr_vdev *vdev, + struct scan_start_request *req) +{ + bool ap_or_go_present; + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_vdev_get_psoc(vdev); + + if (!psoc) + return; + + ap_or_go_present = policy_mgr_mode_specific_connection_count( + psoc, QDF_SAP_MODE, NULL) || + policy_mgr_mode_specific_connection_count( + psoc, QDF_P2P_GO_MODE, NULL); + + /* + * If AP is active set min rest time same as max rest time, so that + * firmware spends more time on home channel which will increase the + * probability of sending beacon at TBTT + */ + if (ap_or_go_present) + req->scan_req.min_rest_time = req->scan_req.max_rest_time; +} +#else +static inline void ucfg_scan_req_update_params(struct wlan_objmgr_vdev *vdev, + struct scan_start_request *req){} +#endif + + QDF_STATUS ucfg_scan_init_default_params(struct wlan_objmgr_vdev *vdev, struct scan_start_request *req) @@ -871,6 +910,8 @@ ucfg_scan_init_default_params(struct wlan_objmgr_vdev *vdev, req->scan_req.scan_flags = def->scan_flags; req->scan_req.scan_events = def->scan_events; + ucfg_scan_req_update_params(vdev, req); + return QDF_STATUS_SUCCESS; }