qcacld-3.0: Fix naming conventions for MLME APIs and files
Fixed the naming conventions of APIs and files for MLME component.
Internal MLME component only APIs are in wlan_mlme_main.h/c files
under core.
APIs exposed to other components are in wlan_mlme_api.h/c files
under dispatcher.
APIs exposed to HDD are in wlan_mlme_ucfg_api.h/c files
under dispatcher.
mlme_init/deinit, mlme_psoc_open/close are called from HDD,
so made that as ucfg APIs.
Change-Id: I049008ceaa86ca52acd3ad9a02f903a732117d1f
CRs-Fixed: 2309276
diff --git a/Kbuild b/Kbuild
index d9886d5..15ba0ed 100755
--- a/Kbuild
+++ b/Kbuild
@@ -836,6 +836,7 @@
-I$(WLAN_ROOT)/$(MLME_DIR)/dispatcher/inc
MLME_OBJS := $(MLME_DIR)/core/src/wlan_mlme_main.o \
+ $(MLME_DIR)/dispatcher/src/wlan_mlme_api.o \
$(MLME_DIR)/dispatcher/src/wlan_mlme_ucfg_api.o
########## ACTION OUI ##########
diff --git a/components/mlme/core/inc/wlan_mlme_main.h b/components/mlme/core/inc/wlan_mlme_main.h
index 46f56ff..627f3ef 100644
--- a/components/mlme/core/inc/wlan_mlme_main.h
+++ b/components/mlme/core/inc/wlan_mlme_main.h
@@ -23,12 +23,9 @@
#define _WLAN_MLME_MAIN_H_
#include <wlan_mlme_public_struct.h>
-#include <qdf_atomic.h>
#include <wlan_objmgr_psoc_obj.h>
#include <wlan_objmgr_global_obj.h>
#include <wlan_cmn.h>
-#include <qdf_time.h>
-#include <qdf_list.h>
#define mlme_fatal(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_MLME, params)
#define mlme_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MLME, params)
@@ -45,24 +42,6 @@
};
/**
- * mlme_init() - initialize mlme_ctx context.
- *
- * This function initializes the mlme context.
- *
- * Return: QDF_STATUS_SUCCESS - in case of success else return error
- */
-QDF_STATUS mlme_init(void);
-
-/**
- * mlme_deinit() - De initialize mlme_ctx context.
- *
- * This function De initializes mlme contex.
- *
- * Return: QDF_STATUS_SUCCESS - in case of success else return error
- */
-QDF_STATUS mlme_deinit(void);
-
-/**
* mlme_psoc_object_created_notification(): mlme psoc create handler
* @psoc: psoc which is going to created by objmgr
* @arg: argument for vdev create handler
diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index df742dc..a158827 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -33,52 +33,6 @@
return mlme_obj;
}
-QDF_STATUS mlme_init(void)
-{
- QDF_STATUS status;
-
- status = wlan_objmgr_register_psoc_create_handler(
- WLAN_UMAC_COMP_MLME,
- mlme_psoc_object_created_notification,
- NULL);
- if (status != QDF_STATUS_SUCCESS) {
- mlme_err("unable to register psoc create handle");
- return status;
- }
-
- status = wlan_objmgr_register_psoc_destroy_handler(
- WLAN_UMAC_COMP_MLME,
- mlme_psoc_object_destroyed_notification,
- NULL);
- if (status != QDF_STATUS_SUCCESS)
- mlme_err("unable to register psoc create handle");
-
- return status;
-}
-
-QDF_STATUS mlme_deinit(void)
-{
- QDF_STATUS status;
-
- status = wlan_objmgr_unregister_psoc_create_handler(
- WLAN_UMAC_COMP_MLME,
- mlme_psoc_object_created_notification,
- NULL);
- if (status != QDF_STATUS_SUCCESS) {
- mlme_err("unable to unregister psoc create handle");
- return status;
- }
-
- status = wlan_objmgr_unregister_psoc_destroy_handler(
- WLAN_UMAC_COMP_MLME,
- mlme_psoc_object_destroyed_notification,
- NULL);
- if (status != QDF_STATUS_SUCCESS)
- mlme_err("unable to unregister psoc destroy handle");
-
- return status;
-}
-
QDF_STATUS mlme_psoc_object_created_notification(
struct wlan_objmgr_psoc *psoc, void *arg)
{
@@ -181,4 +135,3 @@
return status;
}
-
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h
new file mode 100644
index 0000000..5237eef
--- /dev/null
+++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+/**
+ * DOC: declare public APIs exposed by the mlme component
+ */
+
+#ifndef _WLAN_MLME_API_H_
+#define _WLAN_MLME_API_H_
+
+#include <wlan_mlme_public_struct.h>
+#include <wlan_objmgr_psoc_obj.h>
+#include <wlan_cmn.h>
+
+/**
+ * wlan_mlme_get_ht_cap_info() - Get the HT cap info config
+ * @psoc: pointer to psoc object
+ * @value: pointer to the value which will be filled for the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS wlan_mlme_get_ht_cap_info(struct wlan_objmgr_psoc *psoc,
+ struct mlme_ht_capabilities_info
+ *ht_cap_info);
+
+/**
+ * wlan_mlme_set_ht_cap_info() - Set the HT cap info config
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
+ struct mlme_ht_capabilities_info
+ ht_cap_info);
+#endif /* _WLAN_MLME_API_H_ */
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
index f345467..e639db4 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -16,7 +16,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
- * DOC: declare internal API related to the mlme component
+ * DOC: declare UCFG APIs exposed by the mlme component
*/
#ifndef _WLAN_MLME_UCFG_API_H_
@@ -26,48 +26,45 @@
#include <wlan_objmgr_psoc_obj.h>
#include <wlan_objmgr_global_obj.h>
#include <wlan_cmn.h>
+#include <wlan_mlme_api.h>
/**
- * mlme_psoc_open() - MLME component Open
+ * ucfg_mlme_init() - initialize mlme_ctx context.
+ *
+ * This function initializes the mlme context.
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success else return error
+ */
+QDF_STATUS ucfg_mlme_init(void);
+
+/**
+ * ucfg_mlme_deinit() - De initialize mlme_ctx context.
+ *
+ * This function De initializes mlme contex.
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success else return error
+ */
+QDF_STATUS ucfg_mlme_deinit(void);
+
+/**
+ * ucfg_mlme_psoc_open() - MLME component Open
* @psoc: pointer to psoc object
*
* Open the MLME component and initialize the MLME strucutre
*
* Return: QDF Status
*/
-QDF_STATUS mlme_psoc_open(struct wlan_objmgr_psoc *psoc);
+QDF_STATUS ucfg_mlme_psoc_open(struct wlan_objmgr_psoc *psoc);
/**
- * mlme_psoc_close() - MLME component close
+ * ucfg_mlme_psoc_close() - MLME component close
* @psoc: pointer to psoc object
*
* Close the MLME component and clear the MLME structures
*
* Return: None
*/
-void mlme_psoc_close(struct wlan_objmgr_psoc *psoc);
-
-/**
- * wlan_mlme_get_ht_cap_info() - Get the HT cap info config
- * @psoc: pointer to psoc object
- * @value: pointer to the value which will be filled for the caller
- *
- * Return: QDF Status
- */
-QDF_STATUS wlan_mlme_get_ht_cap_info(struct wlan_objmgr_psoc *psoc,
- struct mlme_ht_capabilities_info
- *ht_cap_info);
-
-/**
- * wlan_mlme_set_ht_cap_info() - Set the HT cap info config
- * @psoc: pointer to psoc object
- * @value: Value that needs to be set from the caller
- *
- * Return: QDF Status
- */
-QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
- struct mlme_ht_capabilities_info
- ht_cap_info);
+void ucfg_mlme_psoc_close(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_mlme_get_ht_cap_info() - Get the HT cap info config
diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c
new file mode 100644
index 0000000..1d4a2c0
--- /dev/null
+++ b/components/mlme/dispatcher/src/wlan_mlme_api.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+/**
+ * DOC: define public APIs exposed by the mlme component
+ */
+
+#include "cfg_ucfg_api.h"
+#include "wlan_mlme_main.h"
+#include "wlan_mlme_ucfg_api.h"
+
+QDF_STATUS wlan_mlme_get_ht_cap_info(struct wlan_objmgr_psoc *psoc,
+ struct mlme_ht_capabilities_info
+ *ht_cap_info)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj;
+
+ mlme_obj = mlme_get_psoc_obj(psoc);
+ if (!mlme_obj) {
+ mlme_err("Failed to get MLME Obj");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ *ht_cap_info = mlme_obj->cfg.ht_caps.ht_cap_info;
+
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
+ struct mlme_ht_capabilities_info
+ ht_cap_info)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj;
+
+ mlme_obj = mlme_get_psoc_obj(psoc);
+ if (!mlme_obj) {
+ mlme_err("Failed to get MLME Obj");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ mlme_obj->cfg.ht_caps.ht_cap_info = ht_cap_info;
+
+ return QDF_STATUS_SUCCESS;
+}
diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
index 385ac4e..6f88847 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c
@@ -16,14 +16,60 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
- * DOC: define internal APIs related to the mlme component
+ * DOC: define UCFG APIs exposed by the mlme component
*/
-#include "cfg_ucfg_api.h"
#include "wlan_mlme_main.h"
+#include "wlan_mlme_api.h"
#include "wlan_mlme_ucfg_api.h"
-QDF_STATUS mlme_psoc_open(struct wlan_objmgr_psoc *psoc)
+QDF_STATUS ucfg_mlme_init(void)
+{
+ QDF_STATUS status;
+
+ status = wlan_objmgr_register_psoc_create_handler(
+ WLAN_UMAC_COMP_MLME,
+ mlme_psoc_object_created_notification,
+ NULL);
+ if (status != QDF_STATUS_SUCCESS) {
+ mlme_err("unable to register psoc create handle");
+ return status;
+ }
+
+ status = wlan_objmgr_register_psoc_destroy_handler(
+ WLAN_UMAC_COMP_MLME,
+ mlme_psoc_object_destroyed_notification,
+ NULL);
+ if (status != QDF_STATUS_SUCCESS)
+ mlme_err("unable to register psoc create handle");
+
+ return status;
+}
+
+QDF_STATUS ucfg_mlme_deinit(void)
+{
+ QDF_STATUS status;
+
+ status = wlan_objmgr_unregister_psoc_create_handler(
+ WLAN_UMAC_COMP_MLME,
+ mlme_psoc_object_created_notification,
+ NULL);
+ if (status != QDF_STATUS_SUCCESS) {
+ mlme_err("unable to unregister psoc create handle");
+ return status;
+ }
+
+ status = wlan_objmgr_unregister_psoc_destroy_handler(
+ WLAN_UMAC_COMP_MLME,
+ mlme_psoc_object_destroyed_notification,
+ NULL);
+ if (status != QDF_STATUS_SUCCESS)
+ mlme_err("unable to unregister psoc destroy handle");
+
+ return status;
+}
+
+QDF_STATUS ucfg_mlme_psoc_open(struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS status;
@@ -34,41 +80,7 @@
return status;
}
-void mlme_psoc_close(struct wlan_objmgr_psoc *psoc)
+void ucfg_mlme_psoc_close(struct wlan_objmgr_psoc *psoc)
{
/* Clear the MLME CFG Structure */
}
-
-QDF_STATUS wlan_mlme_get_ht_cap_info(struct wlan_objmgr_psoc *psoc,
- struct mlme_ht_capabilities_info
- *ht_cap_info)
-{
- struct wlan_mlme_psoc_obj *mlme_obj;
-
- mlme_obj = mlme_get_psoc_obj(psoc);
- if (!mlme_obj) {
- mlme_err("Failed to get MLME Obj");
- return QDF_STATUS_E_FAILURE;
- }
-
- *ht_cap_info = mlme_obj->cfg.ht_caps.ht_cap_info;
-
- return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
- struct mlme_ht_capabilities_info
- ht_cap_info)
-{
- struct wlan_mlme_psoc_obj *mlme_obj;
-
- mlme_obj = mlme_get_psoc_obj(psoc);
- if (!mlme_obj) {
- mlme_err("Failed to get MLME Obj");
- return QDF_STATUS_E_FAILURE;
- }
-
- mlme_obj->cfg.ht_caps.ht_cap_info = ht_cap_info;
-
- return QDF_STATUS_SUCCESS;
-}
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 80fb49b..8be506b 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -12550,7 +12550,7 @@
*/
static void component_init(void)
{
- mlme_init();
+ ucfg_mlme_init();
pmo_init();
disa_init();
ucfg_ocb_init();
@@ -12570,17 +12570,17 @@
ucfg_ocb_deinit();
pmo_deinit();
disa_deinit();
- mlme_deinit();
+ ucfg_mlme_deinit();
}
QDF_STATUS hdd_component_psoc_open(struct wlan_objmgr_psoc *psoc)
{
- return mlme_psoc_open(psoc);
+ return ucfg_mlme_psoc_open(psoc);
}
void hdd_component_psoc_close(struct wlan_objmgr_psoc *psoc)
{
- mlme_psoc_close(psoc);
+ ucfg_mlme_psoc_close(psoc);
}
void hdd_component_psoc_enable(struct wlan_objmgr_psoc *psoc)