Selaa lähdekoodia

qcacld-3.0: Fix compilation errors for msmcobalt (2/2)

Fix compilation errors when building for msmcobalt.

Change-Id: I2e1d968e967f493fb927440777d1d01f7e3f66b0
CRs-Fixed: 1006068
Houston Hoffman 9 vuotta sitten
vanhempi
sitoutus
52ec669089

+ 8 - 3
Kbuild

@@ -22,8 +22,8 @@ ifeq ($(KERNEL_BUILD),1)
 	# Need to explicitly define for Kernel-based builds
 	MODNAME := wlan
 	WLAN_ROOT := drivers/staging/qcacld-3.0
-	WLAN_COMMON_ROOT := drivers/staging/qca-wifi-host-cmn
-	WLAN_COMMON_INC := $(WLAN_COMMON_ROOT)
+	WLAN_COMMON_ROOT := ../qca-wifi-host-cmn
+	WLAN_COMMON_INC := $(WLAN_ROOT)/$(WLAN_COMMON_ROOT)
 endif
 
 # Make WLAN as open-source driver by default
@@ -227,6 +227,11 @@ endif
 ifeq ($(CONFIG_ROME_IF),pci)
 	CONFIG_ATH_PCI := 1
 endif
+
+ifeq ($(CONFIG_ROME_IF),snoc)
+	CONFIG_HIF_SNOC:= 1
+endif
+
 ifeq ($(CONFIG_ROME_IF),usb)
 #CONFIG_ATH_PCI := 1
 endif
@@ -784,6 +789,7 @@ HIF_INC += -I$(WLAN_COMMON_INC)/$(HIF_SNOC_DIR)
 endif
 
 HIF_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/ath_procfs.o \
+		$(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_bmi.o \
 		$(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 \
@@ -801,7 +807,6 @@ HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DIR)/src/hif_napi.o
 endif
 
 HIF_PCIE_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_PCIE_DIR)/if_pci.o
-HIF_PCIE_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ce_bmi.o
 HIF_SNOC_OBJS := $(WLAN_COMMON_ROOT)/$(HIF_SNOC_DIR)/if_snoc.o
 
 HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DISPATCHER_DIR)/multibus.o

+ 32 - 18
core/bmi/src/bmi.c

@@ -37,6 +37,12 @@
 /* Enable BMI_TEST COMMANDs; The Value 0x09 is randomly choosen */
 #define BMI_TEST_ENABLE (0x09)
 
+#ifndef CONFIG_CNSS
+#define SHOULD_RUN_BMI_TEST_COMMANDS false
+#else
+#define SHOULD_RUN_BMI_TEST_COMMANDS (BMI_TEST_ENABLE == cnss_get_bmi_setup())
+#endif
+
 static QDF_STATUS
 bmi_command_test(uint32_t command, uint32_t address, uint8_t *data,
 				uint32_t length, struct ol_context *ol_ctx)
@@ -220,11 +226,33 @@ static inline uint32_t bmi_get_test_addr(void)
 }
 #endif
 
-QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx)
+/**
+ * run_bmi_test() - run some bmi tests
+ * @ol_ctx: bmi context
+ *
+ */
+static void run_bmi_test(struct ol_context *ol_ctx)
 {
 	uint8_t data[10], out[10];
 	uint32_t address;
 	int32_t ret;
+
+	ret = snprintf(data, 10, "ABCDEFGHI");
+	BMI_DBG("ret:%d writing data:%s\n", ret, data);
+	address = bmi_get_test_addr();
+
+	if (bmi_init(ol_ctx) != QDF_STATUS_SUCCESS) {
+		BMI_WARN("BMI_INIT Failed; No Memory!");
+		return;
+	}
+	bmi_command_test(BMI_NO_COMMAND, address, data, 9, ol_ctx);
+	bmi_command_test(BMI_WRITE_MEMORY, address, data, 9, ol_ctx);
+	bmi_command_test(BMI_READ_MEMORY, address, out, 9, ol_ctx);
+	BMI_DBG("Output:%s", out);
+}
+
+QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx)
+{
 	struct hif_opaque_softc *scn = ol_ctx->scn;
 
 	if (NO_BMI || !hif_needs_bmi(scn))
@@ -235,23 +263,9 @@ QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx)
 		bmi_assert(0);
 		return QDF_STATUS_NOT_INITIALIZED;
 	}
