Просмотр исходного кода

qcacmn: Change semantics of Runtime Lock APIs

Runtime PM lock init API right now returns pointer to a context
but this would cause confusion to the caller if feature is not
defined and dummy function return NULL as caller can't find real
failure versus dummy function returning because feature not being
enabled.

Fix declaring a data structure in QDF layer that caller can use
but it hides the internal details of HIF implementation for
Runtime PM locks.

CRs-fixed: 1116509
Change-Id: I4dcba604e803faa0e14fac6403610391895e382e
Prashanth Bhatta 8 лет назад
Родитель
Сommit
bcd3481965
2 измененных файлов с 6 добавлено и 6 удалено
  1. 3 3
      core/src/wlan_p2p_main.c
  2. 3 3
      core/src/wlan_p2p_roc.c

+ 3 - 3
core/src/wlan_p2p_main.c

@@ -663,8 +663,8 @@ QDF_STATUS p2p_psoc_object_open(struct wlan_objmgr_psoc *soc)
 		p2p_err("failed to create cancel roc done event");
 		goto fail_event;
 	}
-	p2p_soc_obj->roc_runtime_lock = qdf_runtime_lock_init(
-						P2P_MODULE_NAME);
+
+	qdf_runtime_lock_init(&p2p_soc_obj->roc_runtime_lock);
 
 	p2p_debug("p2p psoc object open successful");
 
@@ -694,7 +694,7 @@ QDF_STATUS p2p_psoc_object_close(struct wlan_objmgr_psoc *soc)
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	qdf_runtime_lock_deinit(p2p_soc_obj->roc_runtime_lock);
+	qdf_runtime_lock_deinit(&p2p_soc_obj->roc_runtime_lock);
 	qdf_event_destroy(&p2p_soc_obj->cancel_roc_done);
 	qdf_list_destroy(&p2p_soc_obj->tx_q_ack);
 	qdf_list_destroy(&p2p_soc_obj->tx_q_roc);

+ 3 - 3
core/src/wlan_p2p_roc.c

@@ -345,7 +345,7 @@ static QDF_STATUS p2p_execute_roc_req(struct p2p_roc_context *roc_ctx)
 		roc_ctx->roc_type, roc_ctx->roc_state);
 
 	/* prevent runtime suspend */
-	qdf_runtime_pm_prevent_suspend(p2p_soc_obj->roc_runtime_lock);
+	qdf_runtime_pm_prevent_suspend(&p2p_soc_obj->roc_runtime_lock);
 
 	status = qdf_mc_timer_init(&roc_ctx->roc_timer,
 			QDF_TIMER_TYPE_SW, p2p_roc_timeout,
@@ -375,7 +375,7 @@ fail:
 	if (status != QDF_STATUS_SUCCESS) {
 		p2p_destroy_roc_ctx(roc_ctx, true, true);
 		qdf_runtime_pm_allow_suspend(
-			p2p_soc_obj->roc_runtime_lock);
+			&p2p_soc_obj->roc_runtime_lock);
 		return status;
 	}
 
@@ -501,7 +501,7 @@ static QDF_STATUS p2p_process_scan_complete_evt(
 		roc_ctx->roc_type, roc_ctx->roc_state);
 
 	/* allow runtime suspend */
-	qdf_runtime_pm_allow_suspend(p2p_soc_obj->roc_runtime_lock);
+	qdf_runtime_pm_allow_suspend(&p2p_soc_obj->roc_runtime_lock);
 
 	if (QDF_TIMER_STATE_RUNNING ==
 		qdf_mc_timer_get_current_state(&roc_ctx->roc_timer)) {