qcacmn: Add AFC OSIF common changes

Add AFC common North Bound vendor command handlers and common AFC
PSOC/PDEV register functions.

Change-Id: Id87c3c4878362a48546d39e10230d60c2c573154
CRs-Fixed: 3375632
Dieser Commit ist enthalten in:
Will Huang
2022-12-21 11:33:33 +08:00
committet von Rahul Choudhary
Ursprung 41ee181b59
Commit ebc483b28a
7 geänderte Dateien mit 1785 neuen und 0 gelöschten Zeilen

Datei anzeigen

@@ -0,0 +1,75 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: wlan_cfg80211_afc.h
*
* This Header file provide declaration for cfg80211 vendor command handler API
* and structures.
*/
#ifndef __WLAN_CFG80211_AFC_H__
#define __WLAN_CFG80211_AFC_H__
#include <wlan_objmgr_cmn.h>
#include <qdf_types.h>
#include <net/cfg80211.h>
#include <qca_vendor.h>
#include <wlan_reg_ucfg_api.h>
#ifdef CONFIG_AFC_SUPPORT
extern const struct nla_policy
wlan_cfg80211_afc_response_policy[QCA_WLAN_VENDOR_ATTR_AFC_RESP_MAX + 1];
/**
* wlan_cfg80211_vendor_afc_response() - To handle vendor AFC response command
* @psoc: Pointer to PSOC object
* @pdev: Pointer to PDEV object
* @data: Pointer to the data received via the vendor interface
* @data_len: Length of the data to be passed
*
* Return: 0 on success, negative errno on failure
*/
int wlan_cfg80211_vendor_afc_response(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
const void *data,
int data_len);
/**
* wlan_cfg80211_afc_send_request() - To handle AFC request from
* regulatory AFC component.
* @pdev: Pointer to PDEV object
* @afc_req: Pointer to AFC request
*
* Return: 0 on success, negative errno on failure
*/
int wlan_cfg80211_afc_send_request(struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_request *afc_req);
/**
* wlan_cfg80211_afc_send_update_complete() - To handle AFC update complete
* event from regulatory AFC component.
* @pdev: Pointer to PDEV object
* @afc_evt: Pointer to AFC power update complete event
*
* Return: 0 on success, negative errno on failure
*/
int
wlan_cfg80211_afc_send_update_complete(struct wlan_objmgr_pdev *pdev,
struct reg_fw_afc_power_event *afc_evt);
#endif
#endif

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@@ -0,0 +1,174 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: wlan_afc_main.h
*
* This Head file provides declaration for UMAC AFC common APIs.
*/
#ifndef __WLAN_AFC_MAIN_H__
#define __WLAN_AFC_MAIN_H__
#include <qdf_trace.h>
#include <wlan_objmgr_psoc_obj.h>
#include <wlan_objmgr_pdev_obj.h>
#include <reg_services_public_struct.h>
#ifdef CONFIG_AFC_SUPPORT
#define afc_alert(params...) \
QDF_TRACE_FATAL(QDF_MODULE_ID_AFC, params)
#define afc_err(params...) \
QDF_TRACE_ERROR(QDF_MODULE_ID_AFC, params)
#define afc_warn(params...) \
QDF_TRACE_WARN(QDF_MODULE_ID_AFC, params)
#define afc_notice(params...) \
QDF_TRACE_INFO(QDF_MODULE_ID_AFC, params)
#define afc_info(params...) \
QDF_TRACE_INFO(QDF_MODULE_ID_AFC, params)
#define afc_debug(params...) \
QDF_TRACE_DEBUG(QDF_MODULE_ID_AFC, params)
/**
* afc_psoc_priv() - Helper function to get AFC private object of PSOC
* @psoc: Pointer to PSOC object
*
* Return: AFC private object of PSOC
*/
static inline struct wlan_afc_psoc_priv *
afc_psoc_priv(struct wlan_objmgr_psoc *psoc)
{
struct wlan_afc_psoc_priv *afc_priv;
afc_priv = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_AFC);
return afc_priv;
}
/**
* typedef send_response_to_afcmem() - Function prototype of send AFC response
* to share memory.
* @psoc: Pointer to PSOC object
* @pdev: Pointer to PDEV object
* @data: AFC response data
* @len: AFC response length
*
* Return: 0 if success, otherwise failure
*/
typedef int (*send_response_to_afcmem)(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_resp *data,
uint32_t len);
/**
* typedef osif_send_afc_request() - Function prototype of sending
* AFC request to osif.
* @pdev: Pointer to PDEV object
* @afc_req: Pointer to AFC request
*
* Return: 0 if success, otherwise failure
*/
typedef int
(*osif_send_afc_request)(struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_request *afc_req);
/**
* typedef osif_send_afc_power_update_complete() - Function prototype of sending
* AFC update complete event to osif.
* @pdev: Pointer to PDEV object
* @afc_pwr_evt: Pointer to AFC power update event
*
* Return: 0 if success, otherwise failure
*/
typedef int
(*osif_send_afc_power_update_complete)(struct wlan_objmgr_pdev *pdev,
struct reg_fw_afc_power_event *afc_pwr_evt);
/**
* wlan_afc_data_send() - Function to send AFC response through platform
* interface
* @psoc: Pointer to PSOC object
* @pdev: Pointer to PDEV object
* @data: Pointer to AFC response data
* @len: AFC response data length in bytes
*
* Return: 0 if success, otherwise failure
*/
int wlan_afc_data_send(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_resp *data,
uint32_t len);
/**
* wlan_afc_register_data_send_cb() - Function to register data send AFC
* callback
* @psoc: Pointer to PSOC object
* @func: AFC PLD function to be register
*
* Return: QDF STATUS
*/
QDF_STATUS wlan_afc_register_data_send_cb(struct wlan_objmgr_psoc *psoc,
send_response_to_afcmem func);
/**
* wlan_afc_psoc_created_notification() - Callback function to be invoked when
* POSC create AFC component.
* @psoc: Pointer to PSOC object
* @arg: Pointer to argument list
*
* Return: QDF STATUS
*/
QDF_STATUS
wlan_afc_psoc_created_notification(struct wlan_objmgr_psoc *psoc,
void *arg);
/**
* wlan_afc_psoc_destroyed_notification() - Callback function to be invoked when
* PSOC destroy AFC component.
* @psoc: Pointer to PSOC object
* @arg: Pointer to argument list
*
* Return: QDF STATUS
*/
QDF_STATUS
wlan_afc_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc,
void *arg);
/**
* wlan_afc_pdev_obj_create_handler() - Callback function of PDEV create AFC
* component.
* @pdev: Pointer to PDEV object
* @arg: Pointer to argument list
*
* Return: QDF STATUS
*/
QDF_STATUS
wlan_afc_pdev_obj_create_handler(struct wlan_objmgr_pdev *pdev,
void *arg);
/**
* wlan_afc_pdev_obj_destroy_handler() - Callback function of PDEV destroy AFC
* component.
* @pdev: Pointer to PDEV object
* @arg: Pointer to argument list
*
* Return: QDF STATUS
*/
QDF_STATUS
wlan_afc_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, void *arg);
#endif
#endif

