Browse Source

qcacld-3.0: Add PLD API to enable WLAN HW

WLAN HW can be disabled at boot and thus wlan boot activities will be
deferred. Add PLD API to start wlan boot time sequence in platform
driver after HW is enabled.

Change-Id: I9dcdc9944b7f71dc3488a20719ca36c00ae62a4e
CRs-Fixed: 3222032
Manikandan Mohan 2 years ago
parent
commit
4df1739060
4 changed files with 34 additions and 2 deletions
  1. 1 1
      core/hdd/src/wlan_hdd_main.c
  2. 1 1
      core/pld/inc/pld_common.h
  3. 15 0
      core/pld/src/pld_common.c
  4. 17 0
      core/pld/src/pld_pcie.h

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

@@ -17836,7 +17836,7 @@ static int hdd_wlan_soft_driver_load(void)
 {
 	if (!cds_is_driver_loaded()) {
 		pr_info("Enabling CNSS WLAN HW\n");
-		cnss_wlan_hw_enable();
+		pld_wlan_hw_enable();
 		return 0;
 	}
 

+ 1 - 1
core/pld/inc/pld_common.h

@@ -592,7 +592,7 @@ void pld_get_bus_reg_dump(struct device *dev, uint8_t *buf, uint32_t len);
 int pld_shadow_control(struct device *dev, bool enable);
 void pld_schedule_recovery_work(struct device *dev,
 				enum pld_recovery_reason reason);
-
+int pld_wlan_hw_enable(void);
 #ifdef FEATURE_WLAN_TIME_SYNC_FTM
 int pld_get_audio_wlan_timestamp(struct device *dev,
 				 enum pld_wlan_time_sync_trigger_type type,

+ 15 - 0
core/pld/src/pld_common.c

@@ -511,6 +511,21 @@ int pld_wlan_disable(struct device *dev, enum pld_driver_mode mode)
 	return ret;
 }
 
+/**
+ * pld_wlan_hw_enable() - Enable WLAN HW
+ *
+ * This function enables WLAN HW. If WLAN is secured disabled at boot all wlan
+ * boot time activities are deferred. This is used to run deferred activities
+ * after wlan is enabled.
+ *
+ * Return: 0 for success
+ *         Non zero failure code for errors
+ */
+int pld_wlan_hw_enable(void)
+{
+	return pld_pcie_wlan_hw_enable();
+}
+
 /**
  * pld_set_fw_log_mode() - Set FW debug log mode
  * @dev: device

+ 17 - 0
core/pld/src/pld_pcie.h

@@ -76,10 +76,27 @@ static inline int pld_pcie_wlan_disable(struct device *dev,
 {
 	return 0;
 }
+
+static inline int pld_pcie_wlan_hw_enable(void)
+{
+	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);
+#ifdef FEATURE_CNSS_HW_SECURE_DISABLE
+static inline int pld_pcie_wlan_hw_enable(void)
+{
+	return cnss_wlan_hw_enable();
+}
+#else
+static inline int pld_pcie_wlan_hw_enable(void)
+{
+	return -EINVAL;
+}
+#endif
 #endif
 
 #if defined(CONFIG_PLD_PCIE_CNSS)