Jelajahi Sumber

qcacld-3.0: Add 5 GHZ low/high SCC channel before rest 5 GHZ low/high

Currently in case of SBS, if two connections are on one mac and
one connection is on another mac new connection can come up only
on 5 GHZ Low/5 GHZ high based on the mac that can support new connection.
But weightage of all 5 GHZ low/high channel is marked same instead of
prioritizing SCC channel.

Fix is to provide more weightage to 5 GHZ low/high SCC channel than
rest 5 GHZ low/high channels.

Also Optimize few logs.

Change-Id: I4153b209e6a74fe79081116baecaae78be5b632b
CRs-Fixed: 3204041
Sheenam Monga 2 tahun lalu
induk
melakukan
cbf4fda0d5

+ 13 - 8
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h

@@ -183,8 +183,10 @@ enum policy_mgr_pcl_group_id {
  * @POLICY_MGR_PCL_ORDER_5G_THEN_2G: 5 Ghz channel followed by 2.4 Ghz channel
  * @POLICY_MGR_PCL_ORDER_2G: 2G channels
  * @POLICY_MGR_PCL_ORDER_5G: 5G channels
- * @POLICY_MGR_PCL_ORDER_5G_LOW : 5G low band i.e 5G freq < sbs cutoff freq
- * @POLICY_MGR_PCL_ORDER_5G_HIGH : 5G High band i.e 5G freq > sbs cutoff freq
+ * @POLICY_MGR_PCL_ORDER_SCC_5G_LOW_5G_LOW: 5G Low SCC frequency followed by
+ * 5G low band i.e 5G freq < sbs cutoff freq
+ * @POLICY_MGR_PCL_ORDER_SCC_5G_HIGH_5G_HIGH: 5G High SCC frequency followed by
+ * 5G High band i.e 5G freq > sbs cutoff freq
  *
  * Order in which the PCL is requested
  */
@@ -194,8 +196,8 @@ enum policy_mgr_pcl_channel_order {
 	POLICY_MGR_PCL_ORDER_5G_THEN_2G,
 	POLICY_MGR_PCL_ORDER_2G,
 	POLICY_MGR_PCL_ORDER_5G,
-	POLICY_MGR_PCL_ORDER_5G_LOW,
-	POLICY_MGR_PCL_ORDER_5G_HIGH,
+	POLICY_MGR_PCL_ORDER_SCC_5G_LOW_5G_LOW,
+	POLICY_MGR_PCL_ORDER_SCC_5G_HIGH_5G_HIGH,
 };
 
 /**
@@ -341,8 +343,11 @@ enum policy_mgr_mac_use {
  *      SBS channels & rest of the 5G channels
  * @PM_24G_SBS_CH_MCC_CH: 2.4 Ghz channels, SBS channels & MCC channels
  * @PM_SBS_CH_2G: SBS channels & 2.4 Ghz channels
- * @PM_CH_5G_LOW: 5G frequencies < sbs cut off freq
- * @PM_CH_5G_HIGH: 5G frequencies > sbs cut off freq
+ * @PM_SCC_ON_5G_LOW_5G_LOW: 5G low SCC channel followed by
+ * 5G frequencies < sbs cut off freq
+ * @PM_SCC_ON_5G_HIGH_5G_HIGH: 5G high SCC channel followed by
+ * frequencies > sbs cut off freq
+ *
  * @PM_MAX_PCL_TYPE: Max place holder
  *
  * These are generic IDs that identify the various roles
@@ -383,8 +388,8 @@ enum policy_mgr_pcl_type {
 	PM_SBS_CH_SCC_CH_5G_24G,
 	PM_SCC_CH_MCC_CH_SBS_CH_24G,
 	PM_SBS_CH_2G,
-	PM_CH_5G_LOW,
-	PM_CH_5G_HIGH,
+	PM_SCC_ON_5G_LOW_5G_LOW,
+	PM_SCC_ON_5G_HIGH_5G_HIGH,
 
 	PM_MAX_PCL_TYPE
 };

+ 77 - 18
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -2319,7 +2319,6 @@ get_sub_channels(struct wlan_objmgr_psoc *psoc,
  * @pcl_weights: pcl weight
  * @pcl_sz: pcl size
  * @index: pcl index
- * @weight: provided weight for pcl list
  * @skip_dfs_channel: to skip dfs channels or not
  * @skip_6gh_channel: to skip 6g channels or not
  * @chlist_5: 5g channel list
@@ -2335,7 +2334,7 @@ get_sub_channels(struct wlan_objmgr_psoc *psoc,
 static void
 add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 		      uint32_t *pcl_freqs, uint8_t *pcl_weights,
-		      uint32_t pcl_sz, uint32_t *index, uint32_t weight,
+		      uint32_t pcl_sz, uint32_t *index,
 		      bool skip_dfs_channel, bool skip_6gh_channel,
 		      const uint32_t *chlist_5, uint8_t chlist_len_5,
 		      const uint32_t *chlist_6, uint8_t chlist_len_6,
@@ -2343,28 +2342,58 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 {
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
 	qdf_freq_t sbs_cut_off_freq;
-	uint32_t i;
+	qdf_freq_t scc_freq = 0;
+	uint32_t i, conn_index = 0;
+	struct policy_mgr_conc_connection_info *cl;
 
 	if (!policy_mgr_is_hw_sbs_capable(psoc))
 		return;
 
+	sbs_cut_off_freq = policy_mgr_get_sbs_cut_off_freq(psoc);
+	if (!sbs_cut_off_freq) {
+		policy_mgr_err("Invalid cut off freq");
+		return;
+	}
+
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
 		policy_mgr_err("Invalid Context");
 		return;
 	}
-	sbs_cut_off_freq = policy_mgr_get_sbs_cut_off_freq(psoc);
-	if (order == POLICY_MGR_PCL_ORDER_5G_LOW) {
+
+	if (order == POLICY_MGR_PCL_ORDER_SCC_5G_LOW_5G_LOW) {
+		/* Add 5G low SCC channel*/
+		qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
+		cl = pm_conc_connection_list;
+		while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
+			if (!WLAN_REG_IS_24GHZ_CH_FREQ(cl[conn_index].freq) &&
+			    cl[conn_index].freq < sbs_cut_off_freq) {
+				pcl_freqs[*index] = cl[conn_index].freq;
+				scc_freq = cl[conn_index].freq;
+				pcl_weights[*index] =
+						WEIGHT_OF_GROUP1_PCL_CHANNELS;
+				(*index)++;
+				break;
+			}
+
+			conn_index++;
+		}
+		qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+		/* Add rest 5G low channels*/
 		for (i = 0; i < chlist_len_5 && *index < pcl_sz; i++) {
 			if (chlist_5[i] > sbs_cut_off_freq)
 				return;
 
+			/* SCC channel is already added in pcl freq*/
+			if (scc_freq == chlist_5[i])
+				continue;
+
 			if (skip_dfs_channel &&
 			    wlan_reg_is_dfs_for_freq(pm_ctx->pdev, chlist_5[i]))
 				continue;
 
 			pcl_freqs[*index] = chlist_5[i];
-			pcl_weights[*index] = weight;
+			pcl_weights[*index] = WEIGHT_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
 		}
 		for (i = 0; i < chlist_len_6 && *index < pcl_sz &&
@@ -2372,25 +2401,50 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 			if (chlist_6[i] > sbs_cut_off_freq)
 				return;
 
+			/* SCC channel is already added in pcl freq*/
+			if (scc_freq == chlist_6[i])
+				continue;
+
 			if (skip_dfs_channel &&
 			    wlan_reg_is_dfs_for_freq(pm_ctx->pdev, chlist_6[i]))
 				continue;
 
 			pcl_freqs[*index] = chlist_6[i];
-			pcl_weights[*index] = weight;
+			pcl_weights[*index] = WEIGHT_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
 		}
