Browse Source

qcacmn: Block all new scan during suspend mode

After driver suspend some thread can still queue scan req
which will cause scan during suspend and WOW_ENABLE received
while SCAN in progress.

TO avoid this block all new scan during suspend.

Change-Id: I02ddc9b5e6ba5f1782d00e34f044ace34c54d0b0
CRs-Fixed: 2343385
Abhinav Kumar 6 years ago
parent
commit
45cff82c5f
2 changed files with 22 additions and 13 deletions
  1. 20 13
      umac/scan/core/src/wlan_scan_manager.c
  2. 2 0
      umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

+ 20 - 13
umac/scan/core/src/wlan_scan_manager.c

@@ -396,6 +396,26 @@ scm_scan_start_req(struct scheduler_msg *msg)
 		goto err;
 	}
 
+	if (!scan_obj->enable_scan) {
+		scm_err("scan disabled, rejecting the scan req");
+		status = QDF_STATUS_E_NULL_VALUE;
+		goto err;
+	}
+
+	scan_vdev_priv_obj = wlan_get_vdev_scan_obj(req->vdev);
+	if (!scan_vdev_priv_obj) {
+		scm_debug("Couldn't find scan priv object");
+		status = QDF_STATUS_E_NULL_VALUE;
+		goto err;
+	}
+
+	if (scan_vdev_priv_obj->is_vdev_delete_in_progress) {
+		scm_err("Can't allow scan on vdev_id:%d",
+			wlan_vdev_get_id(req->vdev));
+		status = QDF_STATUS_E_NULL_VALUE;
+		goto err;
+	}
+
 	cmd.cmd_type = WLAN_SER_CMD_SCAN;
 	cmd.cmd_id = req->scan_req.scan_id;
 	cmd.cmd_cb = (wlan_serialization_cmd_callback)
@@ -414,19 +434,6 @@ scm_scan_start_req(struct scheduler_msg *msg)
 		  req, req->scan_req.scan_req_id, req->scan_req.scan_id,
 		  req->scan_req.vdev_id);
 
-	scan_vdev_priv_obj = wlan_get_vdev_scan_obj(req->vdev);
-	if (!scan_vdev_priv_obj) {
-		scm_debug("Couldn't find scan priv object");
-		status = QDF_STATUS_E_NULL_VALUE;
-		goto err;
-	}
-	if (scan_vdev_priv_obj->is_vdev_delete_in_progress) {
-		scm_err("Can't allow scan on vdev_id:%d",
-			wlan_vdev_get_id(req->vdev));
-		status = QDF_STATUS_E_NULL_VALUE;
-		goto err;
-	}
-
 	qdf_mtrace(QDF_MODULE_ID_SCAN, QDF_MODULE_ID_SERIALIZATION,
 		   WLAN_SER_CMD_SCAN, req->vdev->vdev_objmgr.vdev_id,
 		   req->scan_req.scan_id);

+ 2 - 0
umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

@@ -2058,6 +2058,7 @@ ucfg_scan_suspend_handler(struct wlan_objmgr_psoc *psoc, void *arg)
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	int i;
 
+	ucfg_scan_set_enable(psoc, false);
 	/* Check all pdev */
 	for (i = 0; i < WLAN_UMAC_MAX_PDEVS; i++) {
 		pdev = wlan_objmgr_get_pdev_by_id(psoc, i, WLAN_SCAN_ID);
@@ -2079,6 +2080,7 @@ ucfg_scan_suspend_handler(struct wlan_objmgr_psoc *psoc, void *arg)
 static QDF_STATUS
 ucfg_scan_resume_handler(struct wlan_objmgr_psoc *psoc, void *arg)
 {
+	ucfg_scan_set_enable(psoc, true);
 	return QDF_STATUS_SUCCESS;
 }