diff --git a/Kbuild b/Kbuild index e68aa8f642..bd49858959 100644 --- a/Kbuild +++ b/Kbuild @@ -807,10 +807,12 @@ BMI_DIR := core/bmi BMI_INC := -I$(WLAN_ROOT)/$(BMI_DIR)/inc +ifeq ($(CONFIG_WLAN_FEATURE_BMI), y) BMI_OBJS := $(BMI_DIR)/src/bmi.o \ + $(BMI_DIR)/src/bmi_1.o \ $(BMI_DIR)/src/ol_fw.o \ $(BMI_DIR)/src/ol_fw_common.o -BMI_OBJS += $(BMI_DIR)/src/bmi_1.o +endif ########## TARGET_IF ####### TARGET_IF_DIR := $(WLAN_COMMON_ROOT)/target_if @@ -1178,15 +1180,16 @@ HIF_COMMON_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/hif_exec.o HIF_COMMON_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/hif_irq_affinity.o endif - - -HIF_CE_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_bmi.o \ - $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_diag.o \ +HIF_CE_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_diag.o \ $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_main.o \ $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_service.o \ $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_tasklet.o \ $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/regtable.o +ifeq ($(CONFIG_WLAN_FEATURE_BMI), y) +HIF_CE_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_bmi.o +endif + ifeq ($(CONFIG_LITHIUM), y) ifeq ($(CONFIG_CNSS_QCA6290), y) HIF_CE_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/qca6290def.o @@ -1204,12 +1207,16 @@ HIF_USB_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_USB_DIR)/usbdrv.o \ $(WLAN_COMMON_ROOT)/$(HIF_USB_DIR)/if_usb.o \ $(WLAN_COMMON_ROOT)/$(HIF_USB_DIR)/regtable_usb.o -HIF_SDIO_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_bmi_reg_access.o \ - $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_diag_reg_access.o \ +HIF_SDIO_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_diag_reg_access.o \ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_sdio_dev.o \ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_sdio.o \ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/regtable_sdio.o \ $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/transfer/transfer.o + +ifeq ($(CONFIG_WLAN_FEATURE_BMI), y) +HIF_SDIO_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/hif_bmi_reg_access.o +endif + ifeq ($(CONFIG_SDIO_TRANSFER), adma) HIF_SDIO_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_SDIO_DIR)/transfer/adma.o else @@ -1962,6 +1969,7 @@ cppflags-$(CONFIG_FEATURE_TSO) += -DFEATURE_TSO cppflags-$(CONFIG_TSO_DEBUG_LOG_ENABLE) += -DTSO_DEBUG_LOG_ENABLE cppflags-$(CONFIG_DP_LFR) += -DDP_LFR cppflags-$(CONFIG_HTT_PADDR64) += -DHTT_PADDR64 +cppflags-$(CONFIG_WLAN_FEATURE_BMI) += -DWLAN_FEATURE_BMI ccflags-$(CONFIG_QCA_LL_TX_FLOW_CONTROL_RESIZE) += -DQCA_LL_TX_FLOW_CONTROL_RESIZE diff --git a/configs/default_defconfig b/configs/default_defconfig index 12d81e5287..02638c3a77 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -547,6 +547,7 @@ CONFIG_WLAN_SPECTRAL_ENABLE := y CONFIG_WMI_CMD_STRINGS := y CONFIG_FEATURE_MONITOR_MODE_SUPPORT := y CONFIG_WLAN_FEATURE_TWT := y +CONFIG_WLAN_FEATURE_BMI := y ifeq ($(CONFIG_HELIUMPLUS), y) ifneq ($(CONFIG_FORCE_ALLOC_FROM_DMA_ZONE), y) diff --git a/configs/genoa.common b/configs/genoa.common index f7c7fcce42..5cd6663694 100644 --- a/configs/genoa.common +++ b/configs/genoa.common @@ -112,6 +112,7 @@ CONFIG_WLAN_FEATURE_DISA := n CONFIG_WLAN_FEATURE_FIPS := y CONFIG_WLAN_FEATURE_SAE := y CONFIG_CHNL_MATRIX_RESTRICTION := n +CONFIG_WLAN_FEATURE_BMI := n ifeq ($(CONFIG_ARCH_SDM845), y) ifeq ($(CONFIG_IPA_OFFLOAD), y) diff --git a/core/bmi/inc/bmi.h b/core/bmi/inc/bmi.h index 920cb5eb34..583a1b117a 100644 --- a/core/bmi/inc/bmi.h +++ b/core/bmi/inc/bmi.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -29,8 +29,6 @@ #include "hif.h" struct ol_context; -QDF_STATUS ol_cds_init(qdf_device_t qdf_dev, void *hif_ctx); -void ol_cds_free(void); /** * struct hif_config_info - Place Holder for hif confiruation @@ -51,10 +49,52 @@ struct ol_config_info { bool enable_ramdump_collection; }; +#ifdef WLAN_FEATURE_BMI +QDF_STATUS ol_cds_init(qdf_device_t qdf_dev, void *hif_ctx); +void ol_cds_free(void); void ol_init_ini_config(struct ol_context *ol_ctx, struct ol_config_info *cfg); void bmi_cleanup(struct ol_context *scn); QDF_STATUS bmi_done(struct ol_context *ol_ctx); void bmi_target_ready(struct hif_opaque_softc *scn, void *cfg_ctx); QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx); + +#else /* WLAN_FEATURE_BMI */ + +static inline QDF_STATUS +ol_cds_init(qdf_device_t qdf_dev, void *hif_ctx) +{ + return QDF_STATUS_SUCCESS; +} + +static inline void ol_cds_free(void) +{ +} + +static inline void +ol_init_ini_config(struct ol_context *ol_ctx, struct ol_config_info *cfg) +{ +} + +static inline void bmi_cleanup(struct ol_context *scn) +{ +} + +static inline QDF_STATUS bmi_done(struct ol_context *ol_ctx) +{ + return QDF_STATUS_SUCCESS; +} + +static inline void +bmi_target_ready(struct hif_opaque_softc *scn, void *cfg_ctx) +{ +} + +static inline QDF_STATUS +bmi_download_firmware(struct ol_context *ol_ctx) +{ + return QDF_STATUS_SUCCESS; +} +#endif /* WLAN_FEATURE_BMI */ + #endif /* _BMI_H_ */ diff --git a/core/bmi/inc/ol_fw.h b/core/bmi/inc/ol_fw.h index 407ac7799e..d4af7dc4df 100644 --- a/core/bmi/inc/ol_fw.h +++ b/core/bmi/inc/ol_fw.h @@ -34,9 +34,13 @@ #define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_FW_ACK (1 << 16) #define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_FW_ACK (1 << 17) +#ifdef WLAN_FEATURE_BMI void ol_target_failure(void *instance, QDF_STATUS status); void ol_target_ready(struct hif_opaque_softc *scn, void *cfg_ctx); QDF_STATUS ol_get_fw_files(struct ol_context *ol_ctx); QDF_STATUS ol_extra_initialization(struct ol_context *ol_ctx); +#else /* WLAN_FEATURE_BMI */ +static inline void ol_target_failure(void *instance, QDF_STATUS status) {} +#endif /* WLAN_FEATURE_BMI */ #endif /* _OL_FW_H_ */