Browse Source

qcacld-3.0: Add logic enable EPCS by uplayer

EPCS feature is controlled by uplayer to enable or disable.

Change-Id: I25c4a48db92cecccfe0b605dfc76ac1575efb464
CRs-Fixed: 3521121
Paul Zhang 1 year ago
parent
commit
aa2dd85155

+ 10 - 0
components/umac/mlme/mlo_mgr/dispatcher/inc/wlan_mlo_epcs_ucfg_api.h

@@ -34,4 +34,14 @@
  */
 QDF_STATUS ucfg_epcs_deliver_cmd(struct wlan_objmgr_vdev *vdev,
 				 enum wlan_epcs_evt event);
+
+/**
+ * ucfg_epcs_set_config() - Set EPCS enable/disable config
+ * @vdev: vdev pointer
+ * @flag: EPCS flag
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_epcs_set_config(struct wlan_objmgr_vdev *vdev, uint8_t flag);
+
 #endif /* _WLAN_MLO_EPCS_UCFG_API_H_ */

+ 5 - 0
components/umac/mlme/mlo_mgr/dispatcher/src/wlan_mlo_epcs_ucfg_api.c

@@ -27,3 +27,8 @@ QDF_STATUS ucfg_epcs_deliver_cmd(struct wlan_objmgr_vdev *vdev,
 {
 	return wlan_epcs_deliver_cmd(vdev, event);
 }
+
+QDF_STATUS ucfg_epcs_set_config(struct wlan_objmgr_vdev *vdev, uint8_t flag)
+{
+	return wlan_epcs_set_config(vdev, flag);
+}

+ 33 - 0
components/umac/mlme/mlo_mgr/inc/wlan_epcs_api.h

@@ -81,6 +81,28 @@ QDF_STATUS wlan_epcs_deliver_event(struct wlan_objmgr_vdev *vdev,
 				   enum wlan_epcs_evt event,
 				   void *event_data, uint32_t len);
 
+/**
+ * wlan_epcs_set_config() - Set EPCS enable flag
+ * @vdev: vdev pointer
+ * @flag: EPCS flag
+ *
+ * This api will be called from os_if layers, to set EPCS flag
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_epcs_set_config(struct wlan_objmgr_vdev *vdev,
+				uint8_t flag);
+
+/**
+ * wlan_epcs_get_config() - Get EPCS config
+ * @vdev: vdev pointer
+ *
+ * This api will be called from other module
+ *
+ * Return: bool
+ */
+bool wlan_epcs_get_config(struct wlan_objmgr_vdev *vdev);
+
 /**
  * wlan_epcs_deliver_cmd() - Handler to deliver EPCS command
  * @vdev: vdev pointer
@@ -102,6 +124,17 @@ QDF_STATUS wlan_epcs_deliver_event(struct wlan_objmgr_vdev *vdev,
 	return QDF_STATUS_E_NOSUPPORT;
 }
 
+static inline QDF_STATUS
+wlan_epcs_set_config(struct wlan_objmgr_vdev *vdev, uint8_t flag)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline bool wlan_epcs_get_config(struct wlan_objmgr_vdev *vdev)
+{
+	return false;
+}
+
 static inline
 QDF_STATUS wlan_epcs_deliver_cmd(struct wlan_objmgr_vdev *vdev,
 				 enum wlan_epcs_evt event)

+ 34 - 0
components/umac/mlme/mlo_mgr/src/wlan_epcs_api.c

@@ -631,5 +631,39 @@ static QDF_STATUS epcs_deliver_cmd(struct wlan_objmgr_vdev *vdev,
 QDF_STATUS wlan_epcs_deliver_cmd(struct wlan_objmgr_vdev *vdev,
 				 enum wlan_epcs_evt event)
 {
+	if (!vdev)
+		return QDF_STATUS_E_FAILURE;
+
+	if (!wlan_vdev_mlme_get_epcs_flag(vdev)) {
+		mlme_info("EPCS has been disabled");
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	return epcs_deliver_cmd(vdev, event);
 }
+
+QDF_STATUS wlan_epcs_set_config(struct wlan_objmgr_vdev *vdev, uint8_t flag)
+{
+	if (!vdev)
+		return QDF_STATUS_E_FAILURE;
+
+	if (flag)
+		wlan_vdev_mlme_set_epcs_flag(vdev, true);
+	else
+		wlan_vdev_mlme_set_epcs_flag(vdev, false);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+bool wlan_epcs_get_config(struct wlan_objmgr_vdev *vdev)
+{
+	bool epcs_flag;
+
+	if (!vdev)
+		return false;
+
+	epcs_flag = wlan_vdev_mlme_get_epcs_flag(vdev);
+	mlme_debug("EPCS %s", epcs_flag ? "Enabled" : "Disabled");
+
+	return epcs_flag;
+}

+ 3 - 0
core/mac/src/pe/lim/lim_utils.c

@@ -8677,6 +8677,9 @@ void lim_copy_bss_eht_cap(struct pe_session *session)
 
 	qdf_mem_copy(&session->eht_config, &mlme_priv->eht_config,
 		     sizeof(session->eht_config));
+
+	if (!wlan_epcs_get_config(session->vdev))
+		session->eht_config.epcs_pri_access = 0;
 }
 
 void lim_copy_join_req_eht_cap(struct pe_session *session)

+ 4 - 0
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -56,6 +56,7 @@
 #include <utils_mlo.h>
 #endif
 #ifdef WLAN_FEATURE_11BE
+#include "wlan_epcs_api.h"
 #include <wlan_mlo_t2lm.h>
 #endif
 
@@ -9285,6 +9286,9 @@ QDF_STATUS populate_dot11f_eht_caps(struct mac_context *mac_ctx,
 		return QDF_STATUS_SUCCESS;
 	}
 
+	if (!wlan_epcs_get_config(session->vdev))
+		eht_cap->epcs_pri_access = 0;
+
 	/** TODO: String items needs attention. **/
 	qdf_mem_copy(eht_cap, &session->eht_config, sizeof(*eht_cap));
 	if (session->ch_width != CH_WIDTH_320MHZ)