ソースを参照

qcacld-3.0: Support STA/GC/SAP/GO/ML-STA plus ll SAP concurrency

If there is existing interface STA/GC/SAP/GO/ML STA and
low latency SAP tries to come then allow only if below
condition satisfies
1. DBS hw_mode: Allow if existing interface is on 2.4 GHz
channel otherwise reject.
2. SBS hw_mode: Allow if existing interface channel and low
latency SAP channel are mutually exclusive.

Change-Id: I67a883b89f63fa581379cb303da6c11b43e65912
CRs-Fixed: 3296640
Jyoti Kumari 2 年 前
コミット
47e5799911

+ 34 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -1502,6 +1502,40 @@ policy_mgr_change_hw_mode_sta_connect(struct wlan_objmgr_psoc *psoc,
 bool policy_mgr_is_dbs_allowed_for_concurrency(
 		struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE new_conn_mode);
 
+/**
+ * policy_mgr_get_pcl_chlist_for_ll_sap() - Get pcl channel list for LL SAP
+ * @psoc: PSOC object information
+ * @mode: Device mode
+ * @vdev_id: Vdev id
+ * @pcl_channels: Preferred channel freq list
+ * @pcl_weight: Weights of the PCL
+ * @len: length of the PCL
+ *
+ * This function provides the preferred channel list on which the ll sap
+ * can come.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+policy_mgr_get_pcl_chlist_for_ll_sap(struct wlan_objmgr_psoc *psoc,
+				     enum policy_mgr_con_mode mode,
+				     uint32_t vdev_id, uint32_t *pcl_channels,
+				     uint8_t *pcl_weight, uint32_t *len);
+
+/**
+ * policy_mgr_is_ll_sap_present_in_current_mode() - Check whether LL SAP is
+ * present in current mode or not.
+ * @psoc: psoc object
+ * @mode: device mode
+ * @vdev_id: vdev id
+ *
+ * Return: true if it's present otherwise false
+ */
+bool
+policy_mgr_is_ll_sap_present_in_current_mode(struct wlan_objmgr_psoc *psoc,
+					     enum policy_mgr_con_mode mode,
+					     uint32_t vdev_id);
+
 /**
  * policy_mgr_get_preferred_dbs_action_table() - get dbs action table type
  * @psoc: Pointer to psoc

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

@@ -3853,3 +3853,103 @@ bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
 
 	return true;
 }
+
+bool
+policy_mgr_is_ll_sap_present_in_current_mode(struct wlan_objmgr_psoc *psoc,
+					     enum policy_mgr_con_mode curr_mode,
+					     uint32_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	bool is_ll_sap = false;
+	enum host_concurrent_ap_policy profile =
+					HOST_CONCURRENT_AP_POLICY_UNSPECIFIED;
+	if (curr_mode != PM_SAP_MODE)
+		return is_ll_sap;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_POLICY_MGR_ID);
+	if (!vdev) {
+		policy_mgr_err("vdev %d: invalid vdev", vdev_id);
+		return is_ll_sap;
+	}
+
+	profile = wlan_mlme_get_ap_policy(vdev);
+	if (profile == HOST_CONCURRENT_AP_POLICY_GAMING_AUDIO ||
+	    profile == HOST_CONCURRENT_AP_POLICY_LOSSLESS_AUDIO_STREAMING)
+		is_ll_sap = true;
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
+	return is_ll_sap;
+}
+
+QDF_STATUS
+policy_mgr_get_pcl_chlist_for_ll_sap(struct wlan_objmgr_psoc *psoc,
+				     enum policy_mgr_con_mode curr_mode,
+				     uint32_t vdev_id, uint32_t *pcl_channels,
+				     uint8_t *pcl_weight, uint32_t *len)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	uint32_t pcl_len = 0, i, conn_idx = 0;
+	uint32_t pcl_list[NUM_CHANNELS], total_connection = 0;
+	uint8_t weight_list[NUM_CHANNELS];
+	qdf_freq_t freq;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("pm_ctx is null");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!policy_mgr_is_ll_sap_present_in_current_mode(psoc, curr_mode,
+							  vdev_id)) {
+		policy_mgr_debug("LL SAP is not present in current mode %d",
+				 curr_mode);
+		return QDF_STATUS_SUCCESS;
+	}
+
+	total_connection = policy_mgr_get_connection_count(psoc);
+	if (!total_connection && curr_mode == PM_SAP_MODE) {
+		for (i = 0; i < *len; i++) {
+			if (WLAN_REG_IS_24GHZ_CH_FREQ(pcl_channels[i]))
+				continue;
+
+			pcl_list[pcl_len] = pcl_channels[i];
+			weight_list[pcl_len++] = pcl_weight[i];
+		}
+		qdf_mem_zero(pcl_channels, *len * sizeof(*pcl_channels));
+		qdf_mem_copy(pcl_channels, pcl_list,
+			     pcl_len * sizeof(*pcl_channels));
+	} else {
+		qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
+		for (conn_idx = 0; conn_idx < MAX_NUMBER_OF_CONC_CONNECTIONS;
+		     conn_idx++) {
+			if (!pm_conc_connection_list[conn_idx].in_use)
+				continue;
+
+			freq = pm_conc_connection_list[conn_idx].freq;
+
+			for (i = 0; i < *len; i++) {
+				if (policy_mgr_2_freq_always_on_same_mac(
+								psoc,
+								pcl_channels[i],
+								freq) ||
+				    WLAN_REG_IS_24GHZ_CH_FREQ(pcl_channels[i]))
+					continue;
+				pcl_list[pcl_len] = pcl_channels[i];
+				weight_list[pcl_len++] = pcl_weight[i];
+			}
+			*len = pcl_len;
+			qdf_mem_zero(pcl_channels,
+				     *len * sizeof(*pcl_channels));
+			qdf_mem_copy(pcl_channels, pcl_list,
+				     pcl_len * sizeof(*pcl_channels));
+		}
+		qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+	}
+
+	qdf_mem_zero(pcl_weight, *len * sizeof(*pcl_weight));
+	qdf_mem_copy(pcl_weight, weight_list, pcl_len);
+	*len = pcl_len;
+
+	return QDF_STATUS_SUCCESS;
+}

+ 11 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -3728,6 +3728,12 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 					pcl_channels_weight_list,
 					NUM_CHANNELS);
 
+	policy_mgr_get_pcl_chlist_for_ll_sap(
+				hdd_ctx->psoc, pm_mode, adapter->vdev_id,
+				sap_config->acs_cfg.pcl_chan_freq,
+				sap_config->acs_cfg.pcl_channels_weight_list,
+				&sap_config->acs_cfg.pcl_ch_count);
+
 	sap_config->acs_cfg.band = hw_mode;
 
 	qdf_status = ucfg_mlme_get_external_acs_policy(hdd_ctx->psoc,
@@ -3752,7 +3758,11 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 					&sap_config->acs_cfg.ch_list_count);
 		if (!sap_config->acs_cfg.ch_list_count &&
 		    sap_config->acs_cfg.master_ch_list_count &&
-		    !is_vendor_unsafe_ch_present)
+		    !is_vendor_unsafe_ch_present &&
+		    !policy_mgr_is_ll_sap_present_in_current_mode(
+							hdd_ctx->psoc,
+							pm_mode,
+							adapter->vdev_id))
 			wlan_hdd_handle_zero_acs_list(
 				hdd_ctx,
 				sap_config->acs_cfg.freq_list,

+ 7 - 0
core/sme/src/csr/csr_util.c

@@ -633,6 +633,13 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx,
 			QDF_MCC_TO_SCC_SWITCH_DISABLE)
 		return 0;
 
+	op_mode = wlan_get_opmode_vdev_id(mac_ctx->pdev, vdev_id);
+	if (policy_mgr_is_ll_sap_present_in_current_mode(
+			mac_ctx->psoc,
+			policy_mgr_convert_device_mode_to_qdf_type(op_mode),
+			vdev_id))
+		return 0;
+
 	if (sap_ch_freq != 0) {
 		sap_cfreq = sap_ch_freq;
 		sap_hbw = HALF_BW_OF(eCSR_BW_20MHz_VAL);