-#ifdef CONFIG_CNSS
-	if (BMI_TEST_ENABLE == cnss_get_bmi_setup()) {
-		ret = snprintf(data, 10, "ABCDEFGHI");
-		BMI_DBG("ret:%d writing data:%s\n", ret, data);
-		address = bmi_get_test_addr();
-
-		if (bmi_init(ol_ctx) != QDF_STATUS_SUCCESS) {
-			BMI_WARN("BMI_INIT Failed; No Memory!");
-			goto end;
-		}
-		bmi_command_test(BMI_NO_COMMAND, address, data, 9, ol_ctx);
-		bmi_command_test(BMI_WRITE_MEMORY, address, data, 9, ol_ctx);
-		bmi_command_test(BMI_READ_MEMORY, address, out, 9, ol_ctx);
-		BMI_DBG("Output:%s", out);
-	}
-#endif
-end:
+
+	if (SHOULD_RUN_BMI_TEST_COMMANDS)
+		run_bmi_test(ol_ctx);
 	return bmi_firmware_download(ol_ctx);
 }
 

+ 17 - 2
core/bmi/src/ol_fw.c

@@ -59,8 +59,11 @@ static uint32_t refclk_speed_to_hz[] = {
 	52000000,               /* SOC_REFCLK_52_MHZ */
 };
 
+#if  defined(CONFIG_CNSS)
 static int ol_target_coredump(void *inst, void *memory_block,
 					uint32_t block_len);
