Ver Fonte

qcacld-3.0: Remove CDS related functions in HTC

Update runtime PM APIs and HTC connection mode parameter
accordingly.

Change-Id: I2f54933b90aaed233042c113d246fae4726f5707
CRs-fixed: 982024
Yue Ma há 9 anos atrás
pai
commit
1e11d79646

+ 2 - 2
core/cds/src/cds_api.c

@@ -55,7 +55,7 @@
 #include "ol_fw.h"
 #include "ol_if_athvar.h"
 #include "hif.h"
-
+#include "cds_concurrency.h"
 #include "cds_utils.h"
 #include "wlan_logging_sock_svc.h"
 #include "wma.h"
@@ -273,7 +273,7 @@ QDF_STATUS cds_open(void)
 
 	/* Create HTC */
 	gp_cds_context->htc_ctx =
-		htc_create(scn, &htcInfo, qdf_ctx);
+		htc_create(scn, &htcInfo, qdf_ctx, cds_get_conparam());
 	if (!gp_cds_context->htc_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
 			  "%s: Failed to Create HTC", __func__);

+ 4 - 0
core/dp/ol/inc/ol_txrx_ctrl_api.h

@@ -674,6 +674,10 @@ ol_txrx_set_monitor_mode_vap(ol_txrx_pdev_handle pdev,
  */
 void ol_txrx_set_curchan(ol_txrx_pdev_handle pdev, uint32_t chan_mhz);
 
+#ifdef FEATURE_RUNTIME_PM
+QDF_STATUS ol_txrx_runtime_suspend(ol_txrx_pdev_handle txrx_pdev);
+QDF_STATUS ol_txrx_runtime_resume(ol_txrx_pdev_handle txrx_pdev);
+#endif
 QDF_STATUS ol_txrx_bus_suspend(void);
 QDF_STATUS ol_txrx_bus_resume(void);
 QDF_STATUS ol_txrx_wait_for_pending_tx(int timeout);

+ 32 - 0
core/dp/txrx/ol_txrx.c

@@ -1918,6 +1918,38 @@ QDF_STATUS ol_txrx_wait_for_pending_tx(int timeout)
 #define SUSPEND_DRAIN_WAIT 3000
 #endif
 
+#ifdef FEATURE_RUNTIME_PM
+/**
+ * ol_txrx_runtime_suspend() - ensure TXRX is ready to runtime suspend
+ * @txrx_pdev: TXRX pdev context
+ *
+ * TXRX is ready to runtime suspend if there are no pending packets
+ * in the tx queue.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ol_txrx_runtime_suspend(ol_txrx_pdev_handle txrx_pdev)
+{
+	if (ol_txrx_get_tx_pending(txrx_pdev))
+		return QDF_STATUS_E_BUSY;
+	else
+		return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * ol_txrx_runtime_resume() - ensure TXRX is ready to runtime resume
+ * @txrx_pdev: TXRX pdev context
+ *
+ * This is a dummy function for symmetry.
+ *
+ * Return: QDF_STATUS_SUCCESS
+ */
+QDF_STATUS ol_txrx_runtime_resume(ol_txrx_pdev_handle txrx_pdev)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 /**
  * ol_txrx_bus_suspend() - bus suspend
  *

+ 14 - 3
core/hdd/src/wlan_hdd_driver_ops.c

@@ -681,6 +681,8 @@ static int __wlan_hdd_runtime_suspend(void)
 {
 	void *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+	void *txrx_pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	void *htc_ctx = cds_get_context(QDF_MODULE_ID_HTC);
 	int status = wlan_hdd_validate_context(hdd_ctx);
 
 	if (0 != status)
@@ -690,10 +692,14 @@ static int __wlan_hdd_runtime_suspend(void)
 	if (status)
 		goto process_failure;
 
-	status = htc_runtime_suspend();
+	status = qdf_status_to_os_return(ol_txrx_runtime_suspend(txrx_pdev));
 	if (status)
 		goto process_failure;
 
+	status = htc_runtime_suspend(htc_ctx);
+	if (status)
+		goto resume_txrx;
+
 	status = wma_runtime_suspend();
 	if (status)
 		goto resume_htc;
@@ -714,7 +720,9 @@ resume_hif:
 resume_wma:
 	QDF_BUG(!wma_runtime_resume());
 resume_htc:
-	QDF_BUG(!htc_runtime_resume());
+	QDF_BUG(!htc_runtime_resume(htc_ctx));
+resume_txrx:
+	QDF_BUG(!qdf_status_to_os_return(ol_txrx_runtime_resume(txrx_pdev)));
 process_failure:
 	hif_process_runtime_suspend_failure(hif_ctx);
 	return status;
@@ -751,12 +759,15 @@ static int wlan_hdd_runtime_suspend(void)
 static int __wlan_hdd_runtime_resume(void)
 {
 	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
+	void *htc_ctx = cds_get_context(QDF_MODULE_ID_HTC);
+	void *txrx_pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
 	hif_pre_runtime_resume(hif_ctx);
 	QDF_BUG(!cnss_auto_resume());
 	QDF_BUG(!hif_runtime_resume(hif_ctx));
 	QDF_BUG(!wma_runtime_resume());
-	QDF_BUG(!htc_runtime_resume());
+	QDF_BUG(!htc_runtime_resume(htc_ctx));
+	QDF_BUG(!qdf_status_to_os_return(ol_txrx_runtime_resume(txrx_pdev)));
 	hif_process_runtime_resume_success(hif_ctx);
 	return 0;
 }

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

@@ -266,7 +266,7 @@ static QDF_STATUS wlan_ftm_cds_open(v_CONTEXT_t p_cds_context,
 
 	/* Create HTC */
 	gp_cds_context->htc_ctx =
-		htc_create(pHifContext, &htcInfo, qdf_ctx);
+		htc_create(pHifContext, &htcInfo, qdf_ctx, hdd_get_conparam());
 	if (!gp_cds_context->htc_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
 			  "%s: Failed to Create HTC", __func__);

+ 2 - 1
core/utils/epping/src/epping_main.c

@@ -239,7 +239,8 @@ int epping_enable(struct device *parent_dev)
 	qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 
 	/* Create HTC */
-	p_cds_context->htc_ctx = htc_create(scn, &htcInfo, qdf_ctx);
+	p_cds_context->htc_ctx = htc_create(scn, &htcInfo, qdf_ctx,
+					    cds_get_conparam());
 	if (!p_cds_context->htc_ctx) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
 			  "%s: Failed to Create HTC", __func__);