Forráskód Böngészése

qcacld-3.0: Add support to handle HT LL and LT LL policy separately

Currently, policy_mgr_is_ll_sap_present api is used to check if
ll sap is present or not but different operations may be required
for HT and LT LL AP policy example for LT policy i.e gaming/loss
less audio MCC is acceptable but for HT MCC is strictly prohibited.
So, wrapper functions are added to check HT, LT and any AP policy.

Change-Id: I93dbcd65b1a102d0f879366db26f3d2cf01e030e
CRs-Fixed: 3435203
Sheenam Monga 2 éve
szülő
commit
d05fc12d8b

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

@@ -1650,6 +1650,35 @@ bool
 policy_mgr_is_vdev_ll_sap(struct wlan_objmgr_psoc *psoc,
 			  uint32_t vdev_id);
 
+/**
+ * policy_mgr_is_vdev_ht_ll_sap() - Check whether given vdev is HT LL SAP or not
+ * @psoc: psoc object
+ * @vdev_id: vdev id
+ *
+ * Based on vdev id ap profile set via vendor command is get and compared with
+ * ht_ll_type AP type and is return true if profile set is throghput sensitive.
+ *
+ * Return: true if it's present otherwise false
+ */
+bool
+policy_mgr_is_vdev_ht_ll_sap(struct wlan_objmgr_psoc *psoc,
+			     uint32_t vdev_id);
+
+/**
+ * policy_mgr_is_vdev_lt_ll_sap() - Check whether given vdev is LT LL SAP or not
+ * @psoc: psoc object
+ * @vdev_id: vdev id
+ *
+ * Based on vdev id ap profile set via vendor command is get and compared with
+ * lt_ll_type AP and is return true if profile set is gaming or losless audio
+ * where latency matters.
+ *
+ * Return: true if it's present otherwise false
+ */
+bool
+policy_mgr_is_vdev_lt_ll_sap(struct wlan_objmgr_psoc *psoc,
+			     uint32_t vdev_id);
+
 /**
  * policy_mgr_get_preferred_dbs_action_table() - get dbs action table type
  * @psoc: Pointer to psoc

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

@@ -4086,9 +4086,18 @@ bool policy_mgr_is_sta_chan_valid_for_connect_and_roam(
 	return true;
 }
 
-bool
-policy_mgr_is_vdev_ll_sap(struct wlan_objmgr_psoc *psoc,
-			  uint32_t vdev_id)
+/**
+ * _policy_mgr_is_vdev_ll_sap() - Check whether any LL SAP is present or not
+ * for provided ap policy
+ * @psoc: psoc object
+ * @vdev_id: vdev id
+ * @ap_type: LL SAP type
+ *
+ * Return: true if it's present otherwise false
+ */
+static bool
+_policy_mgr_is_vdev_ll_sap(struct wlan_objmgr_psoc *psoc,
+			   uint32_t vdev_id, enum ll_ap_type ap_type)
 {
 	struct wlan_objmgr_vdev *vdev;
 	bool is_ll_sap = false;
@@ -4116,14 +4125,52 @@ policy_mgr_is_vdev_ll_sap(struct wlan_objmgr_psoc *psoc,
 	}
 
 	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);
+	switch (ap_type) {
+	case LL_AP_TYPE_HT:
+		if (profile == HOST_CONCURRENT_AP_POLICY_XR)
+			is_ll_sap = true;
+	break;
+	case LL_AP_TYPE_LT:
+		if (profile == HOST_CONCURRENT_AP_POLICY_GAMING_AUDIO ||
+		    profile ==
+		    HOST_CONCURRENT_AP_POLICY_LOSSLESS_AUDIO_STREAMING)
+			is_ll_sap = true;
+	break;
+	case LL_AP_TYPE_ANY:
+		if (profile == HOST_CONCURRENT_AP_POLICY_GAMING_AUDIO ||
+		    profile ==
+		    HOST_CONCURRENT_AP_POLICY_LOSSLESS_AUDIO_STREAMING ||
+		    profile == HOST_CONCURRENT_AP_POLICY_XR)
+			is_ll_sap = true;
+	break;
+	default:
+		policy_mgr_err("invalid ap type %d", ap_type);
+	}
 	return is_ll_sap;
 }
 
+bool
+policy_mgr_is_vdev_ll_sap(struct wlan_objmgr_psoc *psoc,
+			  uint32_t vdev_id)
+{
+	return _policy_mgr_is_vdev_ll_sap(psoc, vdev_id, LL_AP_TYPE_ANY);
+}
+
+bool
+policy_mgr_is_vdev_ht_ll_sap(struct wlan_objmgr_psoc *psoc,
+			     uint32_t vdev_id)
+{
+	return _policy_mgr_is_vdev_ll_sap(psoc, vdev_id, LL_AP_TYPE_HT);
+}
+
+bool
+policy_mgr_is_vdev_lt_ll_sap(struct wlan_objmgr_psoc *psoc,
+			     uint32_t vdev_id)
+{
+	return _policy_mgr_is_vdev_ll_sap(psoc, vdev_id, LL_AP_TYPE_LT);
+}
+
 QDF_STATUS
 policy_mgr_get_pcl_chlist_for_ll_sap(struct wlan_objmgr_psoc *psoc,
 				     uint32_t *len, uint32_t *pcl_channels,

+ 12 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -2909,4 +2909,16 @@ enum host_concurrent_ap_policy {
 	HOST_CONCURRENT_AP_POLICY_LOSSLESS_AUDIO_STREAMING = 2,
 	HOST_CONCURRENT_AP_POLICY_XR = 3
 };
+
+/**
+ * enum ll_ap_type - low latency AP type
+ * @LL_AP_TYPE_HT: low latency AP type high throughput
+ * @LL_AP_TYPE_LT: low latency AP type low latency
+ * @LL_AP_TYPE_ANY: low latency AP type any
+ */
+enum ll_ap_type {
+	LL_AP_TYPE_HT = 0,
+	LL_AP_TYPE_LT = 1,
+	LL_AP_TYPE_ANY = 2,
+};
 #endif