Parcourir la source

qcacld-3.0: Allow SAP+P2P GO+STA SCC on same band

If SAP+P2P GO SCC on 2.4 GHz, the new STA interface will be
allowed connect to AP on 2.4 GHz SCC channel of SAP/GO or
5/6 GHz band AP. And do same for 5 GHz band.
For 3rd SAP/P2P GO coming up, try to force SCC to
existing same band SAP/GO home channel if any, to avoid the
concurrency check failure.

Change-Id: I363e9c8307ac4cfa70d6d00bc0d01a545c3eca26
CRs-Fixed: 3249205
Liangwei Dong il y a 2 ans
Parent
commit
ba8cf63a22

+ 10 - 2
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -4452,6 +4452,7 @@ bool policy_mgr_is_hwmode_offload_enabled(struct wlan_objmgr_psoc *psoc);
  * list for third connection
  * @psoc: PSOC object information
  * @mode: Device mode
+ * @ch_freq: 3rd channel frequency
  *
  * This function checks whether to allow third connection on same band or not
  * based on pcl table
@@ -4459,7 +4460,8 @@ bool policy_mgr_is_hwmode_offload_enabled(struct wlan_objmgr_psoc *psoc);
  * Return: TRUE/FALSE
  */
 bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc,
-						 enum policy_mgr_con_mode mode);
+						 enum policy_mgr_con_mode mode,
+						 qdf_freq_t ch_freq);
 
 /**
  * policy_mgr_get_connected_roaming_vdev_band_mask() - get connected vdev
@@ -4488,7 +4490,10 @@ bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
 /**
  * policy_mgr_is_ap_ap_mcc_allow() - Check AP AP MCC allow or not
  * @psoc: psoc object
+ * @pdev: pdev object
  * @vdev: vdev object of new SAP or P2P GO
+ * @ch_freq: channel frequency of up coming vdev
+ * @ch_wdith: channel width
  *
  * Check if AP AP MCC allow or not when new SAP or P2P GO creating
  *
@@ -4496,7 +4501,10 @@ bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
  *         False otherwise.
  */
 bool policy_mgr_is_ap_ap_mcc_allow(struct wlan_objmgr_psoc *psoc,
-				   struct wlan_objmgr_vdev *vdev);
+				   struct wlan_objmgr_pdev *pdev,
+				   struct wlan_objmgr_vdev *vdev,
+				   uint32_t ch_freq,
+				   enum phy_ch_width ch_wdith);
 
 /**
  * policy_mgr_any_other_vdev_on_same_mac_as_freq() - Function to check

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

@@ -3887,10 +3887,11 @@ bool policy_mgr_allow_same_mac_same_freq(struct wlan_objmgr_psoc *psoc,
 		 * and therefore a 3rd connection with the
 		 * same MAC is possible.
 		 */
-	} else if (policy_mgr_2_freq_always_on_same_mac(psoc, ch_freq,
-					pm_conc_connection_list[0].freq) &&
-		   !policy_mgr_is_3rd_conn_on_same_band_allowed(psoc, mode)) {
-			policy_mgr_rl_debug("don't allow 3rd home channel on same MAC – for sta+multi-AP");
+	} else if (policy_mgr_2_freq_always_on_same_mac(
+			psoc, ch_freq, pm_conc_connection_list[0].freq) &&
+		   !policy_mgr_is_3rd_conn_on_same_band_allowed(
+			psoc, mode, ch_freq)) {
+			policy_mgr_rl_debug("don't allow 3rd home channel on same MAC for sta+multi-AP");
 			allow = false;
 	}
 

