Pārlūkot izejas kodu

qcacld-3.0: add support to remove the ftm from configuration

Phase 1, after ftm componentization, we could now support to remove
the ftm related components when FTM is disable from the build
configuration.

Size changes: after removing the ftm related binaries, we could save
15KB from module size.

Change-Id: Ib363f1d6204b07947a46f32673c4f8ad6fb3dbd3
CRs-fixed: 2258441
Ryan Hsu 6 gadi atpakaļ
vecāks
revīzija
6e9db0b728
3 mainītis faili ar 38 papildinājumiem un 1 dzēšanām
  1. 9 1
      Kbuild
  2. 15 0
      configs/default_defconfig
  3. 14 0
      core/hdd/src/wlan_hdd_main.c

+ 9 - 1
Kbuild

@@ -682,16 +682,22 @@ FTM_INC := -I$(FTM_DISP_INC)	\
 	   -I$(OS_IF_FTM_INC)	\
 	   -I$(TARGET_IF_FTM_INC)
 
+ifeq ($(CONFIG_QCA_WIFI_FTM), y)
 FTM_OBJS := $(FTM_DISP_SRC)/wlan_ftm_init_deinit.o \
 	    $(FTM_DISP_SRC)/wlan_ftm_ucfg_api.o \
 	    $(FTM_CORE_SRC)/wlan_ftm_svc.o \
-	    $(OS_IF_FTM_SRC)/wlan_cfg80211_ftm.o \
 	    $(TARGET_IF_FTM_SRC)/target_if_ftm.o
 
+ifeq ($(QCA_WIFI_FTM_NL80211), y)
+FTM_OBJS += $(OS_IF_FTM_SRC)/wlan_cfg80211_ftm.o
+endif
+
 ifeq ($(CONFIG_LINUX_QCMBR), y)
 FTM_OBJS += $(OS_IF_FTM_SRC)/wlan_ioctl_ftm.o
 endif
 
+endif
+
 ############# UMAC_CMN_SERVICES ############
 UMAC_COMMON_INC := -I$(WLAN_COMMON_INC)/umac/cmn_services/cmn_defs/inc \
 		-I$(WLAN_COMMON_INC)/umac/cmn_services/utils/inc
@@ -2031,6 +2037,8 @@ cppflags-$(CONFIG_TX_CREDIT_RECLAIM_SUPPORT) += -DTX_CREDIT_RECLAIM_SUPPORT
 
 #Enable FTM support
 cppflags-$(CONFIG_QCA_WIFI_FTM) += -DQCA_WIFI_FTM
+cppflags-$(CONFIG_NL80211_TESTMODE) += -DQCA_WIFI_FTM_NL80211
+cppflags-$(CONFIG_LINUX_QCMBR) += -DLINUX_QCMBR -DQCA_WIFI_FTM_IOCTL
 
 #Enable Checksum Offload support
 cppflags-$(CONFIG_CHECKSUM_OFFLOAD) += -DCHECKSUM_OFFLOAD

+ 15 - 0
configs/default_defconfig

@@ -448,6 +448,21 @@ CONFIG_TX_CREDIT_RECLAIM_SUPPORT := n
 #Enable FTM support
 CONFIG_QCA_WIFI_FTM := y
 
+ifeq ($(CONFIG_QCA_WIFI_FTM), y)
+
+ifeq ($(CONFIG_NL80211_TESTMODE), y)
+	QCA_WIFI_FTM_NL80211 :=y
+else
+	QCA_WIFI_FTM_NL80211 :=n
+endif
+	CONFIG_LINUX_QCMBR :=y
+
+else
+	QCA_WIFI_FTM_NL80211 :=n
+	CONFIG_LINUX_QCMBR :=n
+endif
+
+
 #Enable Checksum Offload
 CONFIG_CHECKSUM_OFFLOAD := y
 

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

@@ -12876,6 +12876,19 @@ static bool is_epping_mode_supported(void)
 }
 #endif
 
+#ifdef QCA_WIFI_FTM
+static bool is_ftm_mode_supported(void)
+{
+	return true;
+}
+#else
+static bool is_ftm_mode_supported(void)
+{
+	pr_err("FTM mode not supported!");
+	return false;
+}
+#endif
+
 /**
  * is_con_mode_valid() check con mode is valid or not
  * @mode: global con mode
@@ -12890,6 +12903,7 @@ static bool is_con_mode_valid(enum QDF_GLOBAL_MODE mode)
 	case QDF_GLOBAL_EPPING_MODE:
 		return is_epping_mode_supported();
 	case QDF_GLOBAL_FTM_MODE:
+		return is_ftm_mode_supported();
 	case QDF_GLOBAL_MISSION_MODE:
 		return true;
 	default: