diff --git a/Kbuild b/Kbuild index d9886d532c..15ba0ed5fe 100755 --- a/Kbuild +++ b/Kbuild @@ -836,6 +836,7 @@ MLME_INC := -I$(WLAN_ROOT)/$(MLME_DIR)/core/inc \ -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 46f56ff3de..627f3ef2c6 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 -#include #include #include #include -#include -#include #define mlme_fatal(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_MLME, params) #define mlme_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MLME, params) @@ -44,24 +41,6 @@ struct wlan_mlme_psoc_obj { struct wlan_mlme_cfg cfg; }; -/** - * 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 diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index df742dc685..a158827f1d 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -33,52 +33,6 @@ struct wlan_mlme_psoc_obj *mlme_get_psoc_obj(struct wlan_objmgr_psoc *psoc) 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 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) 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 0000000000..5237eef866 --- /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 +#include +#include + +/** + * 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 f345467698..e639db4a60 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 #include #include +#include /** - * 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 0000000000..1d4a2c051c --- /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 385ac4eaf8..6f8884702f 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 @@ QDF_STATUS mlme_psoc_open(struct wlan_objmgr_psoc *psoc) 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 80fb49b978..8be506b1b1 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -12550,7 +12550,7 @@ static void wlan_hdd_state_ctrl_param_destroy(void) */ static void component_init(void) { - mlme_init(); + ucfg_mlme_init(); pmo_init(); disa_init(); ucfg_ocb_init(); @@ -12570,17 +12570,17 @@ static void component_deinit(void) 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)