qcacld-3.0: Kbuild changes for TWT

Add the compilation flags for TWT feature to Kbuild.
Based on the compilation flag, include the source
files for compilation and also include the header
files path.

Change-Id: I45991b3c9e49e2aa0ff51a2650fde69ea447bf15
CRs-Fixed: 2238302
diff --git a/Kbuild b/Kbuild
index d617245..f7047e1 100644
--- a/Kbuild
+++ b/Kbuild
@@ -145,6 +145,10 @@
 HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_he.o
 endif
 
+ifeq ($(CONFIG_WLAN_FEATURE_TWT), y)
+HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_twt.o
+endif
+
 ifeq ($(CONFIG_LITHIUM), y)
 HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_rx_monitor.o
 endif
@@ -853,6 +857,11 @@
 WMI_OBJS += $(WMI_OBJ_DIR)/wmi_unified_dfs_api.o
 endif
 
+ifeq ($(CONFIG_WLAN_FEATURE_TWT), y)
+WMI_OBJS += $(WMI_OBJ_DIR)/wmi_unified_twt_api.o
+WMI_OBJS += $(WMI_OBJ_DIR)/wmi_unified_twt_tlv.o
+endif
+
 ifeq ($(CONFIG_FEATURE_WLAN_EXTSCAN), y)
 WMI_OBJS += $(WMI_OBJ_DIR)/wmi_unified_extscan_api.o
 WMI_OBJS += $(WMI_OBJ_DIR)/wmi_unified_extscan_tlv.o
@@ -1277,7 +1286,9 @@
 ifeq ($(CONFIG_WLAN_FEATURE_11AX), y)
 WMA_OBJS+=	$(WMA_SRC_DIR)/wma_he.o
 endif
-
+ifeq ($(CONFIG_WLAN_FEATURE_TWT), y)
+WMA_OBJS +=	$(WMA_SRC_DIR)/wma_twt.o
+endif
 ############## PLD ##########
 PLD_DIR := core/pld
 PLD_INC_DIR := $(PLD_DIR)/inc
@@ -1527,6 +1538,7 @@
 cppflags-$(CONFIG_WLAN_CONV_SPECTRAL_ENABLE) += -DWLAN_CONV_SPECTRAL_ENABLE
 cppflags-$(CONFIG_WMI_CMD_STRINGS) += -DWMI_CMD_STRINGS
 cppflags-$(CONFIG_FEATURE_MONITOR_MODE_SUPPORT) += -DFEATURE_MONITOR_MODE_SUPPORT
+cppflags-$(CONFIG_WLAN_FEATURE_TWT) += -DWLAN_SUPPORT_TWT
 
 cppflags-$(CONFIG_WLAN_DISABLE_EXPORT_SYMBOL) += -DWLAN_DISABLE_EXPORT_SYMBOL
 cppflags-$(CONFIG_WIFI_POS_CONVERGED) += -DWIFI_POS_CONVERGED
diff --git a/configs/default_defconfig b/configs/default_defconfig
index d54a30c..2b723d9 100644
--- a/configs/default_defconfig
+++ b/configs/default_defconfig
@@ -520,6 +520,7 @@
 CONFIG_WLAN_SPECTRAL_ENABLE := y
 CONFIG_WMI_CMD_STRINGS := y
 CONFIG_FEATURE_MONITOR_MODE_SUPPORT := y
+CONFIG_WLAN_FEATURE_TWT := y
 
 ifeq ($(CONFIG_HELIUMPLUS), y)
 ifneq ($(CONFIG_FORCE_ALLOC_FROM_DMA_ZONE), y)
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index c9ab6c2..b6e2dac 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -11426,7 +11426,7 @@
 #define CFG_HE_STA_OBSSPD_DEFAULT (0x15b8c2ae)
 
 #endif /* WLAN_FEATURE_11AX */
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 /*
  * <ini>
  * enable_twt - Enable Target Wake Time support.
@@ -11473,7 +11473,7 @@
 #define CFG_TWT_CONGESTION_TIMEOUT_MAX     (10000)
 #define CFG_TWT_CONGESTION_TIMEOUT_DEFAULT (100)
 
-#endif /* WLAN_FEATURE_TWT */
+#endif /* WLAN_SUPPORT_TWT */
 
 /*
  * <ini>
@@ -15013,7 +15013,7 @@
 	bool enable_ul_ofdma;
 	uint32_t he_sta_obsspd;
 #endif
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 	bool enable_twt;
 	uint32_t twt_congestion_timeout;
 #endif
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index fc82548..9abbae5 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1909,7 +1909,7 @@
 	/* defining the board related information */
 	uint32_t hw_bd_id;
 	struct board_info hw_bd_info;
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 	enum twt_status twt_state;
 #endif
 };
diff --git a/core/hdd/inc/wlan_hdd_twt.h b/core/hdd/inc/wlan_hdd_twt.h
index 728b7e4..98d67b4 100644
--- a/core/hdd/inc/wlan_hdd_twt.h
+++ b/core/hdd/inc/wlan_hdd_twt.h
@@ -33,7 +33,7 @@
 struct wma_tgt_cfg;
 struct wmi_twt_enable_complete_event_param;
 
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 /**
  * enum twt_status - TWT target state
  * @TWT_INIT: Init State
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index a37c8ab..68e4442 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -4454,7 +4454,7 @@
 		     CFG_HE_STA_OBSSPD_MIN,
 		     CFG_HE_STA_OBSSPD_MAX),
 #endif
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 	REG_VARIABLE(CFG_ENABLE_TWT_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, enable_twt,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 6117fda..421f9cb 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -2336,7 +2336,7 @@
 uint8_t sme_get_mcs_idx(uint16_t max_rate, uint8_t rate_flags,
 			uint8_t nss, uint8_t *mcs_rate_flags);
 
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 /**
  * sme_register_twt_enable_complete_cb() - TWT enable registrar
  * @hal: HAL handle
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 75ec355..d28e56a 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -15536,7 +15536,7 @@
 	return sme_register_tx_queue_cb(hal, NULL);
 }
 
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 QDF_STATUS sme_register_twt_enable_complete_cb(tHalHandle hal,
 		void (*twt_enable_cb)(void *hdd_ctx,
 		struct wmi_twt_enable_complete_event_param *params))
diff --git a/core/wma/inc/wma_twt.h b/core/wma/inc/wma_twt.h
index 1be154b..0f5d6a8 100644
--- a/core/wma/inc/wma_twt.h
+++ b/core/wma/inc/wma_twt.h
@@ -21,7 +21,7 @@
 
 #include "wma.h"
 
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 /**
  * wma_send_twt_enable_cmd() - Send TWT Enable command to firmware
  * @pdev_id: pdev id
@@ -34,7 +34,7 @@
 static inline void wma_send_twt_enable_cmd(uint32_t pdev_id,
 					   uint32_t congestion_timeout)
 {
-	WMA_LOGD(FL("TWT not supported as WLAN_FEATURE_TWT is disabled"));
+	WMA_LOGD(FL("TWT not supported as WLAN_SUPPORT_TWT is disabled"));
 }
 #endif
 
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 7543038..0ebb7cb 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -3564,7 +3564,7 @@
 			wma_vdev_bss_color_collision_info_handler,
 			WMA_RX_WORK_CTX);
 
-#ifdef WLAN_FEATURE_TWT
+#ifdef WLAN_SUPPORT_TWT
 	wmi_unified_register_event_handler(wma_handle->wmi_handle,
 					   wmi_twt_enable_complete_event_id,
 					   wma_twt_en_complete_event_handler,