Browse Source

qcacld-3.0: Enable to use certain platform driver APIs

Currently cnss_wlan_enable() and cnss_wlan_disable() APIs are only
used for a temporary emulation case for PCIe bus. Enable to compile
them for all cases for PCIe bus.

Change-Id: I27b1982f89e045564ed991c8a570ebf6a87bcf33
CRs-fixed: 1082183
Yue Ma 8 years ago
parent
commit
0804752e83
3 changed files with 23 additions and 18 deletions
  1. 3 3
      core/pld/src/pld_common.c
  2. 5 7
      core/pld/src/pld_pcie.c
  3. 15 8
      core/pld/src/pld_pcie.h

+ 3 - 3
core/pld/src/pld_common.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -356,7 +356,7 @@ int pld_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
 
 	switch (pld_get_bus_type(dev)) {
 	case PLD_BUS_TYPE_PCIE:
-		ret = pld_pcie_wlan_enable(config, mode, host_version);
+		ret = pld_pcie_wlan_enable(dev, config, mode, host_version);
 		break;
 	case PLD_BUS_TYPE_SNOC:
 		ret = pld_snoc_wlan_enable(config, mode, host_version);
@@ -387,7 +387,7 @@ int pld_wlan_disable(struct device *dev, enum pld_driver_mode mode)
 
 	switch (pld_get_bus_type(dev)) {
 	case PLD_BUS_TYPE_PCIE:
-		ret = pld_pcie_wlan_disable(mode);
+		ret = pld_pcie_wlan_disable(dev, mode);
 		break;
 	case PLD_BUS_TYPE_SNOC:
 		ret = pld_snoc_wlan_disable(mode);

+ 5 - 7
core/pld/src/pld_pcie.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -366,7 +366,6 @@ int pld_pcie_get_ce_id(int irq)
 }
 
 #ifdef CONFIG_PLD_PCIE_CNSS
-#ifdef QCA_WIFI_3_0_ADRASTEA
 /**
  * pld_pcie_wlan_enable() - Enable WLAN
  * @config: WLAN configuration data
@@ -379,7 +378,7 @@ int pld_pcie_get_ce_id(int irq)
  * Return: 0 for success
  *         Non zero failure code for errors
  */
-int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
+int pld_pcie_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
 			 enum pld_driver_mode mode, const char *host_version)
 {
 	struct cnss_wlan_enable_cfg cfg;
@@ -406,7 +405,7 @@ int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
 		cnss_mode = CNSS_MISSION;
 		break;
 	}
-	return cnss_wlan_enable(&cfg, cnss_mode, host_version);
+	return cnss_wlan_enable(dev, &cfg, cnss_mode, host_version);
 }
 
 /**
@@ -418,11 +417,10 @@ int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
  * Return: 0 for success
  *         Non zero failure code for errors
  */
-int pld_pcie_wlan_disable(enum pld_driver_mode mode)
+int pld_pcie_wlan_disable(struct device *dev, enum pld_driver_mode mode)
 {
-	return cnss_wlan_disable(CNSS_OFF);
+	return cnss_wlan_disable(dev, CNSS_OFF);
 }
-#endif
 
 /**
  * pld_pcie_get_fw_files_for_target() - Get FW file names

+ 15 - 8
core/pld/src/pld_pcie.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -66,16 +66,26 @@ void pld_pcie_unregister_driver(void);
 int pld_pcie_get_ce_id(int irq);
 #endif
 
-#if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(QCA_WIFI_3_0_ADRASTEA))
-static inline int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
-		    enum pld_driver_mode mode, const char *host_version)
+#ifndef CONFIG_PLD_PCIE_CNSS
+static inline int pld_pcie_wlan_enable(struct device *dev,
+				       struct pld_wlan_enable_cfg *config,
+				       enum pld_driver_mode mode,
+				       const char *host_version)
 {
 	return 0;
 }
-static inline int pld_pcie_wlan_disable(enum pld_driver_mode mode)
+static inline int pld_pcie_wlan_disable(struct device *dev,
+					enum pld_driver_mode mode)
 {
 	return 0;
 }
+#else
+int pld_pcie_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
+			 enum pld_driver_mode mode, const char *host_version);
+int pld_pcie_wlan_disable(struct device *dev, enum pld_driver_mode mode);
+#endif
+
+#if (!defined(CONFIG_PLD_PCIE_CNSS)) || (!defined(QCA_WIFI_3_0_ADRASTEA))
 static inline int pld_pcie_set_fw_debug_mode(bool enablefwlog)
 {
 	return 0;
@@ -85,9 +95,6 @@ static inline void pld_pcie_intr_notify_q6(void)
 	return;
 }
 #else
-int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
-			 enum pld_driver_mode mode, const char *host_version);
-int pld_pcie_wlan_disable(enum pld_driver_mode mode);
 static inline int pld_pcie_set_fw_debug_mode(bool enablefwlog)
 {
 	return cnss_set_fw_debug_mode(enablefwlog);