qcacld-3.0: Add INI parameter for packet capture mode support

Add INI parameter for packet capture mode

"packet_capture_mode" - ini to set packet capture mode.

Change-Id: Ie60c142af753c65b44aa0018440e43a215e51a27
CRs-Fixed: 2614578
This commit is contained in:
Vulupala Shashank Reddy
2020-01-26 14:40:33 +05:30
committed by nshrivas
parent 2e9da7605c
commit 6e5c807513
10 changed files with 380 additions and 97 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -46,6 +46,7 @@
#include "hdd_dp_cfg.h" #include "hdd_dp_cfg.h"
#include "cfg_legacy_dp.h" #include "cfg_legacy_dp.h"
#include "wlan_cfg_blm.h" #include "wlan_cfg_blm.h"
#include "cfg_pkt_capture.h"
/* Maintain Alphabetic order here while adding components */ /* Maintain Alphabetic order here while adding components */
#define CFG_ALL \ #define CFG_ALL \
@@ -61,4 +62,5 @@
CFG_NAN_ALL \ CFG_NAN_ALL \
CFG_P2P_ALL \ CFG_P2P_ALL \
CFG_PMO_ALL \ CFG_PMO_ALL \
CFG_TDLS_ALL CFG_TDLS_ALL \
CFG_PKT_CAPTURE_MODE_ALL

View File

@@ -58,7 +58,7 @@
* *
* Allocate and attach vdev private object. * Allocate and attach vdev private object.
* *
* Return: QDF_STATUS status in case of success else return error. * Return: QDF_STATUS
*/ */
QDF_STATUS QDF_STATUS
pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg); pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg);
@@ -70,9 +70,40 @@ pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg);
* *
* Deallocate and detach vdev private object. * Deallocate and detach vdev private object.
* *
* Return QDF_STATUS status in case of success else return error * Return: QDF_STATUS
*/ */
QDF_STATUS QDF_STATUS
pkt_capture_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg); pkt_capture_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg);
/**
* pkt_capture_get_mode() - get packet capture mode
* @psoc: pointer to psoc object
*
* Return: enum pkt_capture_mode
*/
enum pkt_capture_mode pkt_capture_get_mode(struct wlan_objmgr_psoc *psoc);
/**
* pkt_capture_psoc_create_notification() - Handler for psoc create notify.
* @psoc: psoc which is going to be created by objmgr
* @arg: argument for notification handler.
*
* Allocate and attach psoc private object.
*
* Return: QDF_STATUS
*/
QDF_STATUS
pkt_capture_psoc_create_notification(struct wlan_objmgr_psoc *psoc, void *arg);
/**
* pkt_capture_psoc_destroy_notification() - Handler for psoc destroy notify.
* @psoc: psoc which is going to be destroyed by objmgr
* @arg: argument for notification handler.
*
* Deallocate and detach psoc private object.
*
* Return: QDF_STATUS
*/
QDF_STATUS
pkt_capture_psoc_destroy_notification(struct wlan_objmgr_psoc *psoc, void *arg);
#endif /* end of _WLAN_PKT_CAPTURE_MAIN_H_ */ #endif /* end of _WLAN_PKT_CAPTURE_MAIN_H_ */

View File

