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:

committed by
snandini

parent
7497c7ca6d
commit
af02d10731
@@ -29,6 +29,7 @@
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <wlan_objmgr_peer_obj.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_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
|
||||
* @cfg: cfg items
|
||||
* @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_cfg cfg;
|
||||
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)
|
||||
* @sae_auth_retry: SAE auth retry information
|
||||
* @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
|
||||
* @opr_rate_set: operational rates set
|
||||
* @ext_opr_rate_set: extended operational rates set
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "wlan_psoc_mlme_api.h"
|
||||
#include "target_if_cm_roam_offload.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 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(
|
||||
&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;
|
||||
}
|
||||
|
||||
|
37
components/target_if/wfa_config/inc/target_if_wfa_testcmd.h
Normal file
37
components/target_if/wfa_config/inc/target_if_wfa_testcmd.h
Normal 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
|
80
components/target_if/wfa_config/src/target_if_wfa_testcmd.c
Normal file
80
components/target_if/wfa_config/src/target_if_wfa_testcmd.c
Normal 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;
|
||||
}
|
@@ -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_ */
|
@@ -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__ */
|
@@ -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__ */
|
@@ -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);
|
||||
}
|
Reference in New Issue
Block a user