qcacmn: Modify scan type for RRM scan request

Currently in the case of concurrent sessions running,
the driver updates the active dwell time for the scan
request to the default value, overwriting the already
filled active dwell time which the DUT got from the
AP as part of RRM request, which results in violation
of protocol.

Fix is to not update the concurrency params if the scan
request is of type RRM.

Change-Id: Ifbb4b45fc111851f544fd39187e4113bda5f7348
CRs-Fixed: 2436893
diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c
index 8d1da79..3363a39 100644
--- a/os_if/linux/scan/src/wlan_cfg80211_scan.c
+++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c
@@ -1402,7 +1402,7 @@
 		is_p2p_scan = true;
 
 	if (is_p2p_scan && request->no_cck)
-		req->scan_req.p2p_scan_type = SCAN_P2P_SEARCH;
+		req->scan_req.scan_type = SCAN_TYPE_P2P_SEARCH;
 
 	/* Set dwell time mode according to scan policy type flags */
 	if (req->scan_req.scan_policy_high_accuracy)
diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c
index adbe13f..93285c4 100644
--- a/umac/scan/core/src/wlan_scan_manager.c
+++ b/umac/scan/core/src/wlan_scan_manager.c
@@ -590,6 +590,9 @@
 		go_peer_count =
 		wlan_util_get_peer_count_for_mode(pdev, QDF_P2P_GO_MODE);
 
+	if (!req->scan_req.scan_f_passive)
+		scm_update_passive_dwell_time(vdev, req);
+
 	if (policy_mgr_get_connection_count(psoc)) {
 		if (req->scan_req.scan_f_passive)
 			req->scan_req.dwell_time_passive =
@@ -625,7 +628,7 @@
 	if (vdev->vdev_mlme.vdev_opmode == QDF_SAP_MODE)
 		req->scan_req.dwell_time_active_2g = 0;
 
-	if (req->scan_req.p2p_scan_type == SCAN_NON_P2P_DEFAULT) {
+	if (req->scan_req.scan_type == SCAN_TYPE_DEFAULT) {
 		/*
 		 * Decide burst_duration and dwell_time_active based on
 		 * what type of devices are active.
@@ -748,12 +751,6 @@
 }
 
 static inline void
-scm_update_passive_dwell_time(struct wlan_objmgr_vdev *vdev,
-			      struct scan_start_request *req)
-{
-}
-
-static inline void
 scm_update_dbs_scan_ctrl_ext_flag(struct scan_start_request *req)
 {
 }
@@ -792,7 +789,7 @@
 		scan_vdev_obj->first_scan_done = true;
 	}
 
-	if(req->scan_req.p2p_scan_type == SCAN_P2P_SEARCH)
+	if (req->scan_req.scan_type == SCAN_TYPE_P2P_SEARCH)
 		p2p_search = true;
 	/*
 	 * No need to update channels if req is passive scan and single channel
@@ -864,17 +861,11 @@
 					  req->scan_req.dwell_time_active /
 					  req->scan_req.repeat_probe_time : 0;
 
-	if (req->scan_req.p2p_scan_type == SCAN_NON_P2P_DEFAULT) {
-		req->scan_req.scan_f_cck_rates = true;
-		if (!req->scan_req.num_ssids)
-			req->scan_req.scan_f_bcast_probe = true;
-		req->scan_req.scan_f_add_ds_ie_in_probe = true;
-		req->scan_req.scan_f_filter_prb_req = true;
-		req->scan_req.scan_f_add_tpc_ie_in_probe = true;
-	} else {
+	if (req->scan_req.scan_type == SCAN_TYPE_P2P_SEARCH ||
+	    req->scan_req.scan_type == SCAN_TYPE_P2P_LISTEN) {
 		req->scan_req.adaptive_dwell_time_mode = SCAN_DWELL_MODE_STATIC;
 		req->scan_req.dwell_time_active_2g = 0;
-		if (req->scan_req.p2p_scan_type == SCAN_P2P_LISTEN) {
+		if (req->scan_req.scan_type == SCAN_TYPE_P2P_LISTEN) {
 			req->scan_req.repeat_probe_time = 0;
 		} else {
 			req->scan_req.scan_f_filter_prb_req = true;
@@ -922,10 +913,15 @@
 			}
 			req->scan_req.scan_ev_bss_chan = false;
 		}
+	} else {
+		req->scan_req.scan_f_cck_rates = true;
+		if (!req->scan_req.num_ssids)
+			req->scan_req.scan_f_bcast_probe = true;
+		req->scan_req.scan_f_add_ds_ie_in_probe = true;
+		req->scan_req.scan_f_filter_prb_req = true;
+		req->scan_req.scan_f_add_tpc_ie_in_probe = true;
 	}
 
-	if (!req->scan_req.scan_f_passive)
-		scm_update_passive_dwell_time(vdev, req);
 	scm_update_dbs_scan_ctrl_ext_flag(req);
 
 	/*
@@ -933,7 +929,8 @@
 	 * single channel ie ROC, Preauth etc
 	 */
 	if (!(req->scan_req.scan_f_passive &&
-	      req->scan_req.chan_list.num_chan == 1))
+	      req->scan_req.chan_list.num_chan == 1) &&
+	      req->scan_req.scan_type != SCAN_TYPE_RRM)
 		scm_req_update_concurrency_params(vdev, req, scan_obj);
 
 	/*
diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h
index 7bc5276..b740b95 100644
--- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h
+++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h
@@ -783,15 +783,17 @@
 };
 
 /**
- * enum scan_type: scan type
- * @SCAN_NON_P2P_DEFAULT: Def scan
- * @SCAN_P2P_SEARCH: P2P Search
- * @SCAN_P2P_LISTEN: P2P listed
+ * enum scan_request_type: scan type
+ * @SCAN_TYPE_DEFAULT: Def scan
+ * @SCAN_TYPE_P2P_SEARCH: P2P Search
+ * @SCAN_TYPE_P2P_LISTEN: P2P listed
+ * @SCAN_TYPE_RRM: RRM scan request
  */
-enum p2p_scan_type {
-	SCAN_NON_P2P_DEFAULT = 0,
-	SCAN_P2P_SEARCH = 1,
-	SCAN_P2P_LISTEN = 2,
+enum scan_request_type {
+	SCAN_TYPE_DEFAULT = 0,
+	SCAN_TYPE_P2P_SEARCH = 1,
+	SCAN_TYPE_P2P_LISTEN = 2,
+	SCAN_TYPE_RRM = 3
 };
 
 /**
@@ -876,7 +878,7 @@
 	uint32_t vdev_id;
 	uint32_t pdev_id;
 	enum scan_priority scan_priority;
-	enum p2p_scan_type p2p_scan_type;
+	enum scan_request_type scan_type;
 	union {
 		struct {
 			uint32_t scan_ev_started:1,
diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
index 8c4d7d4..3eb3f94 100644
--- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
+++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
@@ -1142,7 +1142,7 @@
 
 	req->vdev = vdev;
 	req->scan_req.vdev_id = wlan_vdev_get_id(vdev);
-	req->scan_req.p2p_scan_type = SCAN_NON_P2P_DEFAULT;
+	req->scan_req.scan_type = SCAN_TYPE_DEFAULT;
 	req->scan_req.scan_priority = def->scan_priority;
 	req->scan_req.dwell_time_active = def->active_dwell;
 	req->scan_req.dwell_time_active_2g = def->active_dwell_2g;