+#endif
+
 #ifdef FEATURE_SECURE_FIRMWARE
 static int ol_check_fw_hash(const u8 *data, u32 fw_size, ATH_BIN_FILE file)
 {
@@ -150,7 +153,9 @@ __ol_transfer_bin_file(struct ol_context *ol_ctx, ATH_BIN_FILE file,
 #endif
 	struct hif_target_info *tgt_info = hif_get_target_info_handle(scn);
 	uint32_t target_type = tgt_info->target_type;
+#if defined(CONFIG_CNSS)
 	struct bmi_info *bmi_ctx = GET_BMI_CONTEXT(ol_ctx);
+#endif
 	qdf_device_t qdf_dev = ol_ctx->qdf_dev;
 
 	switch (file) {
@@ -612,8 +617,10 @@ void ol_target_failure(void *instance, QDF_STATUS status)
 	struct ol_context *ol_ctx = instance;
 	struct hif_opaque_softc *scn = ol_ctx->scn;
 	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+#ifdef CONFIG_CNSS
 	struct ol_config_info *ini_cfg = ol_get_ini_handle(ol_ctx);
 	int ret;
+#endif
 	ol_target_status target_status =
 			hif_get_target_status(scn);
 
@@ -1218,9 +1225,9 @@ QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx)
 	struct ol_config_info *ini_cfg = ol_get_ini_handle(ol_ctx);
 	uint32_t target_type = tgt_info->target_type;
 	uint32_t target_version = tgt_info->target_version;
+#ifdef CONFIG_CNSS
 	struct bmi_info *bmi_ctx = GET_BMI_CONTEXT(ol_ctx);
 
-#ifdef CONFIG_CNSS
 	if (0 != cnss_get_fw_files_for_target(&bmi_ctx->fw_files,
 					      target_type,
 					      target_version)) {
@@ -1328,7 +1335,7 @@ QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx)
 	if (ini_cfg->enable_uart_print ||
 	    (WLAN_IS_EPPING_ENABLED(cds_get_conparam()) &&
 	     WLAN_IS_EPPING_FW_UART(cds_get_conparam()))) {
-		switch (tgt_info->target_version) {
+		switch (target_version) {
 		case AR6004_VERSION_REV1_3:
 			param = 11;
 			break;
@@ -1427,6 +1434,7 @@ int ol_diag_read(struct hif_opaque_softc *scn, uint8_t *buffer,
 		return -EIO;
 }
 
+#if  defined(CONFIG_CNSS)
 static int ol_ath_get_reg_table(uint32_t target_version,
 				tgt_reg_table *reg_table)
 {
@@ -1461,7 +1469,10 @@ static int ol_ath_get_reg_table(uint32_t target_version,
 
 	return section_len;
 }
+#endif
 
+
+#if  defined(CONFIG_CNSS)
 static int ol_diag_read_reg_loc(struct hif_opaque_softc *scn, uint8_t *buffer,
 				uint32_t buffer_len)
 {
@@ -1527,6 +1538,7 @@ static int ol_diag_read_reg_loc(struct hif_opaque_softc *scn, uint8_t *buffer,
 out:
 	return result;
 }
+#endif
 
 void ol_dump_target_memory(struct hif_opaque_softc *scn, void *memory_block)
 {
@@ -1552,6 +1564,8 @@ void ol_dump_target_memory(struct hif_opaque_softc *scn, void *memory_block)
 	}
 }
 
+
+#if  defined(CONFIG_CNSS)
 /**
  * ol_target_coredump() - API to collect target ramdump
  * @inst - private context
@@ -1638,6 +1652,7 @@ static int ol_target_coredump(void *inst, void *memory_block,
 	}
 	return ret;
 }
+#endif
 
 /**
  * ol_get_ini_handle() - API to get Ol INI configuration

+ 1 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -1259,7 +1259,6 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter,
 	QDF_STATUS err;
 	uint8_t *peer_mac_addr;
 	struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
-	ol_txrx_vdev_handle vdev;
 	ol_txrx_peer_handle peer;
 
 	if (!pdev) {
@@ -1309,6 +1308,7 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter,
 		if (pAdapter->device_mode == QDF_STA_MODE ||
 		    pAdapter->device_mode == QDF_P2P_CLIENT_MODE) {
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
+			ol_txrx_vdev_handle vdev;
 			unsigned long rc;
 
 			/* wait for event from firmware to set the event */

+ 4 - 5
core/utils/epping/src/epping_txrx.c

@@ -390,7 +390,6 @@ epping_adapter_t *epping_add_adapter(epping_context_t *pEpping_ctx,
 int epping_connect_service(epping_context_t *pEpping_ctx)
 {
 	int status, i;
-	int ret = -1;
 	HTC_SERVICE_CONNECT_REQ connect;
 	HTC_SERVICE_CONNECT_RESP response;
 
@@ -421,9 +420,9 @@ int epping_connect_service(epping_context_t *pEpping_ctx)
 	status = htc_connect_service(pEpping_ctx->HTCHandle, &connect, &response);
 	if (status != EOK) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
-			   "Failed to connect to Endpoint Ping BE service status:%d \n",
+			   "Failed to connect to Endpoint Ping BE service status:%d\n",
 			   status);
-		return -1;;
+		return status;
 	} else {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "eppingtest BE endpoint:%d\n", response.Endpoint);
@@ -435,9 +434,9 @@ int epping_connect_service(epping_context_t *pEpping_ctx)
 	status = htc_connect_service(pEpping_ctx->HTCHandle, &connect, &response);
 	if (status != EOK) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
-			   "Failed to connect to Endpoint Ping BK service status:%d \n",
+			   "Failed to connect to Endpoint Ping BK service status:%d\n",
 			   status);
-		return ret;
+		return status;
 	} else {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "eppingtest BK endpoint:%d\n", response.Endpoint);

+ 2 - 6
core/wma/src/wma_features.c

@@ -5695,21 +5695,18 @@ QDF_STATUS wma_suspend_target(WMA_HANDLE handle, int disable_target_intr)
 	QDF_STATUS status;
 	struct suspend_params param = {0};
 
-#ifdef CONFIG_CNSS
 	tpAniSirGlobal pmac = cds_get_context(QDF_MODULE_ID_PE);
-#endif
 
 	if (!wma_handle || !wma_handle->wmi_handle) {
 		WMA_LOGE("WMA is closed. can not issue suspend cmd");
 		return QDF_STATUS_E_INVAL;
 	}
 
-#ifdef CONFIG_CNSS
 	if (NULL == pmac) {
 		WMA_LOGE("%s: Unable to get PE context", __func__);
 		return QDF_STATUS_E_INVAL;
 	}
-#endif
+
 	qdf_event_reset(&wma_handle->target_suspend);
 	param.disable_target_intr = disable_target_intr;
 	status = wmi_unified_suspend_send(wma_handle->wmi_handle,
@@ -5772,7 +5769,6 @@ void wma_target_suspend_acknowledge(void *context)
  */
 QDF_STATUS wma_resume_target(WMA_HANDLE handle)
 {
-	int ret;
 	tp_wma_handle wma = (tp_wma_handle) handle;
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 #ifdef CONFIG_CNSS
@@ -5818,7 +5814,7 @@ QDF_STATUS wma_resume_target(WMA_HANDLE handle)
 	if (QDF_STATUS_SUCCESS == qdf_status)
 		wmi_set_target_suspend(wma->wmi_handle, false);
 
-	return ret;
+	return qdf_status;
 }
 
 #ifdef FEATURE_WLAN_TDLS