qcacmn: Move psoc object to common component

Presently PSOC object is initialized differently between
WIN/MCL. With this implementation the psoc creation and
destroy will be moved to common code.

Change-Id: I7aa8f47f3fe1d88c6c37ab3184a81fbc7dedb789
CRs-Fixed: 2547533
このコミットが含まれているのは:
Arun Kumar Khandavalli
2019-08-27 16:39:18 +05:30
committed by nshrivas
コミット d76b54a1c5
7個のファイルの変更398行の追加13行の削除

ファイルの表示

@@ -20,11 +20,16 @@
#ifndef _WLAN_MLME_CMN_H_
#define _WLAN_MLME_CMN_H_
#include <include/wlan_psoc_mlme.h>
#include <include/wlan_pdev_mlme.h>
#include <include/wlan_vdev_mlme.h>
/**
* struct vdev_mlme_ext_ops - VDEV MLME legacy callbacks structure
* @mlme_psoc_ext_hdl_create: callback to invoke creation of legacy
* psoc object
* @mlme_psoc_ext_hdl_destroy: callback to invoke destroy of legacy
* psoc object
* @mlme_pdev_ext_hdl_create: callback to invoke creation of legacy
* pdev object
* @mlme_pdev_ext_hdl_destroy: callback to invoke destroy of legacy
@@ -44,6 +49,10 @@
* required by serialization
*/
struct mlme_ext_ops {
QDF_STATUS (*mlme_psoc_ext_hdl_create)(
struct psoc_mlme_obj *psoc_mlme);
QDF_STATUS (*mlme_psoc_ext_hdl_destroy)(
struct psoc_mlme_obj *pdev_mlme);
QDF_STATUS (*mlme_pdev_ext_hdl_create)(
struct pdev_mlme_obj *pdev_mlme);
QDF_STATUS (*mlme_pdev_ext_hdl_destroy)(
@@ -65,6 +74,28 @@ struct mlme_ext_ops {
uint8_t cmd_type);
};
/**
* mlme_psoc_ops_ext_hdl_create() - Alloc PSOC mlme ext handle
* @psoc_mlme: PSOC MLME comp object
*
* API to allocate PSOC MLME ext handle
*
* Return: SUCCESS on successful allocation
* Else FAILURE
*/
QDF_STATUS mlme_psoc_ops_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme);
/**
* mlme_psoc_ops_ext_hdl_destroy() - Destroy PSOC mlme ext handle
* @psoc_mlme: PSOC MLME comp object
*
* API to free psoc MLME ext handle
*
* Return: SUCCESS on successful free
* Else FAILURE
*/
QDF_STATUS mlme_psoc_ops_ext_hdl_destroy(struct psoc_mlme_obj *psoc_mlme);
/**
* mlme_pdev_ops_ext_hdl_create - Alloc PDEV mlme ext handle
* @pdev_mlme_obj: PDEV MLME comp object

35
umac/mlme/include/wlan_psoc_mlme.h ノーマルファイル
ファイルの表示

@@ -0,0 +1,35 @@
/*
* Copyright (c) 2019 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 PSOC MLME structure
*/
#ifndef _WLAN_PSOC_MLME_H_
#define _WLAN_PSOC_MLME_H_
#include <wlan_ext_mlme_obj_types.h>
/**
* struct psoc_mlme_obj - PSOC MLME component object
* @psoc: PSOC object
* @ext_psoc_ptr: extended psoc mlme pointer
*/
struct psoc_mlme_obj {
struct wlan_objmgr_psoc *psoc;
mlme_psoc_ext_t *ext_psoc_ptr;
};
#endif

ファイルの表示

