qcacmn: removal of pre-lithium Spooftest code

Add spoof test code under the macros : Spoof and partial offload

Change-Id: I17c2c911b41cefc9160885cd028cdebb0225d0da
This commit is contained in:
Jithender Miryala
2021-12-09 17:27:15 +05:30
committed by Madan Koyyalamudi
parent d0b50dd6b8
commit 102c051570
6 changed files with 75 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
*
* Permission to use, copy, modify, and/or distribute this software for
@@ -409,6 +410,20 @@ static QDF_STATUS target_send_dfs_offload_enable_cmd(
return status;
}
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
static void target_if_register_dfs_tx_ops_send_avg(
struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops)
{
dfs_tx_ops->dfs_send_avg_radar_params_to_fw =
&target_if_dfs_send_avg_params_to_fw;
}
#else
static inline void target_if_register_dfs_tx_ops_send_avg(
struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops)
{
}
#endif
QDF_STATUS target_if_register_dfs_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
{
struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops;
@@ -435,8 +450,9 @@ QDF_STATUS target_if_register_dfs_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
&target_if_dfs_set_phyerr_filter_offload;
dfs_tx_ops->dfs_get_caps = &target_if_dfs_get_caps;
dfs_tx_ops->dfs_send_avg_radar_params_to_fw =
&target_if_dfs_send_avg_params_to_fw;
target_if_register_dfs_tx_ops_send_avg(dfs_tx_ops);
dfs_tx_ops->dfs_is_tgt_offload = &target_if_dfs_offload;
dfs_tx_ops->dfs_is_tgt_radar_found_chan_freq_eq_center_freq =
&target_if_dfs_is_radar_found_chan_freq_eq_center_freq;

View File

@@ -1421,6 +1421,20 @@ void dfs_radarfound_action_generic(struct wlan_dfs *dfs, uint8_t seg_id)
qdf_mem_free(radar_found);
}
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
static bool dfs_is_spoof_needed(struct wlan_dfs *dfs)
{
return ((utils_get_dfsdomain(dfs->dfs_pdev_obj) == DFS_FCC_DOMAIN) &&
(lmac_is_host_dfs_check_support_enabled(dfs->dfs_pdev_obj)) &&
(dfs->dfs_spoof_test_done ? dfs->dfs_use_nol : 1));
}
#else
static inline bool dfs_is_spoof_needed(struct wlan_dfs *dfs)
{
return false;
}
#endif
/**
* dfs_radar_found_action() - Radar found action
* @dfs: Pointer to wlan_dfs structure.
@@ -1436,10 +1450,7 @@ static void dfs_radar_found_action(struct wlan_dfs *dfs,
* average radar parameters to FW and start the host status
* wait timer.
*/
if (!bangradar &&
(utils_get_dfsdomain(dfs->dfs_pdev_obj) == DFS_FCC_DOMAIN) &&
lmac_is_host_dfs_check_support_enabled(dfs->dfs_pdev_obj) &&
(dfs->dfs_spoof_test_done ? dfs->dfs_use_nol : 1)) {
if (!bangradar && dfs_is_spoof_needed(dfs)) {
dfs_radarfound_action_fcc(dfs, seg_id);
} else {
dfs_radarfound_action_generic(dfs, seg_id);

View File

@@ -174,8 +174,10 @@ struct dfs_to_mlme {
uint64_t dfs_ch_flags,
int *cac_timeout);
#endif
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
QDF_STATUS (*mlme_rebuild_chan_list_with_non_dfs_channels)
(struct wlan_objmgr_pdev *pdev);
#endif
QDF_STATUS (*mlme_restart_vaps_with_non_dfs_chan)
(struct wlan_objmgr_pdev *pdev, int no_chans_avail);
bool (*mlme_check_allowed_prim_chanlist)
@@ -194,8 +196,10 @@ struct dfs_to_mlme {
(struct wlan_objmgr_pdev *pdev);
void (*mlme_release_radar_mode_switch_lock)
(struct wlan_objmgr_pdev *pdev);
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
QDF_STATUS (*mlme_proc_spoof_success)
(struct wlan_objmgr_pdev *pdev);
#endif
};
extern struct dfs_to_mlme global_dfs_to_mlme;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
*
* Copyright (c) 2022 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
@@ -120,6 +120,22 @@ register_dfs_callbacks_for_freq(struct dfs_to_mlme *mlme_callback)
#endif
#endif
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
static void register_dfs_callbacks_spoof_success_failure(
struct dfs_to_mlme *tmp_dfs_to_mlme)
{
tmp_dfs_to_mlme->mlme_rebuild_chan_list_with_non_dfs_channels =
mlme_dfs_rebuild_chan_list_with_non_dfs_channels;
tmp_dfs_to_mlme->mlme_proc_spoof_success =
mlme_dfs_proc_spoof_success;
}
#else
static inline void register_dfs_callbacks_spoof_success_failure(
struct dfs_to_mlme *tmp_dfs_to_mlme)
{
}
#endif
#ifndef MOBILE_DFS_SUPPORT
void register_dfs_callbacks(void)
{
@@ -143,8 +159,9 @@ void register_dfs_callbacks(void)
tmp_dfs_to_mlme->mlme_nol_timeout_notification =
mlme_dfs_nol_timeout_notification;
tmp_dfs_to_mlme->mlme_clist_update = mlme_dfs_clist_update;
tmp_dfs_to_mlme->mlme_rebuild_chan_list_with_non_dfs_channels =
mlme_dfs_rebuild_chan_list_with_non_dfs_channels;
register_dfs_callbacks_spoof_success_failure(tmp_dfs_to_mlme);
tmp_dfs_to_mlme->mlme_restart_vaps_with_non_dfs_chan =
mlme_dfs_restart_vaps_with_non_dfs_chan;
tmp_dfs_to_mlme->mlme_is_opmode_sta =
@@ -166,8 +183,6 @@ void register_dfs_callbacks(void)
mlme_release_radar_mode_switch_lock;
tmp_dfs_to_mlme->mlme_mark_dfs =
mlme_dfs_mark_dfs;
tmp_dfs_to_mlme->mlme_proc_spoof_success =
mlme_dfs_proc_spoof_success;
/*
* Register precac auto channel switch feature related callbacks
*/

View File

@@ -1922,8 +1922,10 @@ struct wlan_lmac_if_dfs_rx_ops {
QDF_STATUS (*dfs_is_phyerr_filter_offload)(
struct wlan_objmgr_psoc *psoc,
bool *is_phyerr_filter_offload);
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
QDF_STATUS (*dfs_action_on_status)(struct wlan_objmgr_pdev *pdev,
u_int32_t *dfs_status_check);
#endif
QDF_STATUS (*dfs_override_status_timeout)(
struct wlan_objmgr_pdev *pdev,
int status_timeout);

View File

@@ -638,6 +638,19 @@ wlan_lmac_if_mgmt_txrx_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
return wlan_lmac_if_mgmt_rx_reo_rx_ops_register(mgmt_txrx_rx_ops);
}
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
static void dfs_action_on_status_assign(
struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops)
{
dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw;
}
#else
static inline void dfs_action_on_status_assign(
struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops)
{
}
#endif
static QDF_STATUS
wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
{
@@ -678,7 +691,9 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
tgt_dfs_process_phyerr_filter_offload;
dfs_rx_ops->dfs_is_phyerr_filter_offload =
tgt_dfs_is_phyerr_filter_offload;
dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw;
dfs_action_on_status_assign(dfs_rx_ops);
dfs_rx_ops->dfs_override_status_timeout =
ucfg_dfs_set_override_status_timeout;
dfs_rx_ops->dfs_get_override_status_timeout =