qcacld-3.0: Send vdev param command to set pkt capture mode

Send vdev param command to FW for STA vdev to set the packet
capture mode. Send the command only if packet capture support
is enabled.

Change-Id: Ifed2431882b1f7d2869771e812daa5bcd5dc17e9
CRs-Fixed: 2619314
This commit is contained in:
Vulupala Shashank Reddy 2020-01-30 10:05:49 +05:30 committed by nshrivas
parent 26f0276d8a
commit 5a60cebf6d
5 changed files with 108 additions and 71 deletions

7
Kbuild
View File

@ -1043,13 +1043,16 @@ endif
######## PACKET CAPTURE ########
PKT_CAPTURE_DIR := components/pkt_capture
PKT_CAPTURE_TARGET_IF_DIR := components/target_if/pkt_capture/
PKT_CAPTURE_INC := -I$(WLAN_ROOT)/$(PKT_CAPTURE_DIR)/core/inc \
-I$(WLAN_ROOT)/$(PKT_CAPTURE_DIR)/dispatcher/inc
-I$(WLAN_ROOT)/$(PKT_CAPTURE_DIR)/dispatcher/inc \
-I$(WLAN_ROOT)/$(PKT_CAPTURE_TARGET_IF_DIR)/inc
ifeq ($(CONFIG_WLAN_FEATURE_PKT_CAPTURE), y)
PKT_CAPTURE_OBJS := $(PKT_CAPTURE_DIR)/core/src/wlan_pkt_capture_main.o \
$(PKT_CAPTURE_DIR)/core/src/wlan_pkt_capture_mon_thread.o \
$(PKT_CAPTURE_DIR)/dispatcher/src/wlan_pkt_capture_ucfg_api.o
$(PKT_CAPTURE_DIR)/dispatcher/src/wlan_pkt_capture_ucfg_api.o \
$(PKT_CAPTURE_TARGET_IF_DIR)/src/target_if_pkt_capture.o
endif
########## FTM TIME SYNC ##########

View File

@ -0,0 +1,42 @@
/*
* 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.
*/
/**
* DOC: Declare various api/struct which shall be used
* by packet capture component for wmi cmd (tx path) and
* event (rx) handling.
*/
#ifndef _TARGET_IF_PKT_CAPTURE_H_
#define _TARGET_IF_PKT_CAPTURE_H_
#include <qdf_types.h>
#include "wlan_pkt_capture_public_structs.h"
/**
* target_if_set_packet_capture_mode() - set packet capture mode
* @psoc: pointer to psoc object
* @vdev_id: vdev id
* @mode: mode to set
*
* Return: QDF_STATUS
*/
QDF_STATUS target_if_set_packet_capture_mode(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
enum pkt_capture_mode mode);
#endif /* _TARGET_IF_PKT_CAPTURE_H_ */

View File

@ -0,0 +1,61 @@
/*
* 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.
*/
/**
* DOC: Target interface file for pkt_capture component to
* Implement api's which shall be used by pkt_capture component
* in target_if internally.
*/
#include <wlan_pkt_capture_main.h>
#include <wlan_pkt_capture_ucfg_api.h>
#include <target_if_pkt_capture.h>
#include <wmi_unified_api.h>
#include <target_if.h>
#include <init_deinit_lmac.h>
QDF_STATUS target_if_set_packet_capture_mode(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
enum pkt_capture_mode mode)
{
wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
QDF_STATUS status = QDF_STATUS_E_FAILURE;
if (!wmi_handle) {
target_if_err("Invalid wmi handle");
return QDF_STATUS_E_INVAL;
}
target_if_debug("psoc:%pK, vdev_id:%d mode:%d",
psoc, vdev_id, mode);
if (mode != PACKET_CAPTURE_MODE_DISABLE) {
struct vdev_set_params param;
param.vdev_id = vdev_id;
param.param_id = WMI_VDEV_PARAM_PACKET_CAPTURE_MODE;
param.param_value = (uint32_t)mode;
status = wmi_unified_vdev_set_param_send(wmi_handle, &param);
if (QDF_IS_STATUS_SUCCESS(status))
ucfg_pkt_capture_set_pktcap_mode(psoc, mode);
else
pkt_capture_err("failed to set packet capture mode");
}
return status;
}

View File

@ -1121,9 +1121,6 @@ typedef struct {
qdf_mc_timer_t wma_fw_time_sync_timer;
bool fw_therm_throt_support;
bool enable_tx_compl_tsf64;
#ifdef WLAN_FEATURE_PKT_CAPTURE
bool is_pktcapture_enabled;
#endif
} t_wma_handle, *tp_wma_handle;
/**

View File

@ -60,9 +60,6 @@
#include <cdp_txrx_cmn.h>
#include <cdp_txrx_misc.h>
#include <cdp_txrx_ctrl.h>
#ifdef WLAN_FEATURE_PKT_CAPTURE
#include <cdp_txrx_mon.h>
#endif /* WLAN_FEATURE_PKT_CAPTURE */
#include "wlan_policy_mgr_api.h"
#include "wma_nan_datapath.h"
@ -2158,66 +2155,6 @@ static void wma_clear_iface_key(struct wma_txrx_node *iface)
}
#endif
#ifdef WLAN_FEATURE_PKT_CAPTURE
/**
* wma_set_packet_capture_mode() - set packet capture mode
* @wma: wma handle
* @vdev_id: vdev id
* @val: mode to set
*
* Return: 0 on success, errno on failure
*/
static int wma_set_packet_capture_mode(
tp_wma_handle wma_handle,
uint8_t vdev_id,
uint8_t val)
{
int ret;
ret = wma_cli_set_command(vdev_id,
WMI_VDEV_PARAM_PACKET_CAPTURE_MODE,
val, VDEV_CMD);
return ret;
}
/**
* wma_handle_packet_capture_mode() - handle packet capture mode
* @wma_handle: wma handle
* @vdev_id: vdev id
* @pdev_id: pdev id
*
* Return: none
*/
static void wma_handle_packet_capture_mode(
tp_wma_handle wma_handle,
uint8_t vdev_id, uint8_t pdev_id)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
if (soc && cds_is_pktcapture_enabled() &&
wma_handle->is_pktcapture_enabled &&
(cds_get_pktcapture_mode() != PKT_CAPTURE_MODE_DISABLE)) {
uint8_t val = cds_get_pktcapture_mode();
status = wma_set_packet_capture_mode(
wma_handle, vdev_id, val);
if (status != QDF_STATUS_SUCCESS)
WMA_LOGE("failed to set capture mode (err=%d)",
status);
else if (status == QDF_STATUS_SUCCESS)
cdp_set_packet_capture_mode(soc, pdev_id, val);
}
}
#else
static void wma_handle_packet_capture_mode(
tp_wma_handle wma_handle,
uint8_t vdev_id, uint8_t pdev_id)
{
}
#endif
QDF_STATUS
__wma_handle_vdev_stop_rsp(struct vdev_stop_response *resp_event)
{
@ -2577,9 +2514,6 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
WMA_LOGE("failed to set sw retry threshold tx non aggr(status = %d)",
status);
wma_handle_packet_capture_mode(wma_handle, vdev_id,
WMI_PDEV_ID_SOC);
status = wma_set_sw_retry_threshold_per_ac(wma_handle, vdev_id,
qos_aggr);
if (QDF_IS_STATUS_ERROR(status))