Răsfoiți Sursa

qcacmn: Add support to create global obj as part of init

Add support to create global obj manager as part of init
sequence and also use QDF return types in all obj manager API's.

Change-Id: I0c58be908f36912764914bf9aba9b006220e8c0d
CRs-Fixed: 1107317
Selvaraj, Sridhar 8 ani în urmă
părinte
comite
85ad39b00e

+ 14 - 7
init_deinit/dispatcher/inc/dispatcher_init_deinit.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
@@ -25,6 +25,9 @@
 #define __DISPATCHER_INIT_H
 
 #include <qdf_types.h>
+#include <wlan_objmgr_cmn.h>
+#include <wlan_objmgr_psoc_obj.h>
+#include <wlan_objmgr_global_obj.h>
 
 /**
  * dispatcher_init(): API to init all new components
@@ -60,6 +63,7 @@ QDF_STATUS dispatcher_deinit(void);
 
 /**
  * dispatcher_psoc_open(): API to trigger PSOC open for all new components
+ * @psoc: psoc context
  *
  * This API calls all new components PSOC OPEN APIs. This is invoked from
  * HDD/OS_If layer during:
@@ -73,10 +77,11 @@ QDF_STATUS dispatcher_deinit(void);
  *
  * Return: none
  */
-QDF_STATUS dispatcher_psoc_open(void);
+QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc);
 
 /**
  * dispatcher_psoc_close(): API to trigger PSOC close for all new components
+ * @psoc: psoc context
  *
  * This API calls all new components PSOC CLOSE APIs. This is invoked from
  * HDD/OS_If layer during:
@@ -89,11 +94,12 @@ QDF_STATUS dispatcher_psoc_open(void);
  *
  * Return: none
  */
-QDF_STATUS dispatcher_psoc_close(void);
+QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc);
 
 /**
  * dispatcher_psoc_enable(): API to trigger PSOC enable(start) for all new
- *	components
+ *                           components
+ * @psoc: psoc context
  *
  * This API calls all new components PSOC enable(start) APIs. This is invoked
  * from HDD/OS_If layer during:
@@ -107,11 +113,12 @@ QDF_STATUS dispatcher_psoc_close(void);
  *
  * Return: none
  */
-QDF_STATUS dispatcher_psoc_enable(void);
+QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc);
 
 /**
  * dispatcher_psoc_disable(): API to trigger PSOC disable(stop) for all new
- *	components
+ *                            components
+ * @psoc: psoc context
  *
  * This API calls all new components PSOC disable(stop) APIs. This is invoked
  * from HDD/OS_If layer during:
@@ -126,6 +133,6 @@ QDF_STATUS dispatcher_psoc_enable(void);
  *
  * Return: none
  */
-QDF_STATUS dispatcher_psoc_disable(void);
+QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc);
 
 #endif /* End of  !defined(__DISPATCHER_INIT_H) */

+ 37 - 46
init_deinit/dispatcher/src/dispatcher_init_deinit.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
@@ -18,6 +18,7 @@
 
 #include <qdf_types.h>
 #include <qdf_trace.h>
+#include <qdf_threads.h>
 #include <dispatcher_init_deinit.h>
 #ifdef NAPIER_CODE
 #include <scheduler_api.h>
@@ -33,16 +34,6 @@
  * thier actual handlers are ready
  */
 