@@ -54,7 +54,7 @@ QDF_STATUS pkt_capture_vdev_get_ref(struct wlan_objmgr_vdev *vdev)
static inline static inline
void pkt_capture_vdev_put_ref(struct wlan_objmgr_vdev *vdev) void pkt_capture_vdev_put_ref(struct wlan_objmgr_vdev *vdev)
{ {
return wlan_objmgr_vdev_release_ref(vdev, WLAN_PKT_CAPTURE_ID); wlan_objmgr_vdev_release_ref(vdev, WLAN_PKT_CAPTURE_ID);
} }
/** /**
@@ -78,4 +78,52 @@ pkt_capture_vdev_get_priv(struct wlan_objmgr_vdev *vdev)
return vdev_priv; return vdev_priv;
} }
/**
* pkt_capture_psoc_get_ref() - Wrapper to increment pkt_capture ref count
* @psoc: psoc object
*
* Wrapper for pkt_capture to increment ref count after checking valid
* object state.
*
* Return: QDF_STATUS
*/
static inline
QDF_STATUS pkt_capture_psoc_get_ref(struct wlan_objmgr_psoc *psoc)
{
return wlan_objmgr_psoc_try_get_ref(psoc, WLAN_PKT_CAPTURE_ID);
}
/**
* pkt_capture_psoc_put_ref() - Wrapper to decrement pkt_capture ref count
* @psoc: psoc object
*
* Wrapper for pkt_capture to decrement ref count of psoc.
*
* Return: None
*/
static inline
void pkt_capture_psoc_put_ref(struct wlan_objmgr_psoc *psoc)
{
wlan_objmgr_psoc_release_ref(psoc, WLAN_PKT_CAPTURE_ID);
}
/**
* pkt_capture_psoc_get_priv(): Wrapper to retrieve psoc priv obj
* @psoc: psoc pointer
*
* Wrapper for pkt_capture to get psoc private object pointer.
*
* Return: pkt_capture psoc private object
*/
static inline struct pkt_psoc_priv *
pkt_capture_psoc_get_priv(struct wlan_objmgr_psoc *psoc)
{
struct pkt_psoc_priv *psoc_priv;
psoc_priv = wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_PKT_CAPTURE);
QDF_BUG(psoc_priv);
return psoc_priv;
}
#endif /* _WLAN_PKT_CAPTURE_OBJMGR_H */ #endif /* _WLAN_PKT_CAPTURE_OBJMGR_H */

View File

@@ -28,6 +28,15 @@
#define _WLAN_PKT_CAPTURE_PRIV_STRUCT_H_ #define _WLAN_PKT_CAPTURE_PRIV_STRUCT_H_
#include "wlan_pkt_capture_objmgr.h" #include "wlan_pkt_capture_objmgr.h"
#include "wlan_pkt_capture_public_structs.h"
/**
* struct pkt_capture_cfg - packet capture cfg to store ini values
* @pkt_capture_mode: packet capture mode
*/
struct pkt_capture_cfg {
enum pkt_capture_mode pkt_capture_mode;
};
/** /**
* struct pkt_capture_vdev_priv - Private object to be stored in vdev * struct pkt_capture_vdev_priv - Private object to be stored in vdev
@@ -36,4 +45,14 @@
struct pkt_capture_vdev_priv { struct pkt_capture_vdev_priv {
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
}; };
/**
* struct pkt_psoc_priv - Private object to be stored in psoc
* @psoc: pointer to psoc object
* @cfg_param: INI config params for packet capture
*/
struct pkt_psoc_priv {
struct wlan_objmgr_psoc *psoc;
struct pkt_capture_cfg cfg_param;
};
#endif /* End of _WLAN_PKT_CAPTURE_PRIV_STRUCT_H_ */ #endif /* End of _WLAN_PKT_CAPTURE_PRIV_STRUCT_H_ */

View File

