Explorar el Código

qcacld-3.0: Add check for favorite channel while BSS start

Add check for QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL while
getting the sap mandatory frequency.

Change-Id: Ia1dfdfb0818ed94620295e3f4046fbe16b5a92d8
CRs-Fixed: 3301096
Anuj Khera hace 2 años
padre
commit
19bc73179e

+ 5 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -4438,7 +4438,8 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
 		sta_sap_scc_on_indoor_channel_allowed =
 			policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc);
 
-		if (sta_count &&
+		if (sta_count && cc_mode ==
+				QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL &&
 		    sta_sap_scc_on_indoor_channel_allowed &&
 		    ((wlan_reg_is_freq_indoor(pm_ctx->pdev, sap_ch_freq) &&
 		    WLAN_REG_IS_24GHZ_CH_FREQ(*intf_ch_freq)) ||
@@ -4458,7 +4459,9 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
 		user_config_freq =
 			policy_mgr_get_user_config_sap_freq(psoc, vdev_id);
 
-		if (WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
+		if (sta_count && cc_mode ==
+				QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL &&
+			WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
 		    user_config_freq &&
 		    !WLAN_REG_IS_24GHZ_CH_FREQ(user_config_freq) &&
 		    (wlan_reg_get_channel_state_for_pwrmode(

+ 13 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -3277,10 +3277,23 @@ policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc,
 	struct policy_mgr_pcl_list pcl;
 	uint32_t i;
 	uint32_t sap_new_freq;
+	uint8_t mcc_to_scc_switch;
+	uint8_t sta_count;
 	qdf_freq_t user_config_freq = 0;
 	bool sta_sap_scc_on_indoor_channel =
 		 policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc);
 
+	mcc_to_scc_switch =
+		policy_mgr_get_mcc_to_scc_switch_mode(psoc);
+
+	sta_count =
+		policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE,
+							  NULL);
+
+	if (!sta_count || mcc_to_scc_switch !=
+			QDF_MCC_TO_SCC_SWITCH_WITH_FAVORITE_CHANNEL)
+		return QDF_STATUS_E_FAILURE;
+
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
 		policy_mgr_err("Invalid Context");