Datei anzeigen

@@ -0,0 +1,208 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: wlan_afc_main.c
* This file provides implementation for UMAC AFC common APIs.
*/
#include <wlan_afc_main.h>
#include "wlan_afc_priv.h"
#include "wlan_reg_ucfg_api.h"
#include "wlan_cfg80211_afc.h"
/**
* wlan_send_afc_request() - PDEV callback function to send AFC request
* @pdev: Pointer to PDEV object
* @afc_req: Pointer to AFC request from regulatory component
* @arg: Pointer to argument list of callback function
*
* Return: None
*/
static void
wlan_send_afc_request(struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_request *afc_req,
void *arg)
{
struct wlan_objmgr_psoc *psoc;
struct wlan_afc_psoc_priv *afc_priv;
psoc = wlan_pdev_get_psoc(pdev);
afc_priv = afc_psoc_priv(psoc);
if (!afc_priv) {
afc_err("psoc AFC private null");
return;
}
if (afc_priv->cbs.afc_req_func)
afc_priv->cbs.afc_req_func(pdev, afc_req);
}
/**
* wlan_send_afc_power_event() - PDEV callback function to send AFC power
* update complete event.
* @pdev: Pointer to PDEV object
* @afc_pwr_evt: Pointer to AFC power event from regulatory component
* @arg: Pointer to argument list of callback function
*
* Return: None
*/
static void
wlan_send_afc_power_event(struct wlan_objmgr_pdev *pdev,
struct reg_fw_afc_power_event *afc_pwr_evt,
void *arg)
{
struct wlan_objmgr_psoc *psoc;
struct wlan_afc_psoc_priv *afc_priv;
psoc = wlan_pdev_get_psoc(pdev);
afc_priv = afc_psoc_priv(psoc);
if (!afc_priv) {
afc_err("psoc AFC private null");
return;
}
if (afc_priv->cbs.afc_updated_func)
afc_priv->cbs.afc_updated_func(pdev, afc_pwr_evt);
}
int wlan_afc_data_send(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_resp *data,
uint32_t len)
{
struct wlan_afc_psoc_priv *afc_priv;
afc_priv = afc_psoc_priv(psoc);
if (!afc_priv) {
afc_err("psoc AFC private null");
return -EINVAL;
}
if (afc_priv->cbs.afc_rsp_cp_func)
return afc_priv->cbs.afc_rsp_cp_func(psoc, pdev, data, len);
return -EINVAL;
}
QDF_STATUS wlan_afc_register_data_send_cb(struct wlan_objmgr_psoc *psoc,
send_response_to_afcmem func)
{
struct wlan_afc_psoc_priv *afc_priv;
afc_priv = afc_psoc_priv(psoc);
if (!afc_priv) {
afc_err("psoc AFC private null");
return QDF_STATUS_E_FAILURE;
}
afc_priv->cbs.afc_rsp_cp_func = func;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_afc_psoc_created_notification(struct wlan_objmgr_psoc *psoc,
void *arg)
{
QDF_STATUS status;
struct wlan_afc_psoc_priv *afc_priv;
afc_priv = qdf_mem_malloc(sizeof(*afc_priv));
if (!afc_priv)
return QDF_STATUS_E_NOMEM;
status = wlan_objmgr_psoc_component_obj_attach(psoc,
WLAN_UMAC_COMP_AFC,
afc_priv,
QDF_STATUS_SUCCESS);
if (QDF_IS_STATUS_ERROR(status)) {
qdf_mem_free(afc_priv);
afc_err("Failed to attach psoc AFC component");
return status;
}
afc_priv->psoc = psoc;
afc_priv->cbs.afc_req_func = wlan_cfg80211_afc_send_request;
afc_priv->cbs.afc_updated_func = wlan_cfg80211_afc_send_update_complete;
return status;
}
QDF_STATUS
wlan_afc_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc,
void *arg)
{
QDF_STATUS status;
void *afc_priv;
afc_priv = afc_psoc_priv(psoc);
if (!afc_priv) {
afc_err("Failed to get psoc AFC component private");
return QDF_STATUS_E_FAILURE;
}
status = wlan_objmgr_psoc_component_obj_detach(psoc,
WLAN_UMAC_COMP_AFC,
afc_priv);
if (QDF_IS_STATUS_ERROR(status))
afc_err("Failed to detach AFC component");
qdf_mem_free(afc_priv);
return status;
}
QDF_STATUS
wlan_afc_pdev_obj_create_handler(struct wlan_objmgr_pdev *pdev,
void *arg)
{
QDF_STATUS status;
status = ucfg_reg_register_afc_req_rx_callback(pdev,
wlan_send_afc_request,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
afc_err("Failed to register AFC request callback");
return status;
}
status = ucfg_reg_register_afc_power_event_callback(pdev,
wlan_send_afc_power_event,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
afc_err("Failed to register AFC power callback");
ucfg_reg_unregister_afc_req_rx_callback(pdev,
wlan_send_afc_request);
return status;
}
return status;
}
QDF_STATUS
wlan_afc_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev, void *arg)
{
ucfg_reg_unregister_afc_req_rx_callback(pdev,
wlan_send_afc_request);
ucfg_reg_unregister_afc_power_event_callback(pdev,
wlan_send_afc_power_event);
return QDF_STATUS_SUCCESS;
}