@@ -22,16 +22,43 @@
*/ */
#include "wlan_pkt_capture_main.h" #include "wlan_pkt_capture_main.h"
#include "cfg_ucfg_api.h"
enum pkt_capture_mode pkt_capture_get_mode(struct wlan_objmgr_psoc *psoc)
{
struct pkt_psoc_priv *psoc_priv;
if (!psoc) {
pkt_capture_err("psoc is NULL");
return PACKET_CAPTURE_MODE_DISABLE;
}
psoc_priv = pkt_capture_psoc_get_priv(psoc);
if (!psoc_priv) {
pkt_capture_err("psoc_priv is NULL");
return PACKET_CAPTURE_MODE_DISABLE;
}
return psoc_priv->cfg_param.pkt_capture_mode;
}
/** /**
* pkt_capture_vdev_create_notification() - Handler for vdev create notify. * pkt_capture_cfg_init() - Initialize packet capture cfg ini params
* @vdev: vdev which is going to be created by objmgr * @psoc_priv: psoc private object
* @arg: argument for notification handler.
* *
* Allocate and attach vdev private object. * Return: None
*
* Return: QDF_STATUS status in case of success else return error.
*/ */
static void
pkt_capture_cfg_init(struct pkt_psoc_priv *psoc_priv)
{
struct pkt_capture_cfg *cfg_param;
cfg_param = &psoc_priv->cfg_param;
cfg_param->pkt_capture_mode = cfg_get(psoc_priv->psoc,
CFG_PKT_CAPTURE_MODE);
}
QDF_STATUS QDF_STATUS
pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg) pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg)
{ {
@@ -39,59 +66,97 @@ pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg)
QDF_STATUS status; QDF_STATUS status;
vdev_priv = qdf_mem_malloc(sizeof(*vdev_priv)); vdev_priv = qdf_mem_malloc(sizeof(*vdev_priv));
if (!vdev_priv) { if (!vdev_priv)
status = QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
goto exit;
}
status = wlan_objmgr_vdev_component_obj_attach( status = wlan_objmgr_vdev_component_obj_attach(
vdev, vdev,
WLAN_UMAC_COMP_PKT_CAPTURE, WLAN_UMAC_COMP_PKT_CAPTURE,
(void *)vdev_priv, QDF_STATUS_SUCCESS); vdev_priv, QDF_STATUS_SUCCESS);
if (!QDF_IS_STATUS_SUCCESS(status)) { if (QDF_IS_STATUS_ERROR(status)) {
pkt_capture_err("Failed to attach priv with vdev"); pkt_capture_err("Failed to attach vdev component obj");
goto free_vdev_priv; goto free_vdev_priv;
} }
vdev_priv->vdev = vdev; vdev_priv->vdev = vdev;
goto exit; return status;
free_vdev_priv: free_vdev_priv:
qdf_mem_free(vdev_priv); qdf_mem_free(vdev_priv);
status = QDF_STATUS_E_INVAL;
exit:
return status; return status;
} }
/**
* pkt_capture_vdev_destroy_notification() - Handler for vdev destroy notify.
* @vdev: vdev which is going to be destroyed by objmgr
* @arg: argument for notification handler.
*
* Deallocate and detach vdev private object.
*
* Return QDF_STATUS status in case of success else return error
*/
QDF_STATUS QDF_STATUS
pkt_capture_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg) pkt_capture_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg)
{ {
struct pkt_capture_vdev_priv *vdev_priv = NULL; struct pkt_capture_vdev_priv *vdev_priv;
QDF_STATUS status = QDF_STATUS_E_FAILURE; QDF_STATUS status;
vdev_priv = pkt_capture_vdev_get_priv(vdev); vdev_priv = pkt_capture_vdev_get_priv(vdev);
if (!vdev_priv) { if (!vdev_priv) {
pkt_capture_err("vdev priv is NULL"); pkt_capture_err("vdev priv is NULL");
goto exit; return QDF_STATUS_E_FAILURE;
} }
status = wlan_objmgr_vdev_component_obj_detach( status = wlan_objmgr_vdev_component_obj_detach(
vdev, vdev,
WLAN_UMAC_COMP_PKT_CAPTURE, WLAN_UMAC_COMP_PKT_CAPTURE,
(void *)vdev_priv); vdev_priv);
if (!QDF_IS_STATUS_SUCCESS(status)) if (QDF_IS_STATUS_ERROR(status))
pkt_capture_err("Failed to detach priv with psoc"); pkt_capture_err("Failed to detach vdev component obj");
qdf_mem_free(vdev_priv); qdf_mem_free(vdev_priv);
exit: return status;
}
QDF_STATUS
pkt_capture_psoc_create_notification(struct wlan_objmgr_psoc *psoc, void *arg)
{
struct pkt_psoc_priv *psoc_priv;
QDF_STATUS status;
psoc_priv = qdf_mem_malloc(sizeof(*psoc_priv));
if (!psoc_priv)
return QDF_STATUS_E_NOMEM;
status = wlan_objmgr_psoc_component_obj_attach(psoc,
WLAN_UMAC_COMP_PKT_CAPTURE,
psoc_priv, QDF_STATUS_SUCCESS);
if (QDF_IS_STATUS_ERROR(status)) {
pkt_capture_err("Failed to attach psoc component obj");
goto free_psoc_priv;
}
psoc_priv->psoc = psoc;
pkt_capture_cfg_init(psoc_priv);
return status;
free_psoc_priv:
qdf_mem_free(psoc_priv);
return status;
}
QDF_STATUS
pkt_capture_psoc_destroy_notification(struct wlan_objmgr_psoc *psoc, void *arg)
{
struct pkt_psoc_priv *psoc_priv;
QDF_STATUS status;
psoc_priv = pkt_capture_psoc_get_priv(psoc);
if (!psoc_priv) {
pkt_capture_err("psoc priv is NULL");
return QDF_STATUS_E_FAILURE;
}
status = wlan_objmgr_psoc_component_obj_detach(psoc,
WLAN_UMAC_COMP_PKT_CAPTURE,
psoc_priv);
if (QDF_IS_STATUS_ERROR(status)) {
pkt_capture_err("Failed to detach psoc component obj");
return status;
}
qdf_mem_free(psoc_priv);
return status; return status;
} }

