summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Wang <yyuwang@codeaurora.org>2017-02-15 19:09:24 +0800
committerqcabuildsw <qcabuildsw@localhost>2017-02-28 11:47:24 -0800
commitd0826bf8eefa73c3d1ebffd2866a7f4bb9b1f3a0 (patch)
tree502c1bc537d66268add1cc354b94f8c1a7c30158
parent52e4d72ca144cdf7cb782aa51ba57766e74db4ff (diff)
qcacld-3.0: Update prefix for multi-interface with chip name
1. The paths for driver to get ini and fw files are incorrect for QCA SDIO chip on Dual-WiFi platforms, with wrong prefix or no prefix. Correct prefix for ini file, from '<mod_name>' to '<chip_name>/'; add prefix '<chip_name>/' for fw files. 2. For QCA9377, there is a special cnss API for getting fw names, it's cnss_get_qca9377_fw_files(). Use the right cnss API to get fw files for QCA9377 Change-Id: Ia7616153b6823e9550703e649c7fc21ab306ca07 CRs-Fixed: 2008217
-rw-r--r--Kbuild9
-rw-r--r--core/hdd/inc/wlan_hdd_misc.h4
-rw-r--r--core/pld/inc/pld_common.h3
-rw-r--r--core/pld/src/pld_sdio.c51
-rw-r--r--core/pld/src/pld_sdio.h16
5 files changed, 55 insertions, 28 deletions
diff --git a/Kbuild b/Kbuild
index f19b2dcefe32..987a04f00dee 100644
--- a/Kbuild
+++ b/Kbuild
@@ -1504,6 +1504,10 @@ CDEFINES += -DWLAN_FEATURE_RX_FULL_REORDER_OL
endif
endif
+ifeq ($(CONFIG_ARCH_MDM9607), y)
+CDEFINES += -DCONFIG_TUFELLO_DUAL_FW_SUPPORT
+endif
+
#Enable Signed firmware support for split binary format
ifeq ($(CONFIG_QCA_SIGNED_SPLIT_BINARY_SUPPORT), 1)
CDEFINES += -DQCA_SIGNED_SPLIT_BINARY_SUPPORT
@@ -1632,13 +1636,14 @@ EXTRA_CFLAGS += -Wheader-guard
endif
# If the module name is not "wlan", then the define MULTI_IF_NAME to be the
-# same a the module name. The host driver will then append MULTI_IF_NAME to
+# same a the QCA CHIP name. The host driver will then append MULTI_IF_NAME to
# any string that must be unique for all instances of the driver on the system.
# This allows multiple instances of the driver with different module names.
# If the module name is wlan, leave MULTI_IF_NAME undefined and the code will
# treat the driver as the primary driver.
ifneq ($(MODNAME), wlan)
-CDEFINES += -DMULTI_IF_NAME=\"$(MODNAME)\"
+CHIP_NAME ?= $(MODNAME)
+CDEFINES += -DMULTI_IF_NAME=\"$(CHIP_NAME)\"
endif
# WLAN_HDD_ADAPTER_MAGIC must be unique for all instances of the driver on the
diff --git a/core/hdd/inc/wlan_hdd_misc.h b/core/hdd/inc/wlan_hdd_misc.h
index 82e1b2b5d8fa..0ca4a05e25bb 100644
--- a/core/hdd/inc/wlan_hdd_misc.h
+++ b/core/hdd/inc/wlan_hdd_misc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2014,2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014,2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -32,7 +32,7 @@
* to prevent name conflicts when loading multiple instances of the driver.
*/
#ifdef MULTI_IF_NAME
-#define PREFIX MULTI_IF_NAME
+#define PREFIX MULTI_IF_NAME "/"
#else
#define PREFIX ""
#endif
diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h
index 3c089872ff47..3c794ce260f3 100644
--- a/core/pld/inc/pld_common.h
+++ b/core/pld/inc/pld_common.h
@@ -31,6 +31,7 @@
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
+#include <osapi_linux.h>
#define PLD_IMAGE_FILE "athwlan.bin"
#define PLD_UTF_FIRMWARE_FILE "utf.bin"
@@ -70,7 +71,7 @@ enum pld_bus_width_type {
PLD_BUS_WIDTH_HIGH
};
-#define PLD_MAX_FILE_NAME 20
+#define PLD_MAX_FILE_NAME NAME_MAX
/**
* struct pld_fw_file - WLAN FW file names
diff --git a/core/pld/src/pld_sdio.c b/core/pld/src/pld_sdio.c
index 14b17f989b26..87df90a4d737 100644
--- a/core/pld/src/pld_sdio.c
+++ b/core/pld/src/pld_sdio.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -28,6 +28,8 @@
#include "pld_common.h"
#include "pld_internal.h"
+#include "pld_sdio.h"
+
#ifdef CONFIG_SDIO
/* SDIO manufacturer ID and Codes */
@@ -288,6 +290,18 @@ void pld_sdio_unregister_driver(void)
#endif
#ifdef CONFIG_PLD_SDIO_CNSS
+#ifdef CONFIG_TUFELLO_DUAL_FW_SUPPORT
+static inline int pld_sdio_is_tufello_dual_fw_supported(void)
+{
+ return 1;
+}
+#else
+static inline int pld_sdio_is_tufello_dual_fw_supported(void)
+{
+ return 0;
+#endif
+}
+
/**
* pld_sdio_get_fw_files_for_target() - Get FW file names
* @pfw_files: buffer for FW file names
@@ -310,25 +324,30 @@ int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files,
memset(pfw_files, 0, sizeof(*pfw_files));
- ret = cnss_get_fw_files_for_target(&cnss_fw_files,
+ if (target_version == PLD_QCA9377_REV1_1_VERSION) {
+ cnss_get_qca9377_fw_files(&cnss_fw_files, PLD_MAX_FILE_NAME,
+ pld_sdio_is_tufello_dual_fw_supported());
+ } else {
+ ret = cnss_get_fw_files_for_target(&cnss_fw_files,
target_type, target_version);
+ }
if (0 != ret)
return ret;
- strlcpy(pfw_files->image_file, cnss_fw_files.image_file,
- PLD_MAX_FILE_NAME);
- strlcpy(pfw_files->board_data, cnss_fw_files.board_data,
- PLD_MAX_FILE_NAME);
- strlcpy(pfw_files->otp_data, cnss_fw_files.otp_data,
- PLD_MAX_FILE_NAME);
- strlcpy(pfw_files->utf_file, cnss_fw_files.utf_file,
- PLD_MAX_FILE_NAME);
- strlcpy(pfw_files->utf_board_data, cnss_fw_files.utf_board_data,
- PLD_MAX_FILE_NAME);
- strlcpy(pfw_files->epping_file, cnss_fw_files.epping_file,
- PLD_MAX_FILE_NAME);
- strlcpy(pfw_files->evicted_data, cnss_fw_files.evicted_data,
- PLD_MAX_FILE_NAME);
+ snprintf(pfw_files->image_file, PLD_MAX_FILE_NAME, PREFIX "%s",
+ cnss_fw_files.image_file);
+ snprintf(pfw_files->board_data, PLD_MAX_FILE_NAME, PREFIX "%s",
+ cnss_fw_files.board_data);
+ snprintf(pfw_files->otp_data, PLD_MAX_FILE_NAME, PREFIX "%s",
+ cnss_fw_files.otp_data);
+ snprintf(pfw_files->utf_file, PLD_MAX_FILE_NAME, PREFIX "%s",
+ cnss_fw_files.utf_file);
+ snprintf(pfw_files->utf_board_data, PLD_MAX_FILE_NAME, PREFIX "%s",
+ cnss_fw_files.utf_board_data);
+ snprintf(pfw_files->epping_file, PLD_MAX_FILE_NAME, PREFIX "%s",
+ cnss_fw_files.epping_file);
+ snprintf(pfw_files->evicted_data, PLD_MAX_FILE_NAME, PREFIX "%s",
+ cnss_fw_files.evicted_data);
return ret;
}
diff --git a/core/pld/src/pld_sdio.h b/core/pld/src/pld_sdio.h
index 2ac4ceafa11f..77cf0ddd1b8c 100644
--- a/core/pld/src/pld_sdio.h
+++ b/core/pld/src/pld_sdio.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -21,6 +21,14 @@
#include "pld_common.h"
+#ifdef MULTI_IF_NAME
+#define PREFIX MULTI_IF_NAME "/"
+#else
+#define PREFIX ""
+#endif
+
+#define PLD_QCA9377_REV1_1_VERSION 0x5020001
+
#ifndef CONFIG_CNSS
#define PLD_AR6004_VERSION_REV1_3 0x31c8088a
#define PLD_AR9888_REV2_VERSION 0x4100016c
@@ -31,13 +39,7 @@
#define PLD_AR6320_REV3_VERSION 0x5020000
#define PLD_AR6320_REV3_2_VERSION 0x5030000
#define PLD_AR6320_DEV_VERSION 0x1000000
-#define PLD_QCA9377_REV1_1_VERSION 0x5020001
-#ifdef MULTI_IF_NAME
-#define PREFIX MULTI_IF_NAME
-#else
-#define PREFIX ""
-#endif
struct pld_fw_files fw_files_qca6174_fw_1_1 = {
PREFIX "qwlan11.bin", PREFIX "bdwlan11.bin", PREFIX "otp11.bin",