-	} else if (order == POLICY_MGR_PCL_ORDER_5G_HIGH) {
+	} else if (order == POLICY_MGR_PCL_ORDER_SCC_5G_HIGH_5G_HIGH) {
+		/* Add 5G high SCC channel*/
+		qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
+		cl = pm_conc_connection_list;
+		while (PM_CONC_CONNECTION_LIST_VALID_INDEX(conn_index)) {
+			if (!WLAN_REG_IS_24GHZ_CH_FREQ(cl[conn_index].freq) &&
+			    cl[conn_index].freq > sbs_cut_off_freq) {
+				pcl_freqs[*index] = cl[conn_index].freq;
+				scc_freq = cl[conn_index].freq;
+				pcl_weights[*index] =
+					WEIGHT_OF_GROUP1_PCL_CHANNELS;
+				(*index)++;
+				break;
+			}
+
+			conn_index++;
+		}
+		qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+		/* Add rest 5G high channels*/
 		for (i = 0; i < chlist_len_5 && *index < pcl_sz; i++) {
 			if (chlist_5[i] < sbs_cut_off_freq)
 				continue;
+			/* SCC channel is already added in pcl freq*/
+			if (scc_freq == chlist_5[i])
+				continue;
 
 			if (skip_dfs_channel &&
 			    wlan_reg_is_dfs_for_freq(pm_ctx->pdev, chlist_5[i]))
 				continue;
 
 			pcl_freqs[*index] = chlist_5[i];
-			pcl_weights[*index] = weight;
+			pcl_weights[*index] = WEIGHT_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
 		}
 		for (i = 0; i < chlist_len_6 && *index < pcl_sz &&
@@ -2398,12 +2452,16 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 			if (chlist_6[i] < sbs_cut_off_freq)
 				return;
 
+			/* SCC channel is already added in pcl freq*/
+			if (scc_freq == chlist_6[i])
+				continue;
+
 			if (skip_dfs_channel &&
 			    wlan_reg_is_dfs_for_freq(pm_ctx->pdev, chlist_6[i]))
 				continue;
 
 			pcl_freqs[*index] = chlist_6[i];
-			pcl_weights[*index] = weight;
+			pcl_weights[*index] = WEIGHT_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
 		}
 
@@ -2413,6 +2471,7 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 	}
 
 	policy_mgr_debug("new pcl index %d", *index);
