Browse Source

qcacld-3.0: Keep SAP, P2P GO channel list modifications in separate APIs

Currently some channel list modifications for SAP and P2P GO mode
are present in policy_mgr_get_channel_list, whereas separate APIs for
SAP and P2P GO specific channel list modification are present, hence
keep all the mode specific channel list modifications in respective
APIs.

Change-Id: I393fbad12f29c761c1158fc5eb4ba0ebd6a660b6
CRs-Fixed: 3321108
Asutosh Mohapatra 2 years ago
parent
commit
7c4982851d

+ 55 - 91
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -2435,7 +2435,6 @@ get_sub_channels(struct wlan_objmgr_psoc *psoc,
  * @pcl_weights: pcl weight
  * @pcl_sz: pcl size
  * @index: pcl index
- * @skip_dfs_channel: to skip dfs channels or not
  * @skip_6gh_channel: to skip 6g channels or not
  * @chlist_5: 5g channel list
  * @chlist_len_5: 5g channel list length
@@ -2453,7 +2452,7 @@ 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,
-		      bool skip_dfs_channel, bool skip_6gh_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,
 		      enum policy_mgr_pcl_channel_order order,
@@ -2509,10 +2508,6 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 			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_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
@@ -2526,10 +2521,6 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 			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_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
@@ -2561,10 +2552,6 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 			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_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
@@ -2578,10 +2565,6 @@ add_sbs_chlist_to_pcl(struct wlan_objmgr_psoc *psoc,
 			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_OF_GROUP2_PCL_CHANNELS;
 			(*index)++;
@@ -2601,14 +2584,11 @@ add_chlist_to_pcl(struct wlan_objmgr_pdev *pdev,
 		  uint32_t *pcl_freqs, uint8_t *pcl_weights,
 		  uint32_t pcl_sz, uint32_t *index, uint32_t weight,
 		  const uint32_t *chlist, uint8_t chlist_len,
-		  bool skip_dfs_channel, bool skip_6gh_channel)
+		  bool skip_6gh_channel)
 {
 	uint32_t i;
 
 	for (i = 0; i < chlist_len && *index < pcl_sz; i++) {
-		if (skip_dfs_channel &&
-		    wlan_reg_is_dfs_for_freq(pdev, chlist[i]))
-			continue;
 		if (skip_6gh_channel &&
 		    WLAN_REG_IS_6GHZ_CHAN_FREQ(chlist[i]))
 			continue;
@@ -3109,7 +3089,6 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	uint32_t num_channels = 0;
 	uint32_t chan_index_24 = 0, chan_index_5 = 0, chan_index_6 = 0;
-	bool skip_dfs_channel = false;
 	uint32_t i = 0;
 	bool skip_6ghz_channel = false;
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
@@ -3164,20 +3143,11 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 		goto end;
 	}
 
-	if ((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE))
-		policy_mgr_skip_dfs_ch(psoc,
-				       &skip_dfs_channel);
-
 	/* Let's divide the list in 2.4 & 5 Ghz lists */
 	for (i = 0; i < num_channels; i++) {
 		if (wlan_reg_is_24ghz_ch_freq(channel_list[i])) {
 			channel_list_24[chan_index_24++] = channel_list[i];
 		} else if (wlan_reg_is_5ghz_ch_freq(channel_list[i])) {
-			if ((true == skip_dfs_channel) &&
-			    wlan_reg_is_dfs_for_freq(pm_ctx->pdev,
-						     channel_list[i]))
-				continue;
-
 			channel_list_5[chan_index_5++] = channel_list[i];
 		} else if (wlan_reg_is_6ghz_chan_freq(channel_list[i])) {
 			/* Add to 5G list until 6G conc support is enabled */
@@ -3246,7 +3216,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	case PM_MCC_CH:
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_NONE,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID1_ID2,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3256,7 +3226,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	case PM_MCC_CH_24G:
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_NONE,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID1_ID2,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3269,7 +3239,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	case PM_MCC_CH_5G:
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_NONE,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID1_ID2,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3287,7 +3257,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 					  channel_list_24, chan_index_24);
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_NONE,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID2_ID3,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3302,7 +3272,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 					 channel_list_6, chan_index_6);
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_NONE,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID3_ID4,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3312,7 +3282,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 		policy_mgr_get_connection_channels(
 					psoc, mode,
 					POLICY_MGR_PCL_ORDER_24G_THEN_5G,
-					skip_dfs_channel,
+					false,
 					POLICY_MGR_PCL_GROUP_ID1_ID2,
 					pcl_channels, pcl_weights, pcl_sz, len);
 		status = QDF_STATUS_SUCCESS;
@@ -3321,7 +3291,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 		policy_mgr_get_connection_channels(
 					psoc, mode,
 					POLICY_MGR_PCL_ORDER_5G_THEN_2G,
-					skip_dfs_channel,
+					false,
 					POLICY_MGR_PCL_GROUP_ID1_ID2,
 					pcl_channels, pcl_weights, pcl_sz, len);
 		status = QDF_STATUS_SUCCESS;
@@ -3330,7 +3300,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 		policy_mgr_get_connection_channels(
 					psoc, mode,
 					POLICY_MGR_PCL_ORDER_24G_THEN_5G,
-					skip_dfs_channel,
+					false,
 					POLICY_MGR_PCL_GROUP_ID1_ID2,
 					pcl_channels, pcl_weights, pcl_sz, len);
 		policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz,
@@ -3342,7 +3312,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 		policy_mgr_get_connection_channels(
 					psoc, mode,
 					POLICY_MGR_PCL_ORDER_24G_THEN_5G,
-					skip_dfs_channel,
+					false,
 					POLICY_MGR_PCL_GROUP_ID1_ID2,
 					pcl_channels, pcl_weights, pcl_sz, len);
 		policy_mgr_add_5g_to_pcl(psoc, pcl_channels, pcl_weights,
@@ -3367,7 +3337,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	case PM_SCC_ON_5_CH_5G:
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_5G,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID1_ID2,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3382,7 +3352,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 		policy_mgr_get_connection_channels(
 					psoc, mode,
 					POLICY_MGR_PCL_ORDER_5G_THEN_2G,
-					skip_dfs_channel,
+					false,
 					POLICY_MGR_PCL_GROUP_ID1_ID2,
 					pcl_channels, pcl_weights, pcl_sz, len);
 		policy_mgr_add_24g_to_pcl(pcl_channels, pcl_weights, pcl_sz,
@@ -3394,7 +3364,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 		policy_mgr_get_connection_channels(
 					psoc, mode,
 					POLICY_MGR_PCL_ORDER_5G_THEN_2G,
-					skip_dfs_channel,
+					false,
 					POLICY_MGR_PCL_GROUP_ID1_ID2,
 					pcl_channels, pcl_weights, pcl_sz, len);
 		policy_mgr_add_5g_to_pcl(psoc, pcl_channels, pcl_weights,
@@ -3407,7 +3377,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	case PM_SCC_ON_5_5G_24G:
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_5G,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID1_ID2,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3424,7 +3394,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	case PM_SCC_ON_5_5G_SCC_ON_24G:
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_5G,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID1_ID2,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3435,7 +3405,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 					 channel_list_6, chan_index_6);
 		policy_mgr_get_connection_channels(psoc, mode,
 						   POLICY_MGR_PCL_ORDER_2G,
-						   skip_dfs_channel,
+						   false,
 						   POLICY_MGR_PCL_GROUP_ID3_ID4,
 						   pcl_channels, pcl_weights,
 						   pcl_sz, len);
@@ -3453,17 +3423,17 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_24G_SCC_CH_SBS_CH_5G:
@@ -3477,22 +3447,22 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP4_PCL_CHANNELS,
 				  rest_freqs, rest_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_24G_SBS_CH_MCC_CH:
@@ -3506,17 +3476,17 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SBS_CH:
@@ -3530,12 +3500,12 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SBS_CH_5G:
@@ -3549,17 +3519,17 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  rest_freqs, rest_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SBS_CH_24G_SCC_CH:
@@ -3573,17 +3543,17 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SBS_CH_SCC_CH_24G:
@@ -3597,17 +3567,17 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SCC_CH_SBS_CH_24G:
@@ -3621,17 +3591,17 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SBS_CH_SCC_CH_5G_24G:
@@ -3645,22 +3615,22 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  rest_freqs, rest_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP4_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SCC_CH_MCC_CH_SBS_CH_24G:
@@ -3674,22 +3644,22 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  scc_freqs, scc_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  rest_freqs, rest_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP4_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SBS_CH_2G:
@@ -3703,18 +3673,18 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP1_PCL_CHANNELS,
 				  sbs_freqs, sbs_num,
-				  skip_dfs_channel, skip_6ghz_channel);
+				  skip_6ghz_channel);
 		add_chlist_to_pcl(pm_ctx->pdev,
 				  pcl_channels, pcl_weights, pcl_sz,
 				  len, WEIGHT_OF_GROUP2_PCL_CHANNELS,
 				  channel_list_24, chan_index_24,
-				  false, false);
+				  false);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SCC_ON_5G_LOW_5G_LOW_PLUS_SHARED_2G:
 		add_sbs_chlist_to_pcl(psoc,  pcl_channels,
 				      pcl_weights, pcl_sz,
-				      len, skip_dfs_channel,
+				      len,
 				      skip_6ghz_channel,
 				      channel_list_5, chan_index_5,
 				      channel_list_6, chan_index_6,
@@ -3734,13 +3704,13 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 					  pcl_channels, pcl_weights, pcl_sz,
 					  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 					  channel_list_24, chan_index_24,
-					  false, false);
+					  false);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	case PM_SCC_ON_5G_HIGH_5G_HIGH_PLUS_SHARED_2G:
 		add_sbs_chlist_to_pcl(psoc,  pcl_channels,
 				      pcl_weights, pcl_sz,
-				      len, skip_dfs_channel,
+				      len,
 				      skip_6ghz_channel,
 				      channel_list_5, chan_index_5,
 				      channel_list_6, chan_index_6,
@@ -3759,7 +3729,7 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 					  pcl_channels, pcl_weights, pcl_sz,
 					  len, WEIGHT_OF_GROUP3_PCL_CHANNELS,
 					  channel_list_24, chan_index_24,
-					  false, false);
+					  false);
 		status = QDF_STATUS_SUCCESS;
 		break;
 	default:
@@ -3772,12 +3742,6 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
 	policy_mgr_debug("pcl len %d and weight list sz %d",
 			 *len, pcl_sz);
 
-	/* check the channel avoidance list for beaconing entities */
-	if ((mode == PM_SAP_MODE) || (mode == PM_P2P_GO_MODE))
-		policy_mgr_update_with_safe_channel_list(psoc, pcl_channels,
-							 len, pcl_weights,
-							 pcl_sz);
-
 	policy_mgr_set_weight_of_dfs_passive_channels_to_zero(psoc,
 			pcl_channels, len, pcl_weights, pcl_sz);
 end:

+ 24 - 7
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -1073,7 +1073,7 @@ add_freq:
 static QDF_STATUS policy_mgr_pcl_modification_for_sap(
 			struct wlan_objmgr_psoc *psoc,
 			uint32_t *pcl_channels, uint8_t *pcl_weight,
-			uint32_t *len)
+			uint32_t *len, uint32_t weight_len)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
@@ -1087,6 +1087,10 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap(
 
 	pm_ctx = policy_mgr_get_context(psoc);
 
+	/* check the channel avoidance list for beaconing entities */
+	policy_mgr_update_with_safe_channel_list(psoc, pcl_channels,
+						 len, pcl_weight, weight_len);
+
 	if (policy_mgr_is_sap_mandatory_channel_set(psoc)) {
 		status = policy_mgr_modify_sap_pcl_based_on_mandatory_channel(
 				psoc, pcl_channels, pcl_weight, len);
@@ -1166,11 +1170,15 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap(
 static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go(
 			struct wlan_objmgr_psoc *psoc,
 			uint32_t *pcl_channels, uint8_t *pcl_weight,
-			uint32_t *len)
+			uint32_t *len, uint32_t weight_len)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	bool srd_chan_enabled;
 
+	/* check the channel avoidance list for beaconing entities */
+	policy_mgr_update_with_safe_channel_list(psoc, pcl_channels,
+						 len, pcl_weight, weight_len);
+
 	status = policy_mgr_modify_pcl_based_on_enabled_channels(
 			psoc, pcl_channels, pcl_weight, len);
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -1178,6 +1186,13 @@ static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go(
 		return status;
 	}
 
+	status = policy_mgr_modify_sap_pcl_based_on_dfs(
+			psoc, pcl_channels, pcl_weight, len);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		policy_mgr_err("failed to get dfs modified pcl for GO");
+		return status;
+	}
+
 	wlan_mlme_get_srd_master_mode_for_vdev(psoc, QDF_P2P_GO_MODE,
 					       &srd_chan_enabled);
 
@@ -1196,18 +1211,19 @@ static QDF_STATUS policy_mgr_pcl_modification_for_p2p_go(
 static QDF_STATUS policy_mgr_mode_specific_modification_on_pcl(
 			struct wlan_objmgr_psoc *psoc,
 			uint32_t *pcl_channels, uint8_t *pcl_weight,
-			uint32_t *len, enum policy_mgr_con_mode mode)
+			uint32_t *len, uint32_t weight_len,
+			enum policy_mgr_con_mode mode)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
 	switch (mode) {
 	case PM_SAP_MODE:
 		status = policy_mgr_pcl_modification_for_sap(
-			psoc, pcl_channels, pcl_weight, len);
+			psoc, pcl_channels, pcl_weight, len, weight_len);
 		break;
 	case PM_P2P_GO_MODE:
 		status = policy_mgr_pcl_modification_for_p2p_go(
-			psoc, pcl_channels, pcl_weight, len);
+			psoc, pcl_channels, pcl_weight, len, weight_len);
 		break;
 	case PM_STA_MODE:
 	case PM_P2P_CLIENT_MODE:
@@ -1383,7 +1399,7 @@ QDF_STATUS policy_mgr_get_pcl(struct wlan_objmgr_psoc *psoc,
 	policy_mgr_debug("PCL before modification");
 	policy_mgr_dump_channel_list(*len, pcl_channels, pcl_weight);
 	policy_mgr_mode_specific_modification_on_pcl(
-		psoc, pcl_channels, pcl_weight, len, mode);
+		psoc, pcl_channels, pcl_weight, len, weight_len, mode);
 
 	status = policy_mgr_modify_pcl_based_on_dnbs(psoc, pcl_channels,
 						pcl_weight, len);
@@ -3230,7 +3246,8 @@ QDF_STATUS policy_mgr_get_valid_chans_from_range(
 			ch_weight_len);
 
 	status = policy_mgr_mode_specific_modification_on_pcl(
-			psoc, ch_freq_list, ch_weight_list, ch_cnt, mode);
+			psoc, ch_freq_list, ch_weight_list, ch_cnt,
+			ch_weight_len, mode);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
 		policy_mgr_err("failed to get modified pcl for mode %d", mode);