View File

@@ -0,0 +1,63 @@
/*
* 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 _CFG_PKT_CAPTURE_H_
#define _CFG_PKT_CAPTURE_H_
#ifdef WLAN_FEATURE_PKT_CAPTURE
#define CFG_PKT_CAPTURE_MODE_DEFAULT (0)
#define CFG_PKT_CAPTURE_MODE_MGMT_PKT BIT(0)
#define CFG_PKT_CAPTURE_MODE_DATA_PKT BIT(1)
#define CFG_PKT_CAPTURE_MODE_MAX (CFG_PKT_CAPTURE_MODE_MGMT_PKT | \
CFG_PKT_CAPTURE_MODE_DATA_PKT)
/*
* <ini>
* packet_capture_mode - Packet capture mode
* @Min: 0
* @Max: 3
* Default: 0 - Capture no packets
*
* This ini is used to decide packet capture mode
*
* packet_capture_mode = 0 - Capture no packets
* packet_capture_mode = 1 - Capture management packets only
* packet_capture_mode = 2 - Capture data packets only
* packet_capture_mode = 3 - Capture both data and management packets
*
* Supported Feature: packet capture
*
* Usage: External
*
* </ini>
*/
#define CFG_PKT_CAPTURE_MODE \
CFG_INI_UINT("packet_capture_mode", \
0, \
CFG_PKT_CAPTURE_MODE_MAX, \
CFG_PKT_CAPTURE_MODE_DEFAULT, \
CFG_VALUE_OR_DEFAULT, \
"Value for packet capture mode")
#define CFG_PKT_CAPTURE_MODE_ALL \
CFG(CFG_PKT_CAPTURE_MODE)
#else
#define CFG_PKT_CAPTURE_MODE_ALL
#endif /* WLAN_FEATURE_PKT_CAPTURE */
#endif /* _CFG_PKT_CAPTURE_H_ */

View File

@@ -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.
*/
#ifndef _WLAN_PKT_CAPTURE_PUBLIC_STRUCTS_H_
#define _WLAN_PKT_CAPTURE_PUBLIC_STRUCTS_H_
/**
* enum pkt_capture_mode - packet capture modes
* @PACKET_CAPTURE_MODE_DISABLE: packet capture mode disable
* @PACKET_CAPTURE_MODE_MGMT_ONLY: capture mgmt packets only
* @PACKET_CAPTURE_MODE_DATA_ONLY: capture data packets only
* @PACKET_CAPTURE_MODE_DATA_MGMT: capture both data and mgmt packets
*/
enum pkt_capture_mode {
PACKET_CAPTURE_MODE_DISABLE = 0,
PACKET_CAPTURE_MODE_MGMT_ONLY,
PACKET_CAPTURE_MODE_DATA_ONLY,
PACKET_CAPTURE_MODE_DATA_MGMT,
};
#endif /* _WLAN_PKT_CAPTURE_PUBLIC_STRUCTS_H_ */

View File

