qcacld-3.0: Add support to send wfa test config to FW

User sends wfa test configs to host using vendor command
QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION. Host parses the
vendor command and sends wfa test configs to FW using WMI command
i.e. WMI_WFA_CONFIG_CMDID

Change-Id: I5aa0bc8b0a0064828b48368e47d53a5ad5e7ff2f
CRs-Fixed: 2772013
This commit is contained in:
Abhishek Ambure
2020-08-26 18:38:01 +05:30
committed by snandini
parent 7497c7ca6d
commit af02d10731
11 changed files with 488 additions and 1 deletions

13
Kbuild
View File

@@ -1259,6 +1259,19 @@ endif
MLME_OBJS += $(CM_ROAM_OBJS) MLME_OBJS += $(CM_ROAM_OBJS)
####### WFA_CONFIG ########
WFA_DIR := components/umac/mlme/wfa_config
WFA_TGT_IF_DIR := components/target_if/wfa_config
WFA_INC := -I$(WLAN_ROOT)/$(WFA_DIR)/dispatcher/inc \
-I$(WLAN_ROOT)/$(WFA_TGT_IF_DIR)/inc
MLME_INC += $(WFA_INC)
MLME_OBJS += $(WFA_TGT_IF_DIR)/src/target_if_wfa_testcmd.o \
$(WFA_DIR)/dispatcher/src/wlan_wfa_tgt_if_tx_api.o
####### BLACKLIST_MGR ######## ####### BLACKLIST_MGR ########
BLM_DIR := components/blacklist_mgr BLM_DIR := components/blacklist_mgr

View File

@@ -29,6 +29,7 @@
#include <wlan_objmgr_vdev_obj.h> #include <wlan_objmgr_vdev_obj.h>
#include <wlan_objmgr_peer_obj.h> #include <wlan_objmgr_peer_obj.h>
#include "wlan_cm_roam_public_struct.h" #include "wlan_cm_roam_public_struct.h"
#include "wlan_wfa_config_public_struct.h"
#define mlme_legacy_fatal(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_MLME, params) #define mlme_legacy_fatal(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_MLME, params)
#define mlme_legacy_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MLME, params) #define mlme_legacy_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MLME, params)
@@ -40,10 +41,12 @@
* struct wlan_mlme_psoc_ext_obj -MLME ext psoc priv object * struct wlan_mlme_psoc_ext_obj -MLME ext psoc priv object
* @cfg: cfg items * @cfg: cfg items
* @rso_tx_ops: Roam Tx ops to send roam offload commands to firmware * @rso_tx_ops: Roam Tx ops to send roam offload commands to firmware
* @wfa_testcmd: WFA config tx ops to send to FW
*/ */
struct wlan_mlme_psoc_ext_obj { struct wlan_mlme_psoc_ext_obj {
struct wlan_mlme_cfg cfg; struct wlan_mlme_cfg cfg;
struct wlan_cm_roam_tx_ops rso_tx_ops; struct wlan_cm_roam_tx_ops rso_tx_ops;
struct wlan_mlme_wfa_cmd wfa_testcmd;
}; };
/** /**
@@ -163,7 +166,7 @@ struct wlan_mlme_roam {
* @bigtk_vdev_support: BIGTK feature support for this vdev (SAP) * @bigtk_vdev_support: BIGTK feature support for this vdev (SAP)
* @sae_auth_retry: SAE auth retry information * @sae_auth_retry: SAE auth retry information
* @roam_reason_better_ap: roam due to better AP found * @roam_reason_better_ap: roam due to better AP found
* @better_ap_hb_failure_rssi: heartbeat failure AP RSSI * @hb_failure_rssi: heartbeat failure AP RSSI
* @fils_con_info: Pointer to fils connection info from csr roam profile * @fils_con_info: Pointer to fils connection info from csr roam profile
* @opr_rate_set: operational rates set * @opr_rate_set: operational rates set
* @ext_opr_rate_set: extended operational rates set * @ext_opr_rate_set: extended operational rates set

View File

@@ -29,6 +29,7 @@
#include "wlan_psoc_mlme_api.h" #include "wlan_psoc_mlme_api.h"
#include "target_if_cm_roam_offload.h" #include "target_if_cm_roam_offload.h"
#include "wlan_crypto_global_api.h" #include "wlan_crypto_global_api.h"
#include "target_if_wfa_testcmd.h"
static struct vdev_mlme_ops sta_mlme_ops; static struct vdev_mlme_ops sta_mlme_ops;
static struct vdev_mlme_ops ap_mlme_ops; static struct vdev_mlme_ops ap_mlme_ops;
@@ -1365,6 +1366,9 @@ QDF_STATUS psoc_mlme_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme)
target_if_cm_roam_register_tx_ops( target_if_cm_roam_register_tx_ops(
&psoc_mlme->ext_psoc_ptr->rso_tx_ops); &psoc_mlme->ext_psoc_ptr->rso_tx_ops);
target_if_wfatestcmd_register_tx_ops(
&psoc_mlme->ext_psoc_ptr->wfa_testcmd.tx_ops);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

View File

@@ -0,0 +1,37 @@
/*
* 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: This file contains definitions for target_if WFA test commands sent
* to FW.
*/
#ifndef TARGET_IF_WFA_TESTCMD_H__
#define TARGET_IF_WFA_TESTCMD_H__
#include "wlan_mlme_main.h"
/**
* target_if_wfatestcmd_register_tx_ops() - Target IF API to register WFA
* test command related tx op.
* @tx_ops: Pointer to tx ops fp struct
*
* Return: QDF_STATUS
*/
QDF_STATUS
target_if_wfatestcmd_register_tx_ops(struct wlan_wfa_cmd_tx_ops *tx_ops);
#endif

