Jelajahi Sumber

qcacld-3.0: Enforce PCL weightage for GO/GC in 2 or 3 vif

If policy_mgr_is_concurrency_allowed is false, don't set
weighed_valid_list = WEIGHT_OF_NON_PCL_CHANNELS. Keep
WEIGHT_OF_DISALLOWED_CHANNELS for them so that the interface
won't start on disallowed channel. And in P2P+P2P or SAP+P2P
case strictly follow PCL weightage for second P2P interface.

Change-Id: I005e680e796269d3cd847b5df460506813d0d033
CRs-Fixed: 3265478
Liangwei Dong 2 tahun lalu
induk
melakukan
d547233ef3
1 mengubah file dengan 31 tambahan dan 17 penghapusan
  1. 31 17
      components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

+ 31 - 17
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -3389,6 +3389,7 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
 			info[MAX_NUMBER_OF_CONC_CONNECTIONS] = { {0} };
 	uint8_t num_del = 0;
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	bool strict_follow_pcl = false;
 
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
@@ -3420,31 +3421,44 @@ QDF_STATUS policy_mgr_get_valid_chan_weights(struct wlan_objmgr_psoc *psoc,
 								   info,
 								   &num_del);
 		}
+		/*
+		 * For two port/three port connection strictly follow
+		 * PCL weight if coming intf is p2p GO/GC and existing
+		 * vdev is SAP/P2PGO/P2PGC.
+		 */
+		if ((mode == PM_P2P_GO_MODE || mode == PM_P2P_CLIENT_MODE) &&
+		    (policy_mgr_mode_specific_connection_count(
+						psoc, PM_SAP_MODE, NULL) ||
+		     policy_mgr_mode_specific_connection_count(
+						psoc, PM_P2P_GO_MODE, NULL) ||
+		     policy_mgr_mode_specific_connection_count(
+					psoc, PM_P2P_CLIENT_MODE, NULL)))
+			strict_follow_pcl = true;
+
 		/*
 		 * There is a small window between releasing the above lock
 		 * and acquiring the same in policy_mgr_allow_concurrency,
 		 * below!
 		 */
+
 		for (i = 0; i < weight->saved_num_chan; i++) {
-			if (policy_mgr_is_concurrency_allowed
+			/*
+			 * If channel is not allowed for concurrency, keep pcl
+			 * weight as 0 (WEIGHT_OF_DISALLOWED_CHANNELS)
+			 */
+			if (!policy_mgr_is_concurrency_allowed
 			    (psoc, mode, weight->saved_chan_list[i],
 			     HW_MODE_20_MHZ,
-			     policy_mgr_get_conc_ext_flags(vdev, false)) &&
-			     (policy_mgr_mode_specific_connection_count
-			      (psoc, PM_P2P_GO_MODE, NULL) ||
-			      (policy_mgr_mode_specific_connection_count
-			      (psoc, PM_P2P_CLIENT_MODE, NULL))) &&
-			      policy_mgr_go_scc_enforced(psoc))
-		/*
-		 * For two port/three port connection where if one p2p
-		 * connection is already present and force scc is enabled
-		 * then enforce Go negotiation channels to be strictly
-		 * based on PCL list.
-		 */
-				weight->weighed_valid_list[i] = 0;
-			else
-				weight->weighed_valid_list[i] =
-						WEIGHT_OF_NON_PCL_CHANNELS;
+			     policy_mgr_get_conc_ext_flags(vdev, false)))
+				continue;
+			/*
+			 * Keep weight 0 (WEIGHT_OF_DISALLOWED_CHANNELS) not
+			 * changed for scenarios which require to follow PCL.
+			 */
+			if (strict_follow_pcl)
+				continue;
+			weight->weighed_valid_list[i] =
+				WEIGHT_OF_NON_PCL_CHANNELS;
 		}
 		/* Restore the connection info */
 		if (mode == PM_STA_MODE)