@@ -27,6 +27,7 @@
#include <qdf_status.h> #include <qdf_status.h>
#include <qdf_types.h> #include <qdf_types.h>
#include "wlan_pkt_capture_objmgr.h" #include "wlan_pkt_capture_objmgr.h"
#include "wlan_pkt_capture_public_structs.h"
#ifdef WLAN_FEATURE_PKT_CAPTURE #ifdef WLAN_FEATURE_PKT_CAPTURE
/** /**
@@ -34,7 +35,7 @@
* *
* This function gets called when packet capture initializing. * This function gets called when packet capture initializing.
* *
* Return: QDF_STATUS_SUCCESS - in case of success. * Return: QDF_STATUS
*/ */
QDF_STATUS ucfg_pkt_capture_init(void); QDF_STATUS ucfg_pkt_capture_init(void);
@@ -46,6 +47,14 @@ QDF_STATUS ucfg_pkt_capture_init(void);
* Return: None * Return: None
*/ */
void ucfg_pkt_capture_deinit(void); void ucfg_pkt_capture_deinit(void);
/**
* ucfg_pkt_capture_get_mode() - get packet capture mode
* @psoc: pointer to psoc object
*
* Return: enum pkt_capture_mode
*/
enum pkt_capture_mode ucfg_pkt_capture_get_mode(struct wlan_objmgr_psoc *psoc);
#else #else
static inline static inline
QDF_STATUS ucfg_pkt_capture_init(void) QDF_STATUS ucfg_pkt_capture_init(void)
@@ -57,5 +66,11 @@ static inline
void ucfg_pkt_capture_deinit(void) void ucfg_pkt_capture_deinit(void)
{ {
} }
static inline
enum pkt_capture_mode ucfg_pkt_capture_get_mode(struct wlan_objmgr_psoc *psoc)
{
return PACKET_CAPTURE_MODE_DISABLE;
}
#endif /* WLAN_FEATURE_PKT_CAPTURE */ #endif /* WLAN_FEATURE_PKT_CAPTURE */
#endif /* _WLAN_PKT_CAPTURE_UCFG_API_H_ */ #endif /* _WLAN_PKT_CAPTURE_UCFG_API_H_ */

View File

@@ -24,63 +24,93 @@
#include "wlan_pkt_capture_main.h" #include "wlan_pkt_capture_main.h"
#include "wlan_pkt_capture_ucfg_api.h" #include "wlan_pkt_capture_ucfg_api.h"
/** enum pkt_capture_mode ucfg_pkt_capture_get_mode(struct wlan_objmgr_psoc *psoc)
* ucfg_pkt_capture_init() - Packet capture component initialization. {
* return pkt_capture_get_mode(psoc);
* This function gets called when packet capture initializing. }
*
* Return: QDF_STATUS_SUCCESS - in case of success.
*/
QDF_STATUS ucfg_pkt_capture_init(void) QDF_STATUS ucfg_pkt_capture_init(void)
{ {
QDF_STATUS status; QDF_STATUS status;
status = wlan_objmgr_register_psoc_create_handler(
WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_psoc_create_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
pkt_capture_err("Failed to register psoc create handler");
return status;
}
status = wlan_objmgr_register_psoc_destroy_handler(
WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_psoc_destroy_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status)) {
pkt_capture_err("Failed to register psoc delete handler");
goto fail_destroy_psoc;
}
status = wlan_objmgr_register_vdev_create_handler( status = wlan_objmgr_register_vdev_create_handler(
WLAN_UMAC_COMP_PKT_CAPTURE, WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_vdev_create_notification, NULL); pkt_capture_vdev_create_notification, NULL);
if (!QDF_IS_STATUS_SUCCESS(status)) { if (QDF_IS_STATUS_ERROR(status)) {
pkt_capture_err("Failed to register vdev create handler"); pkt_capture_err("Failed to register vdev create handler");
goto exit; goto fail_create_vdev;
} }
status = wlan_objmgr_register_vdev_destroy_handler( status = wlan_objmgr_register_vdev_destroy_handler(
WLAN_UMAC_COMP_PKT_CAPTURE, WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_vdev_destroy_notification, NULL); pkt_capture_vdev_destroy_notification, NULL);
if (QDF_IS_STATUS_SUCCESS(status)) { if (QDF_IS_STATUS_ERROR(status)) {
pkt_capture_debug("vdev create/del notifications registered"); pkt_capture_err("Failed to register vdev destroy handler");
goto exit; goto fail_destroy_vdev;
} }
return status;
fail_destroy_vdev:
wlan_objmgr_unregister_vdev_create_handler(WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_vdev_create_notification, NULL);
fail_create_vdev:
wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_psoc_destroy_notification, NULL);
fail_destroy_psoc:
wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_psoc_create_notification, NULL);
pkt_capture_err("Failed to register vdev delete handler");
wlan_objmgr_unregister_vdev_create_handler(
WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_vdev_create_notification,
NULL);
exit:
return status; return status;
} }
/**
* ucfg_pkt_capture_deinit() - Packet capture component de-init.
*
* This function gets called when packet capture de-init.
*
* Return: None
*/
void ucfg_pkt_capture_deinit(void) void ucfg_pkt_capture_deinit(void)
{ {
QDF_STATUS status; QDF_STATUS status;
status = wlan_objmgr_unregister_vdev_create_handler(
WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_vdev_create_notification, NULL);
if (!QDF_IS_STATUS_SUCCESS(status))
pkt_capture_err("Failed to unregister vdev create handler");
status = wlan_objmgr_unregister_vdev_destroy_handler( status = wlan_objmgr_unregister_vdev_destroy_handler(
WLAN_UMAC_COMP_PKT_CAPTURE, WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_vdev_destroy_notification, pkt_capture_vdev_destroy_notification,
NULL); NULL);
if (!QDF_IS_STATUS_SUCCESS(status)) if (QDF_IS_STATUS_ERROR(status))
pkt_capture_err("Failed to unregister vdev delete handler"); pkt_capture_err("Failed to unregister vdev destroy handler");
status = wlan_objmgr_unregister_vdev_create_handler(
WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_vdev_create_notification, NULL);
if (QDF_IS_STATUS_ERROR(status))
pkt_capture_err("Failed to unregister vdev create handler");
status = wlan_objmgr_unregister_psoc_destroy_handler(
WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_psoc_destroy_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status))
pkt_capture_err("Failed to unregister psoc destroy handler");
status = wlan_objmgr_unregister_psoc_create_handler(
WLAN_UMAC_COMP_PKT_CAPTURE,
pkt_capture_psoc_create_notification,
NULL);
if (QDF_IS_STATUS_ERROR(status))
pkt_capture_err("Failed to unregister psoc create handler");
} }