View File

@@ -0,0 +1,80 @@
/*
* 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: This file contains definitions for target_if wfa send test cmd.
*/
#include "qdf_types.h"
#include "target_if_wfa_testcmd.h"
#include "target_if.h"
#include "wlan_mlme_dbg.h"
#include "wlan_mlme_api.h"
#include "wlan_mlme_main.h"
static struct wmi_unified
*target_if_wfa_get_wmi_handle_from_vdev(struct wlan_objmgr_vdev *vdev)
{
struct wlan_objmgr_pdev *pdev;
struct wmi_unified *wmi_handle;
pdev = wlan_vdev_get_pdev(vdev);
if (!pdev) {
target_if_err("PDEV is NULL");
return NULL;
}
wmi_handle = get_wmi_unified_hdl_from_pdev(pdev);
if (!wmi_handle) {
target_if_err("wmi_handle is null");
return NULL;
}
return wmi_handle;
}
/**
* target_if_wfa_send_cmd() - Send WFA test cmd to WMI
* @vdev: VDEV object pointer
* @wfa_test: Pointer to WFA test params
*
* Return: QDF_STATUS
*/
static QDF_STATUS
target_if_wfa_send_cmd(struct wlan_objmgr_vdev *vdev,
struct set_wfatest_params *wfa_test)
{
wmi_unified_t wmi_handle;
wmi_handle = target_if_wfa_get_wmi_handle_from_vdev(vdev);
if (!wmi_handle)
return QDF_STATUS_E_FAILURE;
return wmi_unified_wfa_test_cmd(wmi_handle, wfa_test);
}
QDF_STATUS
target_if_wfatestcmd_register_tx_ops(struct wlan_wfa_cmd_tx_ops *tx_ops)
{
if (!tx_ops) {
target_if_err("target if tx ops is NULL!");
return QDF_STATUS_E_INVAL;
}
tx_ops->send_wfa_test_cmd = target_if_wfa_send_cmd;
return QDF_STATUS_SUCCESS;
}

View File

@@ -0,0 +1,48 @@
/*
* 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 structs and macros which can be accessed by various
* components and modules.
*/
#ifndef _WLAN_WFA_CONFIG_PUBLIC_STRUCT_H_
#define _WLAN_WFA_CONFIG_PUBLIC_STRUCT_H_
#include <wlan_cmn.h>
#include <qdf_status.h>
#include <qdf_types.h>
/**
* wlan_wfa_cmd_tx_ops - structure of tx function pointers for wfa test cmds
* @send_wfa_test_cmd: TX ops function pointer to send WFA test command
*/
struct wlan_wfa_cmd_tx_ops {
QDF_STATUS (*send_wfa_test_cmd)(struct wlan_objmgr_vdev *vdev,
struct set_wfatest_params *wfa_test);
};
/**
* struct wlan_mlme_wfa_cmd - WFA test command tx ops
* @tx_ops: WFA test command Tx ops to send commands to firmware
*/
struct wlan_mlme_wfa_cmd {
struct wlan_wfa_cmd_tx_ops tx_ops;
};
#endif /* _WLAN_WFA_CONFIG_PUBLIC_STRUCT_H_ */