+
 }
 
 static void
@@ -3470,23 +3529,23 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  false, false);
 		status = QDF_STATUS_SUCCESS;
 		break;
-	case PM_CH_5G_LOW:
+	case PM_SCC_ON_5G_LOW_5G_LOW:
 		add_sbs_chlist_to_pcl(psoc,  pcl_channels,
 				      pcl_weights, pcl_sz,
-				      len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
-				      skip_dfs_channel, skip_6ghz_channel,
+				      len, skip_dfs_channel,
+				      skip_6ghz_channel,
 				      channel_list_5, chan_index_5,
 				      channel_list_6, chan_index_6,
-				      POLICY_MGR_PCL_ORDER_5G_LOW);
+				      POLICY_MGR_PCL_ORDER_SCC_5G_LOW_5G_LOW);
 		break;
-	case PM_CH_5G_HIGH:
+	case PM_SCC_ON_5G_HIGH_5G_HIGH:
 		add_sbs_chlist_to_pcl(psoc,  pcl_channels,
 				      pcl_weights, pcl_sz,
-				      len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
-				      skip_dfs_channel, skip_6ghz_channel,
+				      len, skip_dfs_channel,
+				      skip_6ghz_channel,
 				      channel_list_5, chan_index_5,
 				      channel_list_6, chan_index_6,
-				      POLICY_MGR_PCL_ORDER_5G_HIGH);
+				      POLICY_MGR_PCL_ORDER_SCC_5G_HIGH_5G_HIGH);
 		break;
 	default:
 		policy_mgr_err("unknown pcl value %d", pcl);

