Bläddra i källkod

qcacld-3.0: Add individual TWT support for 11be

During VDEV creation, vdev parameter "DISABLE_2G_TWT"
is populated in accordance to the value of ini
"enable_twt_24ghz" in order to indicate FW
to support TWT for 2.4GHz band.

Change-Id: I610bbaad3c5d12a8303939488ed2d7486dda404f
CRs-Fixed: 3560288
Vijay Raj 1 år sedan
förälder
incheckning
936a1452d8
3 ändrade filer med 34 tillägg och 8 borttagningar
  1. 6 0
      components/mlme/core/inc/wlan_mlme_twt_api.h
  2. 14 7
      core/hdd/src/wlan_hdd_twt.c
  3. 14 1
      core/wma/src/wma_dev_if.c

+ 6 - 0
components/mlme/core/inc/wlan_mlme_twt_api.h

@@ -328,5 +328,11 @@ bool mlme_is_flexible_twt_enabled(struct wlan_objmgr_psoc *psoc)
 {
 	return false;
 }
+
+static inline bool
+mlme_is_24ghz_twt_enabled(struct wlan_objmgr_psoc *psoc)
+{
+	return false;
+}
 #endif /* WLAN_SUPPORT_TWT */
 #endif /* _WLAN_MLME_TWT_API_H_ */

+ 14 - 7
core/hdd/src/wlan_hdd_twt.c

@@ -41,6 +41,7 @@
 #include <target_if.h>
 #include "wlan_hdd_object_manager.h"
 #include "osif_twt_ext_req.h"
+#include "wlan_mlo_mgr_sta.h"
 #include "wlan_twt_ucfg_ext_api.h"
 #include "wlan_twt_ucfg_ext_cfg.h"
 #include "osif_twt_internal.h"
@@ -3558,14 +3559,20 @@ hdd_twt_pack_get_capabilities_resp(struct hdd_adapter *adapter)
 
 	/*
 	 * Userspace will query the TWT get capabilities before
-	 * issuing a get capabilities request. If the STA is
-	 * connected, then check the "enable_twt_24ghz" ini
-	 * value to advertise the TWT requestor capability.
+	 * issuing a get capabilities request. For legacy connection,
+	 * if the STA is connected, then check the "enable_twt_24ghz"
+	 * ini value to advertise the TWT requestor capability.
+	 * For MLO connection, TWT requestor capabilities are advertised
+	 * irrespective of connected band.
 	 */
-	connected_band = hdd_conn_get_connected_band(adapter->deflink);
-	if (connected_band == BAND_2G &&
-	    !ucfg_mlme_is_24ghz_twt_enabled(hdd_ctx->psoc))
-		is_twt_24ghz_allowed = false;
+	if (!mlo_is_mld_sta(adapter->deflink->vdev)) {
+		connected_band = hdd_conn_get_connected_band(adapter->deflink);
+		if (connected_band == BAND_2G &&
+		    !ucfg_mlme_is_24ghz_twt_enabled(hdd_ctx->psoc))
+			is_twt_24ghz_allowed = false;
+	} else {
+		is_twt_24ghz_allowed = true;
+	}
 
 	/* fill the self_capability bitmap  */
 	ucfg_mlme_get_twt_requestor(hdd_ctx->psoc, &twt_req);

+ 14 - 1
core/wma/src/wma_dev_if.c

@@ -87,6 +87,7 @@
 #include "wlan_mlme_api.h"
 #include "wlan_mlme_main.h"
 #include "wlan_mlme_ucfg_api.h"
+#include "wlan_mlme_twt_api.h"
 #include <wlan_dfs_utils_api.h>
 #include "../../core/src/vdev_mgr_ops.h"
 #include "wlan_utility.h"
@@ -6377,7 +6378,7 @@ static QDF_STATUS wma_vdev_mgmt_perband_tx_rate(struct dev_set_param *info)
 	return QDF_STATUS_SUCCESS;
 }
 
-#define MAX_VDEV_CREATE_PARAMS 20
+#define MAX_VDEV_CREATE_PARAMS 21
 /* params being sent:
  * 1.wmi_vdev_param_wmm_txop_enable
  * 2.wmi_vdev_param_disconnect_th
@@ -6399,6 +6400,7 @@ static QDF_STATUS wma_vdev_mgmt_perband_tx_rate(struct dev_set_param *info)
  * 18.wmi_vdev_param_bmiss_first_bcnt
  * 19.wmi_vdev_param_bmiss_final_bcnt
  * 20.wmi_vdev_param_set_sap_ps_with_twt
+ * 21.wmi_vdev_param_disable_2g_twt
  */
 
 QDF_STATUS wma_vdev_create_set_param(struct wlan_objmgr_vdev *vdev)
@@ -6414,6 +6416,7 @@ QDF_STATUS wma_vdev_create_set_param(struct wlan_objmgr_vdev *vdev)
 	uint32_t hemu_mode;
 	struct dev_set_param setparam[MAX_VDEV_CREATE_PARAMS];
 	uint8_t index = 0;
+	bool is_24ghz_twt_enabled;
 	enum QDF_OPMODE opmode;
 
 	if (!mac)
@@ -6665,6 +6668,16 @@ QDF_STATUS wma_vdev_create_set_param(struct wlan_objmgr_vdev *vdev)
 		}
 	}
 
+	is_24ghz_twt_enabled = mlme_is_24ghz_twt_enabled(mac->psoc);
+	status = mlme_check_index_setparam(setparam,
+					   wmi_vdev_param_disable_2g_twt,
+					   !is_24ghz_twt_enabled,
+					   index++, MAX_VDEV_CREATE_PARAMS);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_debug("failed to set wmi_vdev_param_disable_2g_twt");
+		goto error;
+	}
+
 	status = wma_send_multi_pdev_vdev_set_params(MLME_VDEV_SETPARAM,
 						     vdev_id, setparam, index);
 	if (QDF_IS_STATUS_ERROR(status)) {