View File

@@ -0,0 +1,39 @@
/*
* 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: wlan_wfa_tgt_if_tx_api.h
*
* This file contains connection manager tx ops related functions
*/
#ifndef WFA_TGT_IF_TX_API_H__
#define WFA_TGT_IF_TX_API_H__
#include "wlan_wfa_config_public_struct.h"
/**
* wlan_send_wfatest_cmd() - Send WFA test command to firmware
* @vdev: VDEV pointer
* @wmi_wfatest: wfa test commad pointer
*
* Return: QDF_STATUS
*/
QDF_STATUS
wlan_send_wfatest_cmd(struct wlan_objmgr_vdev *vdev,
struct set_wfatest_params *wmi_wfatest);
#endif /* WFA_TGT_IF_TX_API_H__ */

View File

@@ -0,0 +1,43 @@
/*
* 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: wlan_wfa_ucfg_api.h
*
* Implementation for the Common WFA test config interfaces.
*/
#ifndef WLAN_WFA_CONFIG_API_H__
#define WLAN_WFA_CONFIG_API_H__
#include "wlan_mlme_dbg.h"
#include "wlan_mlme_api.h"
#include "wlan_wfa_tgt_if_tx_api.h"
/**
* ucfg_send_wfatest_cmd() - Send WFA test command to firmware
* @vdev: Pointer to vdev
* @wmi_wfatest: Pointer to WFA test config params
*
* Return: QDF_STATUS
*/
static inline
QDF_STATUS ucfg_send_wfatest_cmd(struct wlan_objmgr_vdev *vdev,
struct set_wfatest_params *wmi_wfatest)
{
return wlan_send_wfatest_cmd(vdev, wmi_wfatest);
}
#endif /* WLAN_WFA_CONFIG_API_H__ */

View File

@@ -0,0 +1,73 @@
/*
* 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: wlan_wfa_tgt_if_tx_api.c
*
* Implementation for the Common WFA config interfaces.
*/
#include "wlan_objmgr_psoc_obj.h"
#include "wlan_psoc_mlme_api.h"
#include "wlan_mlme_ucfg_api.h"
#include "wlan_wfa_tgt_if_tx_api.h"
#include "wlan_mlme_public_struct.h"
#include "wma.h"
static inline struct wlan_wfa_cmd_tx_ops *
wlan_wfatest_get_tx_ops_from_vdev(struct wlan_objmgr_vdev *vdev)
{
mlme_psoc_ext_t *mlme_priv;
struct wlan_wfa_cmd_tx_ops *tx_ops;
struct wlan_objmgr_psoc *psoc;
psoc = wlan_vdev_get_psoc(vdev);
if (!psoc) {
mlme_legacy_err("psoc object is NULL");
return NULL;
}
mlme_priv = wlan_psoc_mlme_get_ext_hdl(psoc);
if (!mlme_priv) {
mlme_legacy_err("vdev legacy private object is NULL");
return NULL;
}
tx_ops = &mlme_priv->wfa_testcmd.tx_ops;
return tx_ops;
}
QDF_STATUS
wlan_send_wfatest_cmd(struct wlan_objmgr_vdev *vdev,
struct set_wfatest_params *wmi_wfatest)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct wlan_wfa_cmd_tx_ops *tx_ops;
if (!vdev || !wmi_wfatest) {
mlme_legacy_err("vdev or test params is NULL");
return status;
}
tx_ops = wlan_wfatest_get_tx_ops_from_vdev(vdev);
if (!tx_ops || !tx_ops->send_wfa_test_cmd) {
mlme_legacy_err("Failed to send WFA test cmd");
return QDF_STATUS_E_FAILURE;
}
return tx_ops->send_wfa_test_cmd(vdev, wmi_wfatest);
}

View File