+ 27 - 4
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -8653,19 +8653,42 @@ bool policy_mgr_is_hwmode_offload_enabled(struct wlan_objmgr_psoc *psoc)
 }
 
 bool policy_mgr_is_ap_ap_mcc_allow(struct wlan_objmgr_psoc *psoc,
-				   struct wlan_objmgr_vdev *vdev)
+				   struct wlan_objmgr_pdev *pdev,
+				   struct wlan_objmgr_vdev *vdev,
+				   uint32_t ch_freq,
+				   enum phy_ch_width ch_wdith)
 {
 	enum QDF_OPMODE mode;
+	enum policy_mgr_con_mode con_mode;
 	uint8_t mcc_to_scc_switch;
+	uint32_t num_connections;
+	bool is_dfs_ch = false;
 
-	if (!psoc || !vdev) {
-		policy_mgr_debug("psoc or vdev is NULL");
+	if (!psoc || !vdev || !pdev) {
+		policy_mgr_debug("psoc or vdev or pdev is NULL");
 		return false;
 	}
 
 	mode = wlan_vdev_mlme_get_opmode(vdev);
-	policy_mgr_get_mcc_scc_switch(psoc, &mcc_to_scc_switch);
+	con_mode = policy_mgr_convert_device_mode_to_qdf_type(mode);
+	if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq) &&
+	    wlan_reg_get_5g_bonded_channel_state_for_freq(
+			pdev, ch_freq, ch_wdith) == CHANNEL_STATE_DFS)
+		is_dfs_ch = true;
+	/*
+	 * For 3Vif concurrency we only support SCC in same MAC
+	 * in below combination:
+	 * 2 beaconing entities with STA in SCC.
+	 * 3 beaconing entities in SCC.
+	 */
+	num_connections = policy_mgr_get_connection_count(psoc);
+	if (num_connections > 1 &&
+	    (mode == QDF_P2P_GO_MODE || mode == QDF_SAP_MODE) &&
+	    !policy_mgr_allow_new_home_channel(psoc, con_mode, ch_freq,
+					       num_connections, is_dfs_ch))
+		return false;
 
+	policy_mgr_get_mcc_scc_switch(psoc, &mcc_to_scc_switch);
 	if (mode == QDF_P2P_GO_MODE &&
 	    policy_mgr_is_p2p_p2p_conc_supported(psoc))
 		return true;

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

@@ -3682,7 +3682,8 @@ QDF_STATUS policy_mgr_filter_passive_ch(struct wlan_objmgr_pdev *pdev,
 }
 
 bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc,
-						 enum policy_mgr_con_mode mode)
+						 enum policy_mgr_con_mode mode,
+						 qdf_freq_t ch_freq)
 {
 	enum policy_mgr_pcl_type pcl = PM_NONE;
 	enum policy_mgr_conc_priority_mode conc_system_pref = 0;
@@ -3696,6 +3697,16 @@ bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc,
 			return false;
 	}
 
+	if (pm_conc_connection_list[0].freq != ch_freq ||
+	    pm_conc_connection_list[0].freq !=
+				pm_conc_connection_list[1].freq) {
+		policy_mgr_debug("No MCC support in 3vif in same mac: %d %d %d",
+				 pm_conc_connection_list[0].freq,
+				 pm_conc_connection_list[1].freq,
+				 ch_freq);
+		return false;
+	}
+
 	policy_mgr_debug("pref:%d requested mode:%d",
 			 pm_ctx->cur_conc_system_pref, mode);
 
@@ -3729,7 +3740,9 @@ bool policy_mgr_is_3rd_conn_on_same_band_allowed(struct wlan_objmgr_psoc *psoc,
 			[third_index][mode][conc_system_pref];
 	}
 
