Преглед изворни кода

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
Abhishek Singh пре 7 година
родитељ
комит
7d30bf7ecb
1 измењених фајлова са 41 додато и 0 уклоњено
  1. 41 0
      umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

+ 41 - 0
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;
 }