@@ -163,6 +163,7 @@
#include "wlan_if_mgr_ucfg_api.h" #include "wlan_if_mgr_ucfg_api.h"
#include "wlan_if_mgr_public_struct.h" #include "wlan_if_mgr_public_struct.h"
#endif #endif
#include "wlan_wfa_ucfg_api.h"
#define g_mode_rates_size (12) #define g_mode_rates_size (12)
#define a_mode_rates_size (8) #define a_mode_rates_size (8)
@@ -6856,6 +6857,12 @@ qca_wlan_vendor_attr_he_omi_tx_policy [QCA_WLAN_VENDOR_ATTR_HE_OMI_MAX + 1] = {
[QCA_WLAN_VENDOR_ATTR_HE_OMI_ULMU_DATA_DISABLE] = {.type = NLA_U8 }, [QCA_WLAN_VENDOR_ATTR_HE_OMI_ULMU_DATA_DISABLE] = {.type = NLA_U8 },
}; };
static const struct nla_policy
wlan_oci_override_policy [QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_MAX + 1] = {
[QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_FRAME_TYPE] = {.type = NLA_U8 },
[QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_FREQUENCY] = {.type = NLA_U32 },
};
const struct nla_policy const struct nla_policy
wlan_hdd_wifi_test_config_policy[ wlan_hdd_wifi_test_config_policy[
QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX + 1] = { QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX + 1] = {
@@ -6923,6 +6930,14 @@ wlan_hdd_wifi_test_config_policy[
.type = NLA_U8}, .type = NLA_U8},
[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_DISASSOC_TX] = { [QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_DISASSOC_TX] = {
.type = NLA_FLAG}, .type = NLA_FLAG},
[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_FT_REASSOCREQ_RSNXE_USED] = {
.type = NLA_U8},
[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_IGNORE_CSA] = {
.type = NLA_U8},
[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_OCI_OVERRIDE] = {
.type = NLA_NESTED},
[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_IGNORE_SA_QUERY_TIMEOUT] = {
.type = NLA_U8},
}; };
/** /**
@@ -9493,6 +9508,7 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
uint8_t value = 0; uint8_t value = 0;
uint8_t wmm_mode = 0; uint8_t wmm_mode = 0;
uint32_t cmd_id; uint32_t cmd_id;
struct set_wfatest_params wfa_param = {0};
struct hdd_station_ctx *hdd_sta_ctx = struct hdd_station_ctx *hdd_sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter); WLAN_HDD_GET_STATION_CTX_PTR(adapter);
@@ -9972,6 +9988,129 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
hdd_sta_ctx->conn_info.bssid.bytes, hdd_sta_ctx->conn_info.bssid.bytes,
1, false); 1, false);
} }
cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_FT_REASSOCREQ_RSNXE_USED;
if (tb[cmd_id]) {
wfa_param.vdev_id = adapter->vdev_id;
wfa_param.value = nla_get_u8(tb[cmd_id]);
if (wfa_param.value < RSNXE_DEFAULT ||
wfa_param.value > RSNXE_OVERRIDE_2) {
hdd_debug("Invalid RSNXE override %d", wfa_param.value);
goto send_err;
}
wfa_param.cmd = WFA_CONFIG_RXNE;
hdd_info("send wfa test config RXNE used %d", wfa_param.value);
ret_val = ucfg_send_wfatest_cmd(adapter->vdev, &wfa_param);
}
cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_IGNORE_CSA;
if (tb[cmd_id]) {
wfa_param.vdev_id = adapter->vdev_id;
wfa_param.value = nla_get_u8(tb[cmd_id]);
if (wfa_param.value != CSA_DEFAULT &&
wfa_param.value != CSA_IGNORE) {
hdd_debug("Invalid CSA config %d", wfa_param.value);
goto send_err;
}
wfa_param.cmd = WFA_CONFIG_CSA;
hdd_info("send wfa test config CSA used %d", wfa_param.value);
ret_val = ucfg_send_wfatest_cmd(adapter->vdev, &wfa_param);
}
cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_OCI_OVERRIDE;
if (tb[cmd_id]) {
struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_MAX + 1];
wfa_param.vdev_id = adapter->vdev_id;
wfa_param.cmd = WFA_CONFIG_OCV;
if (wlan_cfg80211_nla_parse_nested(
tb2, QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_MAX,
tb[cmd_id], wlan_oci_override_policy)) {
hdd_debug("Failed to parse OCI override");
goto send_err;
}
if (!(tb2[QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_FRAME_TYPE] &&
tb2[QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_FREQUENCY])) {
hdd_debug("Invalid ATTR FRAME_TYPE/FREQUENCY");
goto send_err;
}
wfa_param.ocv_param = qdf_mem_malloc(
sizeof(struct ocv_wfatest_params));
if (!wfa_param.ocv_param) {
hdd_err("Failed to alloc memory for ocv param");
goto send_err;
}
cmd_id = QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_FRAME_TYPE;
switch (nla_get_u8(tb2[cmd_id])) {
case QCA_WLAN_VENDOR_OCI_OVERRIDE_FRAME_SA_QUERY_REQ:
wfa_param.ocv_param->frame_type =
WMI_HOST_WFA_CONFIG_OCV_FRMTYPE_SAQUERY_REQ;
break;
case QCA_WLAN_VENDOR_OCI_OVERRIDE_FRAME_SA_QUERY_RESP:
wfa_param.ocv_param->frame_type =
WMI_HOST_WFA_CONFIG_OCV_FRMTYPE_SAQUERY_RSP;
break;
case QCA_WLAN_VENDOR_OCI_OVERRIDE_FRAME_FT_REASSOC_REQ:
wfa_param.ocv_param->frame_type =
WMI_HOST_WFA_CONFIG_OCV_FRMTYPE_FT_REASSOC_REQ;
break;
case QCA_WLAN_VENDOR_OCI_OVERRIDE_FRAME_FILS_REASSOC_REQ:
wfa_param.ocv_param->frame_type =
WMI_HOST_WFA_CONFIG_OCV_FRMTYPE_FILS_REASSOC_REQ;
break;
default:
hdd_debug("Invalid frame type for ocv test config %d",
nla_get_u8(tb2[cmd_id]));
qdf_mem_free(wfa_param.ocv_param);
goto send_err;
}
cmd_id = QCA_WLAN_VENDOR_ATTR_OCI_OVERRIDE_FREQUENCY;
wfa_param.ocv_param->freq = nla_get_u32(tb2[cmd_id]);
if (!WLAN_REG_IS_24GHZ_CH_FREQ(wfa_param.ocv_param->freq) &&
!WLAN_REG_IS_5GHZ_CH_FREQ(wfa_param.ocv_param->freq) &&
!WLAN_REG_IS_6GHZ_CHAN_FREQ(wfa_param.ocv_param->freq)) {
hdd_debug("Invalid Freq %d", wfa_param.ocv_param->freq);
qdf_mem_free(wfa_param.ocv_param);
goto send_err;
}
hdd_info("send wfa test config OCV frame type %d freq %d",
wfa_param.ocv_param->frame_type,
wfa_param.ocv_param->freq);
ret_val = ucfg_send_wfatest_cmd(adapter->vdev, &wfa_param);
qdf_mem_free(wfa_param.ocv_param);
}
cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_IGNORE_SA_QUERY_TIMEOUT;
if (tb[cmd_id]) {
wfa_param.vdev_id = adapter->vdev_id;
wfa_param.value = nla_get_u8(tb[cmd_id]);
if (wfa_param.value != SA_QUERY_TIMEOUT_DEFAULT &&
wfa_param.value != SA_QUERY_TIMEOUT_IGNORE) {
hdd_debug("Invalid SA query timeout config %d",
wfa_param.value);
goto send_err;
}
wfa_param.cmd = WFA_CONFIG_SA_QUERY;
hdd_info("send wfa test config SAquery %d", wfa_param.value);
ret_val = ucfg_send_wfatest_cmd(adapter->vdev, &wfa_param);
}
if (update_sme_cfg) if (update_sme_cfg)
sme_update_config(mac_handle, sme_config); sme_update_config(mac_handle, sme_config);

View File

@@ -306,6 +306,14 @@ extern const struct nla_policy
wlan_hdd_wifi_test_config_policy[ wlan_hdd_wifi_test_config_policy[
QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX + 1]; QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX + 1];
#define RSNXE_DEFAULT 0
#define RSNXE_OVERRIDE_1 1
#define RSNXE_OVERRIDE_2 2
#define CSA_DEFAULT 0
#define CSA_IGNORE 1
#define SA_QUERY_TIMEOUT_DEFAULT 0
#define SA_QUERY_TIMEOUT_IGNORE 1
#define FEATURE_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION \ #define FEATURE_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION \
{ \ { \
.info.vendor_id = QCA_NL80211_VENDOR_ID, \ .info.vendor_id = QCA_NL80211_VENDOR_ID, \