Datei anzeigen

@@ -0,0 +1,49 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: wlan_afc_priv.h
*
* Declare various struct, macros which are used private to AFC component.
*/
#ifndef __WLAN_AFC_PRIV_H__
#define __WLAN_AFC_PRIV_H__
#include "wlan_afc_main.h"
/**
* struct wlan_afc_callbacks - AFC PSOC private callbacks
* @afc_rsp_cp_func: AFC callback function to pass AFC response data to target
* @afc_req_func: AFC callback function to send AFC request
* @afc_updated_func: AFC callback function to send AFC update complete event
*/
struct wlan_afc_callbacks {
send_response_to_afcmem afc_rsp_cp_func;
osif_send_afc_request afc_req_func;
osif_send_afc_power_update_complete afc_updated_func;
};
/**
* struct wlan_afc_psoc_priv - AFC PSOC private data and callbacks
* @psoc: Pointer to PSOC object
* @cbs: AFC PSOC callbacks
*/
struct wlan_afc_psoc_priv {
struct wlan_objmgr_psoc *psoc;
struct wlan_afc_callbacks cbs;
};
#endif

Datei anzeigen

@@ -0,0 +1,77 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: wlan_afc_ucfg_api.h
*
* This file has the prototypes of AFC dispatcher API which is exposed
* to outside of AFC component.
*/
#ifndef __WLAN_AFC_UCFG_API_H__
#define __WLAN_AFC_UCFG_API_H__
#include <wlan_afc_main.h>
#ifdef CONFIG_AFC_SUPPORT
/**
* ucfg_afc_register_data_send_cb() - UCFG API to register AFC data send
* callback function to pass AFC response data to target.
* @psoc: Pointer to PSOC object
* @func: Pointer to PLD AFC function to pass AFC response data to target
*
* Return: QDF STATUS
*/
QDF_STATUS ucfg_afc_register_data_send_cb(struct wlan_objmgr_psoc *psoc,
send_response_to_afcmem func);
/**
* ucfg_afc_data_send() - UCFG API to send AFC response data to target
* @psoc: Pointer to PSOC object
* @pdev: Pointer to PDEV object
* @data: Pointer to AFC response data which pass to target
* @len: Length of AFC response data
*
* Return: 0 if success, otherwise error code
*/
int ucfg_afc_data_send(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_resp *data,
uint32_t len);
/**
* ucfg_afc_init() - UCFG API to initialize AFC component
*
* Return: QDF STATUS
*/
QDF_STATUS ucfg_afc_init(void);
/**
* ucfg_afc_deinit() - UCFG API to deinitialize AFC component
*
* Return: QDF STATUS
*/
QDF_STATUS ucfg_afc_deinit(void);
#else
static inline QDF_STATUS ucfg_afc_init(void)
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS ucfg_afc_deinit(void)
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif

