소스 검색

qcacld-3.0: Enable or Disable TWT services in WNI CFG

Introduce new WNI items for TWT as follows:
WNI_CFG_TWT_REQUESTOR
WNI_CFG_TWT_RESPONDER
WNI_CFG_BCAST_TWT

Based on the INI configuration and target support, enable
or disable the TWT services in the WNI CFG database.

Change-Id: Id1b239e53f30f00220e0cefb541fc641a898e712
CRs-Fixed: 2238302
Varun Reddy Yeturu 7 년 전
부모
커밋
e93d2460b1

+ 16 - 0
core/hdd/inc/wlan_hdd_twt.h

@@ -27,6 +27,7 @@
 #define WLAN_HDD_TWT_H
 
 struct hdd_context;
+struct wma_tgt_cfg;
 
 #ifdef WLAN_FEATURE_TWT
 /**
@@ -37,10 +38,25 @@ struct hdd_context;
  */
 void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx);
 
+/**
+ * hdd_update_tgt_twt_cap() - Update TWT target capabilities
+ * @hdd_ctx: HDD Context
+ * @cfg: Pointer to target configuration
+ *
+ * Return: None
+ */
+void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
+			    struct wma_tgt_cfg *cfg);
+
 #else
 static inline void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx)
 {
 }
 
+static inline void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
+					  struct wma_tgt_cfg *cfg)
+{
+}
+
 #endif
 #endif /* if !defined(WLAN_HDD_TWT_H)*/

+ 2 - 0
core/hdd/src/wlan_hdd_main.c

@@ -131,6 +131,7 @@
 #include <target_if.h>
 #include "wlan_hdd_nud_tracking.h"
 #include "wlan_hdd_apf.h"
+#include "wlan_hdd_twt.h"
 
 #ifdef CNSS_GENL
 #include <net/cnss_nl.h>
@@ -2005,6 +2006,7 @@ void hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
 		hdd_info("11AX: 11ax is enabled - update HDD config");
 		hdd_update_tgt_he_cap(hdd_ctx, cfg);
 	}
+	hdd_update_tgt_twt_cap(hdd_ctx, cfg);
 
 	hdd_update_vdev_nss(hdd_ctx);
 

+ 25 - 0
core/hdd/src/wlan_hdd_twt.c

@@ -26,6 +26,7 @@
 #include "wlan_hdd_twt.h"
 #include "wlan_hdd_main.h"
 #include "wlan_hdd_cfg.h"
+#include "cfg_api.h"
 
 void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx)
 {
@@ -35,3 +36,27 @@ void hdd_twt_print_ini_config(struct hdd_context *hdd_ctx)
 		  hdd_ctx->config->twt_congestion_timeout);
 }
 
+void hdd_update_tgt_twt_cap(struct hdd_context *hdd_ctx,
+			    struct wma_tgt_cfg *cfg)
+{
+	struct wma_tgt_services *services = &cfg->services;
+
+	hdd_debug("TWT: enable_twt=%d, tgt Req=%d, Res=%d",
+		  hdd_ctx->config->enable_twt, services->twt_requestor,
+		  services->twt_responder);
+
+	sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TWT_REQUESTOR,
+			QDF_MIN(services->twt_requestor,
+				hdd_ctx->config->enable_twt));
+
+	sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_TWT_RESPONDER,
+			QDF_MIN(services->twt_responder,
+				hdd_ctx->config->enable_twt));
+
+	/*
+	 * Currently broadcast TWT is not supported
+	 */
+	sme_cfg_set_int(hdd_ctx->hHal, WNI_CFG_BCAST_TWT,
+			QDF_MIN(0, hdd_ctx->config->enable_twt));
+}
+

+ 15 - 0
core/mac/inc/wni_cfg.h

@@ -318,6 +318,9 @@ enum {
 	WNI_CFG_EDCA_ETSI_ACVO,
 	WNI_CFG_OBSS_DETECTION_OFFLOAD,
 	WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD,
+	WNI_CFG_TWT_REQUESTOR,
+	WNI_CFG_TWT_RESPONDER,
+	WNI_CFG_BCAST_TWT,
 	/* Any new items to be added should be above this strictly */
 	CFG_PARAM_MAX_NUM
 };
@@ -1639,6 +1642,18 @@ enum {
 #define WNI_CFG_RATE_FOR_TX_MGMT_5G_STAMAX   0xFF
 #define WNI_CFG_RATE_FOR_TX_MGMT_5G_STADEF   0xFF
 
+#define WNI_CFG_TWT_REQUESTOR_STAMIN 0
+#define WNI_CFG_TWT_REQUESTOR_STAMAX 1
+#define WNI_CFG_TWT_REQUESTOR_STADEF 0
+
+#define WNI_CFG_TWT_RESPONDER_STAMIN 0
+#define WNI_CFG_TWT_RESPONDER_STAMAX 1
+#define WNI_CFG_TWT_RESPONDER_STADEF 0
+
+#define WNI_CFG_BCAST_TWT_STAMIN 0
+#define WNI_CFG_BCAST_TWT_STAMAX 1
+#define WNI_CFG_BCAST_TWT_STADEF 0
+
 #define CFG_STA_MAGIC_DWORD    0xbeefbeef
 
 #endif

+ 3 - 0
core/mac/src/cfg/cfg_param_name.c

@@ -325,6 +325,9 @@ const char *cfg_get_string(uint16_t cfg_id)
 	CASE_RETURN_STRING(WNI_CFG_EDCA_ETSI_ACVO);
 	CASE_RETURN_STRING(WNI_CFG_OBSS_DETECTION_OFFLOAD);
 	CASE_RETURN_STRING(WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD);
+	CASE_RETURN_STRING(WNI_CFG_TWT_REQUESTOR);
+	CASE_RETURN_STRING(WNI_CFG_TWT_RESPONDER);
+	CASE_RETURN_STRING(WNI_CFG_BCAST_TWT);
 	}
 
 	return "invalid";

+ 12 - 0
core/mac/src/cfg/cfg_proc_msg.c

@@ -1432,6 +1432,18 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
 	{WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD,
 	 CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
 	 0, 1, 0},
+	{WNI_CFG_TWT_REQUESTOR,
+	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
+	WNI_CFG_TWT_REQUESTOR_STAMIN, WNI_CFG_TWT_REQUESTOR_STAMAX,
+	WNI_CFG_TWT_REQUESTOR_STADEF},
+	{WNI_CFG_TWT_RESPONDER,
+	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
+	WNI_CFG_TWT_RESPONDER_STAMIN, WNI_CFG_TWT_RESPONDER_STAMAX,
+	WNI_CFG_TWT_RESPONDER_STADEF},
+	{WNI_CFG_BCAST_TWT,
+	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
+	WNI_CFG_BCAST_TWT_STAMIN, WNI_CFG_BCAST_TWT_STAMAX,
+	WNI_CFG_BCAST_TWT_STADEF},
 };
 
 

+ 4 - 0
core/wma/inc/wma_tgt_cfg.h

@@ -37,6 +37,8 @@
  * @en_roam_offload: enable roam offload
  * @en_11ax: enable 11ax
  * @is_fw_mawc_capable: Motion Aided Wireless Connectivity feature
+ * @twt_requestor: TWT requestor capability
+ * @twt_responder: TWT responder capability
  */
 struct wma_tgt_services {
 	uint32_t sta_power_save;
@@ -65,6 +67,8 @@ struct wma_tgt_services {
 	bool is_fils_roaming_supported;
 	bool is_fw_mawc_capable;
 	bool is_11k_offload_supported;
+	bool twt_requestor;
+	bool twt_responder;
 };
 
 /**