+ 12 - 6
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -1484,9 +1484,9 @@ bool policy_mgr_2_freq_always_on_same_mac(struct wlan_objmgr_psoc *psoc,
 			policy_mgr_2_freq_same_mac_in_sbs(pm_ctx, freq_1,
 							  freq_2);
 
-	policy_mgr_debug("freq1 %d freq2 %d: Same mac:: DBS:%d SBS:%d",
-			 freq_1, freq_2, is_dbs_mode_same_mac,
-			 is_sbs_mode_same_mac);
+	policy_mgr_rl_debug("freq1 %d freq2 %d: Same mac:: DBS:%d SBS:%d",
+			    freq_1, freq_2, is_dbs_mode_same_mac,
+			    is_sbs_mode_same_mac);
 	/*
 	 * if in SBS and DBS mode, both is leading to freqs on same mac,
 	 * return true else return false.
@@ -1629,9 +1629,9 @@ policy_mgr_3_freq_always_on_same_mac(struct wlan_objmgr_psoc *psoc,
 			policy_mgr_3_freq_same_mac_in_sbs(pm_ctx, freq_1,
 							  freq_2, freq_3);
 
-	policy_mgr_debug("freq1 %d freq2 %d freq3 %d: Same mac:: DBS:%d SBS:%d",
-			 freq_1, freq_2, freq_3, is_dbs_mode_same_mac,
-			 is_sbs_mode_same_mac);
+	policy_mgr_rl_debug("freq1 %d freq2 %d freq3 %d: Same mac:: DBS:%d SBS:%d",
+			    freq_1, freq_2, freq_3, is_dbs_mode_same_mac,
+			    is_sbs_mode_same_mac);
 	/*
 	 * if in SBS and DBS mode, both is leading to freqs on same mac,
 	 * return true else return false.
@@ -5088,6 +5088,12 @@ policy_mgr_handle_sap_cli_go_ml_sta_up_csa(struct wlan_objmgr_psoc *psoc,
 		goto enable_link;
 	}
 
+	if (num_disabled_ml_sta) {
+		policy_mgr_debug("As a link is already disabled and affected link present (%d), No action required",
+				 num_affected_link);
+		return;
+	}
+
 	wlan_mlo_sta_mlo_concurency_set_link(vdev,
 					     MLO_LINK_FORCE_REASON_CONNECT,
 					     MLO_LINK_FORCE_MODE_ACTIVE_NUM,

+ 2 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -3333,8 +3333,8 @@ bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc,
 	case PM_5G_MCC_CH:
 	case PM_24G_SBS_CH_MCC_CH:
 	case PM_SBS_CH_2G:
-	case PM_CH_5G_LOW:
-	case PM_CH_5G_HIGH:
+	case PM_SCC_ON_5G_LOW_5G_LOW:
+	case PM_SCC_ON_5G_HIGH_5G_HIGH:
 		ret = true;
 		break;
 	default:

+ 6 - 3
components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h

@@ -1996,11 +1996,14 @@ fourth_connection_pcl_dbs_sbs_table
 	[PM_SAP_MODE] = { PM_SCC_ON_5_CH_5G, PM_SCC_ON_5_CH_5G,
 			 PM_SCC_ON_5_CH_5G} },
 	[PM_STA_SAP_5_STA_24_DBS] = {
-	[PM_SAP_MODE] = { PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G } },
+	[PM_SAP_MODE] = { PM_SBS_CH_2G, PM_SBS_CH_2G,
+			  PM_SBS_CH_2G } },
 	[PM_STA_STA_SAP_MCC_SCC_5G_HIGH_PLUS_5_LOW_SBS] = {
-	[PM_SAP_MODE] = {PM_CH_5G_LOW, PM_CH_5G_LOW, PM_CH_5G_LOW} },
+	[PM_SAP_MODE] = {PM_SCC_ON_5G_LOW_5G_LOW, PM_SCC_ON_5G_LOW_5G_LOW,
+			 PM_SCC_ON_5G_LOW_5G_LOW} },
 	[PM_STA_STA_SAP_MCC_SCC_5G_LOW_PLUS_5_HIGH_SBS] = {
-	[PM_SAP_MODE] = {PM_CH_5G_HIGH, PM_CH_5G_HIGH, PM_CH_5G_HIGH} },
+	[PM_SAP_MODE] = {PM_SCC_ON_5G_HIGH_5G_HIGH, PM_SCC_ON_5G_HIGH_5G_HIGH,
+			 PM_SCC_ON_5G_HIGH_5G_HIGH} },
 };
 #endif
 #endif