Datei anzeigen

@@ -0,0 +1,125 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: wlan_afc_ucfg_api.c
*
* This file has the AFC dispatcher API implementation which is exposed
* to outside of AFC component.
*/
#include <wlan_afc_main.h>
#include <wlan_afc_ucfg_api.h>
#include <wlan_objmgr_global_obj.h>
QDF_STATUS ucfg_afc_register_data_send_cb(struct wlan_objmgr_psoc *psoc,
send_response_to_afcmem func)
{
return wlan_afc_register_data_send_cb(psoc, func);
}
int ucfg_afc_data_send(struct wlan_objmgr_psoc *psoc,
struct wlan_objmgr_pdev *pdev,
struct wlan_afc_host_resp *data,
uint32_t len)
{
return wlan_afc_data_send(psoc, pdev, data, len);
}
QDF_STATUS ucfg_afc_init(void)
{
QDF_STATUS status;
status = wlan_objmgr_register_psoc_create_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_psoc_created_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
afc_err("Failed to register psoc create handler");
goto fail_create_psoc;
}
status = wlan_objmgr_register_psoc_destroy_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_psoc_destroyed_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
afc_err("Failed to register psoc delete handler");
goto fail_psoc_destroy;
}
status = wlan_objmgr_register_pdev_create_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_pdev_obj_create_handler,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
afc_err("Failed to register pdev create handler");
goto fail_create_pdev;
}
status = wlan_objmgr_register_pdev_destroy_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_pdev_obj_destroy_handler,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
afc_err("Failed to register pdev delete handler");
goto fail_pdev_destroy;
}
return status;
fail_pdev_destroy:
wlan_objmgr_unregister_pdev_create_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_pdev_obj_create_handler,
NULL);
fail_create_pdev:
wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_psoc_destroyed_notification,
NULL);
fail_psoc_destroy:
wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_psoc_created_notification,
NULL);
fail_create_psoc:
return status;
}
QDF_STATUS ucfg_afc_deinit(void)
{
QDF_STATUS status;
status = wlan_objmgr_unregister_pdev_destroy_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_pdev_obj_destroy_handler,
NULL);
if (QDF_IS_STATUS_ERROR(status))
afc_err("Failed to unregister pdev destroy handler");
status = wlan_objmgr_unregister_pdev_create_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_pdev_obj_create_handler,
NULL);
if (QDF_IS_STATUS_ERROR(status))
afc_err("Failed to unregister pdev create handler");
status = wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_psoc_destroyed_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status))
afc_err("Failed to unregister psoc destroy handler");
status = wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_AFC,
wlan_afc_psoc_created_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status))
afc_err("Failed to unregister psoc create handler");
return status;
}