View File

@@ -3193,31 +3193,6 @@ static void hdd_dp_hl_bundle_cfg_update(struct hdd_config *config,
} }
#endif #endif
#ifdef WLAN_FEATURE_PKT_CAPTURE
/**
* hdd_set_pktcapture_mode_value() - set pktcapture_mode values
* @hdd_ctx: hdd context
* @psoc: pointer to psoc obj
*
* Return: none
*/
static inline void
hdd_dp_pktcapture_mode_cfg_update(struct hdd_context *hdd_ctx,
struct wlan_objmgr_psoc *psoc)
{
hdd_ctx->enable_pkt_capture_support = cfg_get(
psoc, CFG_DP_PKT_CAPTURE_MODE_ENABLE);
hdd_ctx->val_pkt_capture_mode = cfg_get(
psoc, CFG_DP_PKT_CAPTURE_MODE_VALUE);
}
#else
static inline void
hdd_dp_pktcapture_mode_cfg_update(struct hdd_context *hdd_ctx,
struct wlan_objmgr_psoc *psoc)
{
}
#endif /* WLAN_FEATURE_PKT_CAPTURE */
void hdd_dp_cfg_update(struct wlan_objmgr_psoc *psoc, void hdd_dp_cfg_update(struct wlan_objmgr_psoc *psoc,
struct hdd_context *hdd_ctx) struct hdd_context *hdd_ctx)
{ {
@@ -3253,7 +3228,6 @@ void hdd_dp_cfg_update(struct wlan_objmgr_psoc *psoc,
config->cfg_wmi_credit_cnt = cfg_get(psoc, CFG_DP_HTC_WMI_CREDIT_CNT); config->cfg_wmi_credit_cnt = cfg_get(psoc, CFG_DP_HTC_WMI_CREDIT_CNT);
hdd_dp_dp_trace_cfg_update(config, psoc); hdd_dp_dp_trace_cfg_update(config, psoc);
hdd_dp_nud_tracking_cfg_update(config, psoc); hdd_dp_nud_tracking_cfg_update(config, psoc);
hdd_dp_pktcapture_mode_cfg_update(hdd_ctx, psoc);
} }
bool wlan_hdd_rx_rpm_mark_last_busy(struct hdd_context *hdd_ctx, bool wlan_hdd_rx_rpm_mark_last_busy(struct hdd_context *hdd_ctx,