-	policy_mgr_debug("pcl for third connection is %d", pcl);
+	policy_mgr_debug("pcl for third connection mode %s is %d %s",
+			 device_mode_to_string(mode), pcl,
+			 pcl_type_to_string(pcl));
 	switch (pcl) {
 	case PM_SCC_CH:
 	case PM_SCC_CH_24G:

+ 18 - 12
components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_sbs_i.h

@@ -233,7 +233,7 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 	[PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G},
 	[PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G},
-	[PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G},
+	[PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_NAN_DISC_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
 	[PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} },
@@ -242,7 +242,7 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 	[PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G},
 	[PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G},
-	[PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G},
+	[PM_P2P_GO_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_NAN_DISC_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
 	[PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} },
@@ -270,7 +270,8 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 		PM_24G_SCC_CH_SBS_CH},
 	[PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G},
 	[PM_P2P_CLIENT_MODE] = {PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
-	[PM_P2P_GO_MODE] = {PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
+	[PM_P2P_GO_MODE] = {PM_SBS_CH_24G_SCC_CH, PM_SBS_CH_24G_SCC_CH,
+			    PM_SBS_CH_24G_SCC_CH},
 	[PM_NAN_DISC_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
 	[PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} },
@@ -280,7 +281,8 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 		PM_24G_SCC_CH_SBS_CH},
 	[PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G},
 	[PM_P2P_CLIENT_MODE] = {PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
-	[PM_P2P_GO_MODE] = {PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
+	[PM_P2P_GO_MODE] = {PM_SBS_CH_24G_SCC_CH, PM_SBS_CH_24G_SCC_CH,
+			    PM_SBS_CH_24G_SCC_CH},
 	[PM_NAN_DISC_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
 	[PM_NDI_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE} },
@@ -561,7 +563,7 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 	[PM_STA_P2P_GO_SCC_24_1x1] = {
 		[PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE,
 		PM_MAX_PCL_TYPE},
-	[PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G},
+	[PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_P2P_CLIENT_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
 	[PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G},
@@ -571,7 +573,7 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 
 	[PM_STA_P2P_GO_SCC_24_2x2] = {
 	[PM_STA_MODE] = {PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
-	[PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G},
+	[PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_P2P_CLIENT_MODE] = {PM_5G, PM_5G, PM_5G},
 	[PM_P2P_GO_MODE] = {PM_5G, PM_5G, PM_5G},
 	[PM_NAN_DISC_MODE] = {
@@ -601,7 +603,8 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 	[PM_STA_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
 	[PM_SAP_MODE] = {
-		PM_SBS_CH_2G, PM_24G, PM_24G},
+		PM_SBS_CH_24G_SCC_CH, PM_SBS_CH_24G_SCC_CH,
+		PM_SBS_CH_24G_SCC_CH},
 	[PM_P2P_CLIENT_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
 	[PM_P2P_GO_MODE] = {PM_24G, PM_24G, PM_24G},
@@ -612,7 +615,8 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 	[PM_STA_P2P_GO_SCC_5_2x2] = {
 	[PM_STA_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
-	[PM_SAP_MODE] = {PM_SBS_CH_2G, PM_24G, PM_24G},
+	[PM_SAP_MODE] = {PM_SBS_CH_24G_SCC_CH, PM_SBS_CH_24G_SCC_CH,
+			 PM_SBS_CH_24G_SCC_CH},
 	[PM_P2P_CLIENT_MODE] = {PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
 	[PM_P2P_GO_MODE] = {PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
 	[PM_NAN_DISC_MODE] = {
@@ -713,7 +717,7 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 
 	[PM_P2P_GO_SAP_SCC_24_1x1] = {
 	[PM_STA_MODE] = {
-		PM_5G, PM_5G, PM_5G},
+		PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G},
 	[PM_P2P_CLIENT_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
@@ -725,7 +729,7 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 
 	[PM_P2P_GO_SAP_SCC_24_2x2] = {
 	[PM_STA_MODE] = {
-		PM_5G, PM_5G, PM_5G},
+		PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH},
 	[PM_SAP_MODE] = {PM_5G, PM_5G, PM_5G},
 	[PM_P2P_CLIENT_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
@@ -761,7 +765,8 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 
 	[PM_P2P_GO_SAP_SCC_5_1x1] = {
 	[PM_STA_MODE] = {
-		PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
+		PM_SBS_CH_24G_SCC_CH, PM_SBS_CH_24G_SCC_CH,
+		PM_SBS_CH_24G_SCC_CH},
 	[PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G},
 	[PM_P2P_CLIENT_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},
@@ -773,7 +778,8 @@ pm_third_connection_pcl_dbs_sbs_2x2_table = {
 
 	[PM_P2P_GO_SAP_SCC_5_2x2] = {
 	[PM_STA_MODE] = {
-		PM_SBS_CH_2G, PM_SBS_CH_2G, PM_SBS_CH_2G},
+		PM_SBS_CH_24G_SCC_CH, PM_SBS_CH_24G_SCC_CH,
+		PM_SBS_CH_24G_SCC_CH},
 	[PM_SAP_MODE] = {PM_24G, PM_24G, PM_24G},
 	[PM_P2P_CLIENT_MODE] = {
 		PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE, PM_MAX_PCL_TYPE},

+ 3 - 1
core/hdd/src/wlan_hdd_hostapd.c

@@ -7038,7 +7038,9 @@ wlan_hdd_is_ap_ap_force_scc_override(struct hdd_adapter *adapter,
 		hdd_err("failed to get vdev");
 		return false;
 	}
-	if (policy_mgr_is_ap_ap_mcc_allow(hdd_ctx->psoc, vdev)) {
+	if (policy_mgr_is_ap_ap_mcc_allow(
+			hdd_ctx->psoc, hdd_ctx->pdev, vdev, freq,
+			hdd_map_nl_chan_width(chandef->width))) {
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
 		return false;
 	}