@@ -0,0 +1,43 @@
/*
* Copyright (c) 2019 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 PSOC MLME structure
*/
#ifndef _WLAN_PSOC_MLME_MAIN_H_
#define _WLAN_PSOC_MLME_MAIN_H_
/**
* wlan_psoc_mlme_init() - Initializes PSOC MLME component
*
* Registers callbacks with object manager for create/destroy
*
* Return: SUCCESS on successful initialization
* FAILURE, if initialization fails
*/
QDF_STATUS wlan_psoc_mlme_init(void);
/**
* wlan_psoc_mlme_deinit() - Uninitializes PSOC MLME component
*
* Unregisters callbacks with object manager for create/destroy
*
* Return: SUCCESS on successful de-initialization
* FAILURE, if de-initialization fails
*/
QDF_STATUS wlan_psoc_mlme_deinit(void);
#endif

ファイルの表示

@@ -18,13 +18,14 @@
* DOC: Implements MLME global APIs
*/
#include "wlan_objmgr_cmn.h"
#include "include/wlan_mlme_cmn.h"
#include "include/wlan_pdev_mlme.h"
#include "include/wlan_vdev_mlme.h"
#include "include/wlan_mlme_cmn.h"
#include "wlan_pdev_mlme_main.h"
#include "wlan_vdev_mlme_main.h"
#include <wlan_objmgr_cmn.h>
#include <include/wlan_mlme_cmn.h>
#include <include/wlan_pdev_mlme.h>
#include <include/wlan_vdev_mlme.h>
#include <include/wlan_mlme_cmn.h>
#include <wlan_psoc_mlme_main.h>
#include <wlan_pdev_mlme_main.h>
#include <wlan_vdev_mlme_main.h>
struct mlme_ext_ops *glbl_ops;
mlme_get_global_ops_cb glbl_ops_cb;
@@ -33,6 +34,10 @@ QDF_STATUS wlan_cmn_mlme_init(void)
{
QDF_STATUS status;
status = wlan_psoc_mlme_init();
if (status != QDF_STATUS_SUCCESS)
return status;
status = wlan_pdev_mlme_init();
if (status != QDF_STATUS_SUCCESS)
return status;
@@ -59,14 +64,38 @@ QDF_STATUS wlan_cmn_mlme_deinit(void)
if (status != QDF_STATUS_SUCCESS)
return status;
status = wlan_psoc_mlme_deinit();
if (status != QDF_STATUS_SUCCESS)
return status;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS mlme_psoc_ops_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme)
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if (glbl_ops && glbl_ops->mlme_psoc_ext_hdl_create)
ret = glbl_ops->mlme_psoc_ext_hdl_create(psoc_mlme);
return ret;
}
QDF_STATUS mlme_psoc_ops_ext_hdl_destroy(struct psoc_mlme_obj *psoc_mlme)
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if (glbl_ops && glbl_ops->mlme_psoc_ext_hdl_destroy)
ret = glbl_ops->mlme_psoc_ext_hdl_destroy(psoc_mlme);
return ret;
}
QDF_STATUS mlme_pdev_ops_ext_hdl_create(struct pdev_mlme_obj *pdev_mlme)
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if ((glbl_ops) && glbl_ops->mlme_pdev_ext_hdl_create)
if (glbl_ops && glbl_ops->mlme_pdev_ext_hdl_create)
ret = glbl_ops->mlme_pdev_ext_hdl_create(pdev_mlme);
return ret;
@@ -76,7 +105,7 @@ QDF_STATUS mlme_pdev_ops_ext_hdl_destroy(struct pdev_mlme_obj *pdev_mlme)
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if ((glbl_ops) && glbl_ops->mlme_pdev_ext_hdl_destroy)
if (glbl_ops && glbl_ops->mlme_pdev_ext_hdl_destroy)
ret = glbl_ops->mlme_pdev_ext_hdl_destroy(pdev_mlme);
return ret;
@@ -86,7 +115,7 @@ QDF_STATUS mlme_vdev_ops_ext_hdl_create(struct vdev_mlme_obj *vdev_mlme)
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if ((glbl_ops) && glbl_ops->mlme_vdev_ext_hdl_create)
if (glbl_ops && glbl_ops->mlme_vdev_ext_hdl_create)
ret = glbl_ops->mlme_vdev_ext_hdl_create(vdev_mlme);
return ret;
@@ -96,7 +125,7 @@ QDF_STATUS mlme_vdev_ops_ext_hdl_post_create(struct vdev_mlme_obj *vdev_mlme)
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if ((glbl_ops) && glbl_ops->mlme_vdev_ext_hdl_post_create)
if (glbl_ops && glbl_ops->mlme_vdev_ext_hdl_post_create)
ret = glbl_ops->mlme_vdev_ext_hdl_post_create(vdev_mlme);
return ret;
@@ -106,7 +135,7 @@ QDF_STATUS mlme_vdev_ops_ext_hdl_destroy(struct vdev_mlme_obj *vdev_mlme)
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if ((glbl_ops) && glbl_ops->mlme_vdev_ext_hdl_destroy)
if (glbl_ops && glbl_ops->mlme_vdev_ext_hdl_destroy)
ret = glbl_ops->mlme_vdev_ext_hdl_destroy(vdev_mlme);
return ret;
@@ -128,7 +157,7 @@ QDF_STATUS mlme_vdev_ops_multivdev_restart_fw_cmd_send(
{
QDF_STATUS ret = QDF_STATUS_SUCCESS;
if ((glbl_ops) && glbl_ops->mlme_multivdev_restart_fw_send)
if (glbl_ops && glbl_ops->mlme_multivdev_restart_fw_send)
glbl_ops->mlme_multivdev_restart_fw_send(pdev);
return ret;

ファイルの表示

@@ -0,0 +1,126 @@
/*
* Copyright (c) 2019 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: Implements PSOC MLME APIs
*/
#include <wlan_objmgr_cmn.h>
#include <wlan_objmgr_global_obj.h>
#include <wlan_mlme_dbg.h>
#include <include/wlan_mlme_cmn.h>
#include <include/wlan_psoc_mlme.h>
#include <wlan_psoc_mlme_main.h>
#include <wlan_psoc_mlme_api.h>
static QDF_STATUS mlme_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc,
void *arg)
{
struct psoc_mlme_obj *psoc_mlme;
QDF_STATUS status = QDF_STATUS_SUCCESS;
psoc_mlme = qdf_mem_malloc(sizeof(struct psoc_mlme_obj));
if (!psoc_mlme) {
mlme_err("Failed to allocate PSOS mlme Object");
return QDF_STATUS_E_NOMEM;
}
psoc_mlme->psoc = psoc;
status = mlme_psoc_ops_ext_hdl_create(psoc_mlme);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("Failed to allocate psoc ext handle");
goto init_failed;
}
status = wlan_objmgr_psoc_component_obj_attach(psoc,
WLAN_UMAC_COMP_MLME,
psoc_mlme,
QDF_STATUS_SUCCESS);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("Failed to attach psoc_ctx with psoc");
goto init_failed;
}
return status;
init_failed:
qdf_mem_free(psoc_mlme);
return status;
}
static QDF_STATUS mlme_psoc_obj_destroy_handler(struct wlan_objmgr_psoc *psoc,
void *arg)
{
struct psoc_mlme_obj *psoc_mlme;
psoc_mlme = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_MLME);
if (!psoc_mlme) {
mlme_err(" PSOC MLME component object is NULL");
return QDF_STATUS_E_FAILURE;
}
wlan_objmgr_psoc_component_obj_detach(psoc, WLAN_UMAC_COMP_MLME,
psoc_mlme);
mlme_psoc_ops_ext_hdl_destroy(psoc_mlme);
qdf_mem_free(psoc_mlme);
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_psoc_mlme_init(void)
{
if (wlan_objmgr_register_psoc_create_handler
(WLAN_UMAC_COMP_MLME,
mlme_psoc_obj_create_handler, NULL)
!= QDF_STATUS_SUCCESS)
return QDF_STATUS_E_FAILURE;
if (wlan_objmgr_register_psoc_destroy_handler
(WLAN_UMAC_COMP_MLME,
mlme_psoc_obj_destroy_handler, NULL)
!= QDF_STATUS_SUCCESS) {
if (wlan_objmgr_unregister_psoc_create_handler
(WLAN_UMAC_COMP_MLME,
mlme_psoc_obj_create_handler, NULL)
!= QDF_STATUS_SUCCESS)
return QDF_STATUS_E_FAILURE;
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS wlan_psoc_mlme_deinit(void)
{
if (wlan_objmgr_unregister_psoc_create_handler
(WLAN_UMAC_COMP_MLME,
mlme_psoc_obj_create_handler, NULL)
!= QDF_STATUS_SUCCESS)
return QDF_STATUS_E_FAILURE;
if (wlan_objmgr_unregister_psoc_destroy_handler
(WLAN_UMAC_COMP_MLME,
mlme_psoc_obj_destroy_handler, NULL)
!= QDF_STATUS_SUCCESS)
return QDF_STATUS_E_FAILURE;
return QDF_STATUS_SUCCESS;
}

ファイルの表示

@@ -0,0 +1,59 @@
/*
* Copyright (c) 2019 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 PSOC MLME public APIs
*/
#ifndef _WLAN_PSOC_MLME_API_H_
#define _WLAN_PSOC_MLME_API_H_
/**
* wlan_psoc_mlme_get_cmpt_obj() - Returns PSOC MLME component object
* @psoc: PSOC object
*
* Retrieves MLME component object from PSOC object
*
* Return: comp handle on SUCCESS
* NULL, if it fails to retrieve
*/
struct psoc_mlme_obj *wlan_psoc_mlme_get_cmpt_obj(
struct wlan_objmgr_psoc *psoc);
/**
* wlan_psoc_mlme_get_ext_hdl() - Returns legacy handle
* @psoc: PSOC object
*
* Retrieves legacy handle from psoc mlme component object
*
* Return: legacy handle on SUCCESS
* NULL, if it fails to retrieve
*/
mlme_psoc_ext_t *wlan_psoc_mlme_get_ext_hdl(struct wlan_objmgr_psoc *psoc);
/**
* wlan_psoc_mlme_set_ext_hdl() - Set legacy handle
* @psoc_mlme: psoc_mlme object
* psoc_ext_hdl: PSOC level legacy handle
*
* Sets legacy handle in psoc mlme component object
*
* Return: Void
*/
void wlan_psoc_mlme_set_ext_hdl(struct psoc_mlme_obj *psoc_mlme,
mlme_psoc_ext_t *psoc_ext_hdl);
#endif

ファイルの表示

@@ -0,0 +1,62 @@
/*
* Copyright (c) 2019 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: Implements PSOC MLME public APIs
*/
#include <wlan_objmgr_psoc_obj.h>
#include <wlan_mlme_dbg.h>
#include <include/wlan_psoc_mlme.h>
#include <wlan_psoc_mlme_api.h>
#include <qdf_module.h>
struct psoc_mlme_obj *wlan_psoc_mlme_get_cmpt_obj(struct wlan_objmgr_psoc *psoc)
{
struct psoc_mlme_obj *psoc_mlme;
psoc_mlme = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_MLME);
if (!psoc_mlme) {
mlme_err("PSOC MLME component object is NULL");
return NULL;
}
return psoc_mlme;
}
qdf_export_symbol(wlan_psoc_mlme_get_cmpt_obj);
mlme_psoc_ext_t *wlan_psoc_mlme_get_ext_hdl(struct wlan_objmgr_psoc *psoc)
{
struct psoc_mlme_obj *psoc_mlme;
psoc_mlme = wlan_psoc_mlme_get_cmpt_obj(psoc);
if (psoc_mlme)
return psoc_mlme->ext_psoc_ptr;
return NULL;
}
qdf_export_symbol(wlan_psoc_mlme_get_ext_hdl);
void wlan_psoc_mlme_set_ext_hdl(struct psoc_mlme_obj *psoc_mlme,
mlme_psoc_ext_t *psoc_ext_hdl)
{
psoc_mlme->ext_psoc_ptr = psoc_ext_hdl;
}
qdf_export_symbol(wlan_psoc_mlme_set_ext_hdl);