-static QDF_STATUS obj_manager_init(void)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
-static QDF_STATUS obj_manager_deinit(void)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
 static QDF_STATUS scm_init(void)
 {
 	return QDF_STATUS_SUCCESS;
@@ -74,65 +65,65 @@ static QDF_STATUS tdls_deinit(void)
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS scm_psoc_open(void)
+static QDF_STATUS scm_psoc_open(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS scm_psoc_close(void)
+static QDF_STATUS scm_psoc_close(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS p2p_psoc_open(void)
+static QDF_STATUS p2p_psoc_open(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS p2p_psoc_close(void)
+static QDF_STATUS p2p_psoc_close(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS tdls_psoc_open(void)
+static QDF_STATUS tdls_psoc_open(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS tdls_psoc_close(void)
+static QDF_STATUS tdls_psoc_close(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS scm_psoc_enable(void)
+static QDF_STATUS scm_psoc_enable(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS scm_psoc_disable(void)
+static QDF_STATUS scm_psoc_disable(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
 
-static QDF_STATUS p2p_psoc_enable(void)
+static QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
-static QDF_STATUS p2p_psoc_disable(void)
+static QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
 
-static QDF_STATUS tdls_psoc_enable(void)
+static QDF_STATUS tdls_psoc_enable(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
 
 
-static QDF_STATUS tdls_psoc_disable(void)
+static QDF_STATUS tdls_psoc_disable(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_SUCCESS;
 }
@@ -151,7 +142,7 @@ static QDF_STATUS scheduler_deinit(void)
 
 QDF_STATUS dispatcher_init(void)
 {
-	if (QDF_STATUS_SUCCESS != obj_manager_init())
+	if (QDF_STATUS_SUCCESS != wlan_objmgr_global_obj_init())
 		goto out;
 
 	if (QDF_STATUS_SUCCESS != scm_init())
@@ -175,7 +166,7 @@ tdls_init_fail:
 p2p_init_fail:
 	scm_deinit();
 scm_init_fail:
-	obj_manager_deinit();
+	wlan_objmgr_global_obj_deinit();
 
 out:
 	return QDF_STATUS_E_FAILURE;
@@ -191,73 +182,73 @@ QDF_STATUS dispatcher_deinit(void)
 
 	QDF_BUG(QDF_STATUS_SUCCESS == scm_deinit());
 
-	QDF_BUG(QDF_STATUS_SUCCESS == obj_manager_deinit());
+	QDF_BUG(QDF_STATUS_SUCCESS == wlan_objmgr_global_obj_deinit());
 
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS dispatcher_psoc_open(void)
+QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc)
 {
-	if (QDF_STATUS_SUCCESS != scm_psoc_open())
+	if (QDF_STATUS_SUCCESS != scm_psoc_open(psoc))
 		goto out;
 
-	if (QDF_STATUS_SUCCESS != p2p_psoc_open())
+	if (QDF_STATUS_SUCCESS != p2p_psoc_open(psoc))
 		goto p2p_psoc_open_fail;
 
-	if (QDF_STATUS_SUCCESS != tdls_psoc_open())
+	if (QDF_STATUS_SUCCESS != tdls_psoc_open(psoc))
 		goto tdls_psoc_open_fail;
 
 	return QDF_STATUS_SUCCESS;
 
 tdls_psoc_open_fail:
-	p2p_psoc_close();
+	p2p_psoc_close(psoc);
 p2p_psoc_open_fail:
-	scm_psoc_close();
+	scm_psoc_close(psoc);
 
 out:
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS dispatcher_psoc_close(void)
+QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc)
 {
-	QDF_BUG(QDF_STATUS_SUCCESS == tdls_psoc_close());
+	QDF_BUG(QDF_STATUS_SUCCESS == tdls_psoc_close(psoc));
 
-	QDF_BUG(QDF_STATUS_SUCCESS == p2p_psoc_close());
+	QDF_BUG(QDF_STATUS_SUCCESS == p2p_psoc_close(psoc));
 
-	QDF_BUG(QDF_STATUS_SUCCESS == scm_psoc_close());
+	QDF_BUG(QDF_STATUS_SUCCESS == scm_psoc_close(psoc));
 
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS dispatcher_psoc_enable(void)
+QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc)
 {
-	if (QDF_STATUS_SUCCESS != scm_psoc_enable())
+	if (QDF_STATUS_SUCCESS != scm_psoc_enable(psoc))
 		goto out;
 
-	if (QDF_STATUS_SUCCESS != p2p_psoc_enable())
+	if (QDF_STATUS_SUCCESS != p2p_psoc_enable(psoc))
 		goto p2p_psoc_enable_fail;
 
-	if (QDF_STATUS_SUCCESS != tdls_psoc_enable())
+	if (QDF_STATUS_SUCCESS != tdls_psoc_enable(psoc))
 		goto tdls_psoc_enable_fail;
 
 	return QDF_STATUS_SUCCESS;
 
 tdls_psoc_enable_fail:
-	p2p_psoc_disable();
+	p2p_psoc_disable(psoc);
 p2p_psoc_enable_fail:
-	scm_psoc_disable();
+	scm_psoc_disable(psoc);
 
 out:
 	return QDF_STATUS_E_FAILURE;
 }
 
-QDF_STATUS dispatcher_psoc_disable(void)
+QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc)
 {
-	QDF_BUG(QDF_STATUS_SUCCESS == tdls_psoc_disable());
+	QDF_BUG(QDF_STATUS_SUCCESS == tdls_psoc_disable(psoc));
 
-	QDF_BUG(QDF_STATUS_SUCCESS == p2p_psoc_disable());
+	QDF_BUG(QDF_STATUS_SUCCESS == p2p_psoc_disable(psoc));
 
-	QDF_BUG(QDF_STATUS_SUCCESS == scm_psoc_disable());
+	QDF_BUG(QDF_STATUS_SUCCESS == scm_psoc_disable(psoc));
 
 	return QDF_STATUS_SUCCESS;
 }