Эх сурвалжийг харах

qcacld-3.0: Get low latency SAP frequency

Low latency SAP is supported on DBS and SBS hw and it can come
up on below two profile
a. Gaming
b. Lossless Audio

DBS: Allow only 2.4 GHz channel for both gaming and lossless
audio profile
SBS: Allow non low latency SAP 5 GHz channel which are mutually
exclusive for both gaming and lossless audio profile.

Check whether low latency sap is present or not. If it's present
then get the frequency to validate the concurrency with other
interface.

Change-Id: I39715a01e63de612448d4d0f230e6ccb71b76b15
CRs-Fixed: 3294596
Jyoti Kumari 2 жил өмнө
parent
commit
50245e6aa7

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

@@ -4605,4 +4605,13 @@ bool policy_mgr_any_other_vdev_on_same_mac_as_freq(
  */
 QDF_STATUS policy_mgr_get_sbs_cfg(struct wlan_objmgr_psoc *psoc, bool *sbs);
 
+/**
+ * policy_mgr_get_ll_sap_freq()- Function to get ll sap freq if it's present
+ * @psoc: PSOC object
+ *
+ * Return: True if it's LL SAP otherwise false
+ *
+ */
+qdf_freq_t policy_mgr_get_ll_sap_freq(struct wlan_objmgr_psoc *psoc);
+
 #endif /* __WLAN_POLICY_MGR_API_H */

+ 58 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -8864,3 +8864,61 @@ bool policy_mgr_sr_same_mac_conc_enabled(struct wlan_objmgr_psoc *psoc)
 				    wmi_service_obss_per_packet_sr_support));
 }
 #endif
+
+qdf_freq_t policy_mgr_get_ll_sap_freq(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_objmgr_vdev *sap_vdev;
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	uint32_t conn_idx = 0, vdev_id;
+	bool is_ll_sap_present = false;
+	qdf_freq_t freq = 0;
+	enum host_concurrent_ap_policy profile =
+					HOST_CONCURRENT_AP_POLICY_UNSPECIFIED;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("pm_ctx is NULL");
+		return 0;
+	}
+
+	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].mode == PM_SAP_MODE &&
+		    pm_conc_connection_list[conn_idx].in_use))
+			continue;
+
+		vdev_id = pm_conc_connection_list[conn_idx].vdev_id;
+		freq = pm_conc_connection_list[conn_idx].freq;
+
+		sap_vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
+							psoc,
+							vdev_id,
+							WLAN_POLICY_MGR_ID);
+
+		if (!sap_vdev) {
+			policy_mgr_err("vdev %d: invalid vdev", vdev_id);
+			continue;
+		}
+
+		profile = wlan_mlme_get_ap_policy(sap_vdev);
+		wlan_objmgr_vdev_release_ref(sap_vdev, WLAN_POLICY_MGR_ID);
+
+		if (profile == HOST_CONCURRENT_AP_POLICY_GAMING_AUDIO ||
+		    profile == HOST_CONCURRENT_AP_POLICY_LOSSLESS_AUDIO_STREAMING) {
+			is_ll_sap_present = true;
+			break;
+		}
+	}
+	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
+
+	if (!is_ll_sap_present) {
+		policy_mgr_debug("LL SAP not present");
+		return 0;
+	}
+
+	policy_mgr_debug("LL SAP present with vdev_id %d and freq %d",
+			 vdev_id, freq);
+
+	return freq;
+}