qcacmn: Add files for IOT Simulation module

Adding files to support IOT Simulation module

Change-Id: I3c145f43e846ae5db032df748943c4d0ff531585
CRs-Fixed: 2657904
This commit is contained in:
nakul kachhwaha
2020-04-17 14:33:39 +05:30
committed by nshrivas
vanhempi 516abea104
commit 861af9fad3
12 muutettua tiedostoa jossa 693 lisäystä ja 0 poistoa

Näytä tiedosto

@@ -0,0 +1,24 @@
/*
* Copyright (c) 2020, 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.
*/
#ifndef _WLAN_IOT_SIM_TGT_API_H_
#define _WLAN_IOT_SIM_TGT_API_H_
#include <wlan_objmgr_cmn.h>
#include <qdf_types.h>
#include "../../core/iot_sim_cmn_api_i.h"
#endif /* _WLAN_IOT_SIM_TGT_API_H_ */

Näytä tiedosto

@@ -0,0 +1,65 @@
/*
* Copyright (c) 2020, 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.
*/
#ifndef _WLAN_IOT_SIM_UTILS_API_H_
#define _WLAN_IOT_SIM_UTILS_API_H_
#include <wlan_objmgr_cmn.h>
#include <wlan_lmac_if_def.h>
/* Forward Declarations */
struct wmi_iot_sim_cmd_ops;
/*
* wlan_iot_sim_init() - API to init iot_sim component
*
* This API is invoked from dispatcher init during all component init.
* This API will register all required handlers for pdev and peer object
* create/delete notification.
*
* Return: SUCCESS,
* Failure
*/
QDF_STATUS wlan_iot_sim_init(void);
/*
* wlan_iot_sim_deinit() - API to deinit iot_sim component
*
* This API is invoked from dispatcher deinit during all component deinit.
* This API will unregister all registered handlers for pdev and peer object
* create/delete notification.
*
* Return: SUCCESS,
* Failure
*/
QDF_STATUS wlan_iot_sim_deinit(void);
/*
* wlan_register_wmi_iot_sim_cmd_ops() - Register operations related to wmi
* commands on iot_sim parameters
* @pdev - the physical device object
* @cmd_ops - pointer to the structure holding the operations
* related to wmi commands on iot_sim parameters
*
* API to register operations related to wmi commands on iot_sim parameters
*
* Return: None
*/
void
wlan_register_wmi_iot_sim_cmd_ops(struct wlan_objmgr_pdev *pdev,
struct wmi_iot_sim_cmd_ops *cmd_ops);
#endif /* _WLAN_IOT_SIM_UTILS_API_H_*/

Näytä tiedosto

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2020, 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.
*/
#include <wlan_iot_sim_tgt_api.h>
#include <wlan_iot_sim_utils_api.h>
void *
tgt_get_target_handle(struct wlan_objmgr_psoc *psoc)
{
struct iot_sim_context *isc;
if (!psoc) {
iot_sim_err("psoc is NULL!");
return NULL;
}
isc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_IOT_SIM_COMP);
if (!isc) {
iot_sim_err("psoc IOT_SIM object is NULL!");
return NULL;
}
return isc->p_iot_sim_target_handle;
}

Näytä tiedosto

@@ -0,0 +1,62 @@
/*
* Copyright (c) 2020, 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.
*/
#include <wlan_iot_sim_utils_api.h>
#include <qdf_module.h>
#include "../../core/iot_sim_cmn_api_i.h"
#include <wlan_iot_sim_tgt_api.h>
QDF_STATUS
wlan_iot_sim_init(void)
{
if (wlan_objmgr_register_psoc_create_handler(
WLAN_IOT_SIM_COMP,
wlan_iot_sim_psoc_obj_create_handler,
NULL) !=
QDF_STATUS_SUCCESS) {
return QDF_STATUS_E_FAILURE;
}
if (wlan_objmgr_register_psoc_destroy_handler(
WLAN_IOT_SIM_COMP,
wlan_iot_sim_psoc_obj_destroy_handler,
NULL) !=
QDF_STATUS_SUCCESS) {
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_iot_sim_deinit(void)
{
if (wlan_objmgr_unregister_psoc_create_handler(
WLAN_IOT_SIM_COMP,
wlan_iot_sim_psoc_obj_create_handler,
NULL) !=
QDF_STATUS_SUCCESS) {
return QDF_STATUS_E_FAILURE;
}
if (wlan_objmgr_unregister_psoc_destroy_handler(
WLAN_IOT_SIM_COMP,
wlan_iot_sim_psoc_obj_destroy_handler,
NULL) !=
QDF_STATUS_SUCCESS) {
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}