qcacld-3.0: Add support for start capture
Add support for start capture. Change-Id: I93a15b0bf8b9c26bd53d33378a7daefece448d68 CRs-Fixed: 3415870
Этот коммит содержится в:

коммит произвёл
Madan Koyyalamudi

родитель
9af1145749
Коммит
72b8810c2c
6
Kbuild
6
Kbuild
@@ -2563,6 +2563,12 @@ endif
|
||||
|
||||
ifeq (y,$(filter y,$(CONFIG_LITHIUM) $(CONFIG_BERYLLIUM) $(CONFIG_RHINE)))
|
||||
WLAN_DP_COMP_OBJS += $(DP_COMP_CORE_DIR)/wlan_dp_prealloc.o
|
||||
|
||||
ifeq ($(CONFIG_WLAN_TX_MON_2_0), y)
|
||||
ifeq ($(CONFIG_WLAN_DP_LOCAL_PKT_CAPTURE), y)
|
||||
WLAN_DP_COMP_OBJS += $(DP_COMP_OS_IF_DIR)/os_if_dp_local_pkt_capture.o
|
||||
endif #CONFIG_WLAN_DP_LOCAL_PKT_CAPTURE
|
||||
endif #CONFIG_WLAN_TX_MON_2_0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WLAN_FEATURE_DP_RX_THREADS), y)
|
||||
|
@@ -182,6 +182,7 @@
|
||||
#include "wifi_pos_public_struct.h"
|
||||
#include "wifi_pos_pasn_api.h"
|
||||
#include "os_if_pkt_capture.h"
|
||||
#include "os_if_dp_local_pkt_capture.h"
|
||||
#include "wlan_hdd_son.h"
|
||||
#include "wlan_hdd_mcc_quota.h"
|
||||
#include "wlan_hdd_peer_txq_flush.h"
|
||||
@@ -17880,7 +17881,34 @@ static int wlan_hdd_cfg80211_get_usable_channel(struct wiphy *wiphy,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE
|
||||
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
|
||||
/**
|
||||
* os_if_monitor_mode_configure() - Wifi monitor mode configuration
|
||||
* vendor command
|
||||
* @adapter: hdd adapter
|
||||
* @data: Vendor command data buffer
|
||||
* @data_len: Buffer length
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static
|
||||
QDF_STATUS os_if_monitor_mode_configure(struct hdd_adapter *adapter,
|
||||
const void *data, int data_len)
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
QDF_STATUS status;
|
||||
|
||||
vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_DP_ID);
|
||||
if (!vdev)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
status = os_if_dp_set_lpc_configure(vdev, data, data_len);
|
||||
hdd_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
|
||||
return status;
|
||||
}
|
||||
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
|
||||
|
||||
#if defined(WLAN_FEATURE_PKT_CAPTURE) || defined(WLAN_FEATURE_LOCAL_PKT_CAPTURE)
|
||||
|
||||
/**
|
||||
* __wlan_hdd_cfg80211_set_monitor_mode() - Wifi monitor mode configuration
|
||||
@@ -17910,14 +17938,19 @@ __wlan_hdd_cfg80211_set_monitor_mode(struct wiphy *wiphy,
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc) ||
|
||||
!hdd_is_pkt_capture_mon_enable(adapter))
|
||||
return -EPERM;
|
||||
errno = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (errno)
|
||||
return errno;
|
||||
|
||||
errno = hdd_validate_adapter(adapter);
|
||||
if (errno)
|
||||
return errno;
|
||||
|
||||
if (!(ucfg_pkt_capture_get_mode(hdd_ctx->psoc) ||
|
||||
hdd_is_pkt_capture_mon_enable(adapter) ||
|
||||
ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc)))
|
||||
return -EPERM;
|
||||
|
||||
status = os_if_monitor_mode_configure(adapter, data, data_len);
|
||||
|
||||
return qdf_status_to_os_return(status);
|
||||
@@ -19008,7 +19041,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = {
|
||||
|
||||
FEATURE_GREEN_AP_LOW_LATENCY_PWR_SAVE_COMMANDS
|
||||
|
||||
#ifdef WLAN_FEATURE_PKT_CAPTURE
|
||||
#if defined(WLAN_FEATURE_PKT_CAPTURE) || defined(WLAN_FEATURE_LOCAL_PKT_CAPTURE)
|
||||
FEATURE_MONITOR_MODE_VENDOR_COMMANDS
|
||||
#endif
|
||||
|
||||
|
@@ -243,6 +243,9 @@
|
||||
#include "ce_api.h"
|
||||
#include "wlan_psoc_mlme_ucfg_api.h"
|
||||
|
||||
#include "os_if_dp_local_pkt_capture.h"
|
||||
#include "cdp_txrx_mon.h"
|
||||
|
||||
#ifdef MULTI_CLIENT_LL_SUPPORT
|
||||
#define WLAM_WLM_HOST_DRIVER_PORT_ID 0xFFFFFF
|
||||
#endif
|
||||
@@ -455,6 +458,7 @@ static const struct category_info cinfo[MAX_SUPPORTED_CATEGORY] = {
|
||||
[QDF_MODULE_ID_TWT] = {QDF_TRACE_LEVEL_ALL},
|
||||
[QDF_MODULE_ID_WLAN_PRE_CAC] = {QDF_TRACE_LEVEL_ALL},
|
||||
[QDF_MODULE_ID_COAP] = {QDF_TRACE_LEVEL_ALL},
|
||||
[QDF_MODULE_ID_MON_FILTER] = {QDF_DATA_PATH_TRACE_LEVEL},
|
||||
};
|
||||
|
||||
struct notifier_block hdd_netdev_notifier;
|
||||
@@ -2488,6 +2492,52 @@ void hdd_update_multi_client_thermal_support(struct hdd_context *hdd_ctx)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
|
||||
static void hdd_lpc_enable_powersave(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
struct hdd_adapter *sta_adapter;
|
||||
|
||||
if (!ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc))
|
||||
return;
|
||||
|
||||
ucfg_fwol_configure_global_params(hdd_ctx->psoc, hdd_ctx->pdev);
|
||||
|
||||
sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
|
||||
if (!sta_adapter) {
|
||||
hdd_debug("STA adapter does not exist");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sta_adapter->deflink->vdev_id < WLAN_UMAC_VDEV_ID_MAX)
|
||||
wlan_hdd_set_powersave(sta_adapter, true, 0);
|
||||
}
|
||||
|
||||
static void hdd_lpc_disable_powersave(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
struct hdd_adapter *sta_adapter;
|
||||
|
||||
if (!ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc))
|
||||
return;
|
||||
|
||||
ucfg_fwol_set_ilp_config(hdd_ctx->psoc, hdd_ctx->pdev, 0);
|
||||
|
||||
sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
|
||||
if (!sta_adapter) {
|
||||
hdd_err("STA adapter does not exist");
|
||||
return;
|
||||
}
|
||||
wlan_hdd_set_powersave(sta_adapter, false, 0);
|
||||
}
|
||||
#else
|
||||
static inline void hdd_lpc_enable_powersave(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void hdd_lpc_disable_powersave(struct hdd_context *hdd_ctx)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
|
||||
{
|
||||
int ret;
|
||||
@@ -2939,7 +2989,8 @@ static int __hdd_mon_open(struct net_device *dev)
|
||||
hdd_mon_mode_ether_setup(dev);
|
||||
|
||||
if (con_mode == QDF_GLOBAL_MONITOR_MODE ||
|
||||
ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc)) {
|
||||
ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc) ||
|
||||
ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc)) {
|
||||
ret = hdd_trigger_psoc_idle_restart(hdd_ctx);
|
||||
if (ret) {
|
||||
hdd_err("Failed to start WLAN modules return");
|
||||
@@ -2962,10 +3013,13 @@ static int __hdd_mon_open(struct net_device *dev)
|
||||
}
|
||||
|
||||
if (con_mode != QDF_GLOBAL_MONITOR_MODE &&
|
||||
ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc)) {
|
||||
(ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc) ||
|
||||
ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc))) {
|
||||
hdd_info("Acquire wakelock for STA + monitor mode");
|
||||
|
||||
qdf_wake_lock_acquire(&hdd_ctx->monitor_mode_wakelock,
|
||||
WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE);
|
||||
hdd_lpc_disable_powersave(hdd_ctx);
|
||||
qdf_runtime_pm_prevent_suspend(
|
||||
&hdd_ctx->runtime_context.monitor_mode);
|
||||
}
|
||||
@@ -6223,7 +6277,8 @@ hdd_alloc_station_adapter(struct hdd_context *hdd_ctx, tSirMacAddr mac_addr,
|
||||
if (ucfg_pkt_capture_get_mode(hdd_ctx->psoc) !=
|
||||
PACKET_CAPTURE_MODE_DISABLE)
|
||||
hdd_set_pktcapture_ops(adapter->dev);
|
||||
if (ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc))
|
||||
if (ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc) ||
|
||||
ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc))
|
||||
hdd_set_mon_ops(adapter->dev);
|
||||
} else {
|
||||
hdd_set_station_ops(adapter->dev);
|
||||
@@ -8462,10 +8517,13 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
|
||||
}
|
||||
|
||||
if (wlan_hdd_is_session_type_monitor(QDF_MONITOR_MODE) &&
|
||||
ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc)) {
|
||||
(ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc) ||
|
||||
ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc))) {
|
||||
hdd_info("Release wakelock for STA + monitor mode!");
|
||||
os_if_dp_local_pkt_capture_stop(adapter->deflink->vdev);
|
||||
qdf_runtime_pm_allow_suspend(
|
||||
&hdd_ctx->runtime_context.monitor_mode);
|
||||
hdd_lpc_enable_powersave(hdd_ctx);
|
||||
qdf_wake_lock_release(&hdd_ctx->monitor_mode_wakelock,
|
||||
WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE);
|
||||
}
|
||||
@@ -8474,11 +8532,11 @@ QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx,
|
||||
hdd_deregister_tx_flow_control(adapter);
|
||||
status = hdd_disable_monitor_mode();
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
hdd_err_rl("datapath reset failed for montior mode");
|
||||
hdd_err_rl("datapath reset failed for monitor mode");
|
||||
hdd_set_idle_ps_config(hdd_ctx, true);
|
||||
status = hdd_monitor_mode_vdev_status(adapter);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
hdd_err_rl("stop failed montior mode");
|
||||
hdd_err_rl("stop failed monitor mode");
|
||||
sme_delete_mon_session(mac_handle, adapter->deflink->vdev_id);
|
||||
hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
|
||||
hdd_vdev_destroy(adapter);
|
||||
@@ -20039,7 +20097,8 @@ wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc)) {
|
||||
if (!ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc) &&
|
||||
ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc)) {
|
||||
num_open_session = policy_mgr_mode_specific_connection_count(
|
||||
hdd_ctx->psoc,
|
||||
PM_STA_MODE,
|
||||
|
@@ -752,7 +752,8 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
|
||||
|
||||
adapter = NULL;
|
||||
if (type == NL80211_IFTYPE_MONITOR) {
|
||||
if (ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc) ||
|
||||
if (ucfg_dp_is_local_pkt_capture_enabled(hdd_ctx->psoc) ||
|
||||
ucfg_mlme_is_sta_mon_conc_supported(hdd_ctx->psoc) ||
|
||||
ucfg_pkt_capture_get_mode(hdd_ctx->psoc) !=
|
||||
PACKET_CAPTURE_MODE_DISABLE) {
|
||||
ret = wlan_hdd_add_monitor_check(hdd_ctx,
|
||||
|
@@ -6278,7 +6278,7 @@ void csr_get_vdev_type_nss(enum QDF_OPMODE dev_mode, uint8_t *nss_2g,
|
||||
default:
|
||||
*nss_2g = 1;
|
||||
*nss_5g = 1;
|
||||
sme_err("Unknown device mode");
|
||||
sme_err("Unknown device mode: %d", dev_mode);
|
||||
break;
|
||||
}
|
||||
sme_debug("mode - %d: nss_2g - %d, 5g - %d",
|
||||
|
61
os_if/dp/inc/os_if_dp_local_pkt_capture.h
Обычный файл
61
os_if/dp/inc/os_if_dp_local_pkt_capture.h
Обычный файл
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _OS_IF_DP_LOCAL_PKT_CAPTURE_H_
|
||||
#define _OS_IF_DP_LOCAL_PKT_CAPTURE_H_
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include "qca_vendor.h"
|
||||
|
||||
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
|
||||
|
||||
#define FEATURE_MONITOR_MODE_VENDOR_COMMANDS \
|
||||
{ \
|
||||
.info.vendor_id = QCA_NL80211_VENDOR_ID, \
|
||||
.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_MONITOR_MODE, \
|
||||
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | \
|
||||
WIPHY_VENDOR_CMD_NEED_NETDEV | \
|
||||
WIPHY_VENDOR_CMD_NEED_RUNNING, \
|
||||
.doit = wlan_hdd_cfg80211_set_monitor_mode, \
|
||||
vendor_command_policy(set_monitor_mode_policy, \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_MAX) \
|
||||
},
|
||||
|
||||
extern const struct nla_policy
|
||||
set_monitor_mode_policy[QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_MAX + 1];
|
||||
|
||||
/**
|
||||
* os_if_dp_set_lpc_configure() - Configure local packet capture
|
||||
* operation in the received vendor command
|
||||
* @vdev: vdev
|
||||
* @data: NL data
|
||||
* @data_len: NL data length
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS if Success;
|
||||
* QDF_STATUS_E_* if Failure
|
||||
*/
|
||||
QDF_STATUS os_if_dp_set_lpc_configure(struct wlan_objmgr_vdev *vdev,
|
||||
const void *data, int data_len);
|
||||
#else
|
||||
static inline
|
||||
QDF_STATUS os_if_dp_set_lpc_configure(struct wlan_objmgr_vdev *vdev,
|
||||
const void *data, int data_len)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
|
||||
#endif
|
239
os_if/dp/src/os_if_dp_local_pkt_capture.c
Обычный файл
239
os_if/dp/src/os_if_dp_local_pkt_capture.c
Обычный файл
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "qdf_types.h"
|
||||
#include <net/cfg80211.h>
|
||||
#include "wlan_cfg80211.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "os_if_dp_local_pkt_capture.h"
|
||||
#include "wlan_dp_ucfg_api.h"
|
||||
#include "wlan_dp_main.h"
|
||||
#include "cdp_txrx_mon.h"
|
||||
#include "wlan_policy_mgr_api.h"
|
||||
#include <ol_defines.h>
|
||||
#include "wlan_osif_priv.h"
|
||||
|
||||
/* Short name for QCA_NL80211_VENDOR_SUBCMD_SET_MONITOR_MODE command */
|
||||
#define SET_MONITOR_MODE_CONFIG_MAX \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_MAX
|
||||
#define SET_MONITOR_MODE_INVALID \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_INVALID
|
||||
#define SET_MONITOR_MODE_DATA_TX_FRAME_TYPE \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_DATA_TX_FRAME_TYPE
|
||||
#define SET_MONITOR_MODE_DATA_RX_FRAME_TYPE \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_DATA_RX_FRAME_TYPE
|
||||
#define SET_MONITOR_MODE_MGMT_TX_FRAME_TYPE \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_MGMT_TX_FRAME_TYPE
|
||||
#define SET_MONITOR_MODE_MGMT_RX_FRAME_TYPE \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_MGMT_RX_FRAME_TYPE
|
||||
#define SET_MONITOR_MODE_CTRL_TX_FRAME_TYPE \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_CTRL_TX_FRAME_TYPE
|
||||
#define SET_MONITOR_MODE_CTRL_RX_FRAME_TYPE \
|
||||
QCA_WLAN_VENDOR_ATTR_SET_MONITOR_MODE_CTRL_RX_FRAME_TYPE
|
||||
|
||||
#define MGMT_FRAME_TYPE 0
|
||||
#define DATA_FRAME_TYPE 1
|
||||
#define CTRL_FRAME_TYPE 2
|
||||
|
||||
const struct nla_policy
|
||||
set_monitor_mode_policy[SET_MONITOR_MODE_CONFIG_MAX + 1] = {
|
||||
[SET_MONITOR_MODE_DATA_TX_FRAME_TYPE] = { .type = NLA_U32 },
|
||||
[SET_MONITOR_MODE_DATA_RX_FRAME_TYPE] = { .type = NLA_U32 },
|
||||
[SET_MONITOR_MODE_MGMT_TX_FRAME_TYPE] = { .type = NLA_U32 },
|
||||
[SET_MONITOR_MODE_MGMT_RX_FRAME_TYPE] = { .type = NLA_U32 },
|
||||
[SET_MONITOR_MODE_CTRL_TX_FRAME_TYPE] = { .type = NLA_U32 },
|
||||
[SET_MONITOR_MODE_CTRL_RX_FRAME_TYPE] = { .type = NLA_U32 },
|
||||
};
|
||||
|
||||
static
|
||||
bool os_if_local_pkt_capture_concurrency_allowed(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static QDF_STATUS os_if_start_capture_allowed(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
enum QDF_OPMODE mode = wlan_vdev_mlme_get_opmode(vdev);
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
osif_err("NULL psoc");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!ucfg_dp_is_local_pkt_capture_enabled(psoc)) {
|
||||
osif_warn("local pkt capture feature not enabled");
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
if (mode != QDF_MONITOR_MODE) {
|
||||
osif_err("Operation not permitted in mode: %d", mode);
|
||||
return QDF_STATUS_E_PERM;
|
||||
}
|
||||
|
||||
/*
|
||||
* Whether STA interface is present or not, is already checked
|
||||
* while creating monitor interface
|
||||
*/
|
||||
|
||||
if (policy_mgr_is_mlo_sta_present(psoc)) {
|
||||
osif_err("MLO STA present, start capture is not permitted");
|
||||
return QDF_STATUS_E_PERM;
|
||||
}
|
||||
|
||||
if (!os_if_local_pkt_capture_concurrency_allowed(psoc)) {
|
||||
osif_err("Concurrency check failed, start capture not allowed");
|
||||
return QDF_STATUS_E_PERM;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static
|
||||
QDF_STATUS os_if_dp_local_pkt_capture_start(struct wlan_objmgr_vdev *vdev,
|
||||
struct nlattr **tb)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct cdp_monitor_filter filter = {0};
|
||||
uint32_t pkt_type = 0, val;
|
||||
void *soc;
|
||||
|
||||
status = os_if_start_capture_allowed(vdev);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
goto error;
|
||||
|
||||
soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
if (!soc)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
if (tb[SET_MONITOR_MODE_MGMT_TX_FRAME_TYPE]) {
|
||||
val = nla_get_u32(tb[SET_MONITOR_MODE_MGMT_TX_FRAME_TYPE]);
|
||||
|
||||
if (val != QCA_WLAN_VENDOR_MONITOR_MGMT_FRAME_TYPE_ALL) {
|
||||
osif_err("Invalid value: %d Expected: %d",
|
||||
val,
|
||||
QCA_WLAN_VENDOR_MONITOR_MGMT_FRAME_TYPE_ALL);
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
pkt_type |= BIT(MGMT_FRAME_TYPE);
|
||||
}
|
||||
|
||||
if (tb[SET_MONITOR_MODE_MGMT_RX_FRAME_TYPE]) {
|
||||
val = nla_get_u32(tb[SET_MONITOR_MODE_MGMT_RX_FRAME_TYPE]);
|
||||
|
||||
if (val != QCA_WLAN_VENDOR_MONITOR_MGMT_FRAME_TYPE_ALL) {
|
||||
osif_err("Invalid value: %d Expected: %d",
|
||||
val,
|
||||
QCA_WLAN_VENDOR_MONITOR_MGMT_FRAME_TYPE_ALL);
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
pkt_type |= BIT(MGMT_FRAME_TYPE);
|
||||
}
|
||||
|
||||
if (tb[SET_MONITOR_MODE_DATA_TX_FRAME_TYPE]) {
|
||||
val = nla_get_u32(tb[SET_MONITOR_MODE_DATA_TX_FRAME_TYPE]);
|
||||
|
||||
if (val != QCA_WLAN_VENDOR_MONITOR_DATA_FRAME_TYPE_ALL) {
|
||||
osif_err("Invalid value: %d Expected: %d",
|
||||
val,
|
||||
QCA_WLAN_VENDOR_MONITOR_DATA_FRAME_TYPE_ALL);
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
pkt_type |= BIT(DATA_FRAME_TYPE);
|
||||
}
|
||||
|
||||
if (tb[SET_MONITOR_MODE_DATA_RX_FRAME_TYPE]) {
|
||||
val = nla_get_u32(tb[SET_MONITOR_MODE_DATA_RX_FRAME_TYPE]);
|
||||
|
||||
if (val != QCA_WLAN_VENDOR_MONITOR_DATA_FRAME_TYPE_ALL) {
|
||||
osif_err("Invalid value: %d Expected: %d",
|
||||
val,
|
||||
QCA_WLAN_VENDOR_MONITOR_DATA_FRAME_TYPE_ALL);
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
pkt_type |= BIT(DATA_FRAME_TYPE);
|
||||
}
|
||||
|
||||
if (tb[SET_MONITOR_MODE_CTRL_TX_FRAME_TYPE]) {
|
||||
val = nla_get_u32(tb[SET_MONITOR_MODE_CTRL_TX_FRAME_TYPE]);
|
||||
|
||||
if (val != QCA_WLAN_VENDOR_MONITOR_CTRL_FRAME_TYPE_ALL) {
|
||||
osif_err("Invalid value: %d Expected: %d",
|
||||
val,
|
||||
QCA_WLAN_VENDOR_MONITOR_CTRL_FRAME_TYPE_ALL);
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
pkt_type |= BIT(CTRL_FRAME_TYPE);
|
||||
}
|
||||
|
||||
if (tb[SET_MONITOR_MODE_CTRL_RX_FRAME_TYPE]) {
|
||||
val = nla_get_u32(tb[SET_MONITOR_MODE_CTRL_RX_FRAME_TYPE]);
|
||||
|
||||
if (val != QCA_WLAN_VENDOR_MONITOR_CTRL_FRAME_TYPE_ALL) {
|
||||
osif_err("Invalid value: %d Expected: %d",
|
||||
val,
|
||||
QCA_WLAN_VENDOR_MONITOR_CTRL_FRAME_TYPE_ALL);
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
pkt_type |= BIT(CTRL_FRAME_TYPE);
|
||||
}
|
||||
|
||||
if (pkt_type == 0) {
|
||||
osif_err("Invalid config, pkt_type: %d", pkt_type);
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
osif_debug("start capture config pkt_type:0x%x", pkt_type);
|
||||
|
||||
filter.mode = MON_FILTER_PASS;
|
||||
filter.fp_mgmt = pkt_type & BIT(MGMT_FRAME_TYPE) ? FILTER_MGMT_ALL : 0;
|
||||
filter.fp_data = pkt_type & BIT(DATA_FRAME_TYPE) ? FILTER_DATA_ALL : 0;
|
||||
filter.fp_ctrl = pkt_type & BIT(CTRL_FRAME_TYPE) ? FILTER_CTRL_ALL : 0;
|
||||
|
||||
status = cdp_start_local_pkt_capture(soc, OL_TXRX_PDEV_ID, &filter);
|
||||
|
||||
error:
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS os_if_dp_set_lpc_configure(struct wlan_objmgr_vdev *vdev,
|
||||
const void *data, int data_len)
|
||||
{
|
||||
struct nlattr *tb[SET_MONITOR_MODE_CONFIG_MAX + 1];
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (wlan_cfg80211_nla_parse(tb, SET_MONITOR_MODE_CONFIG_MAX,
|
||||
data, data_len, set_monitor_mode_policy)) {
|
||||
osif_err("Invalid monitor attr");
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
status = os_if_dp_local_pkt_capture_start(vdev, tb);
|
||||
|
||||
error:
|
||||
return status;
|
||||
}
|
||||
|
Ссылка в новой задаче
Block a user