From 8785b9dd692a00552f3155c899e866485959c829 Mon Sep 17 00:00:00 2001 From: Vignesh U Date: Fri, 20 Apr 2018 22:01:25 +0530 Subject: [PATCH] qcacmn: Process host DFS confirmation status from firmware Process firmware status event on radar found and take necessary actions. Change-Id: I7ddb2b1a45e97a4ea52eb9b2d718f467726aad04 CRs-Fixed: 2211883 --- umac/dfs/core/src/dfs.h | 33 +++++++ umac/dfs/core/src/dfs_partial_offload_radar.h | 59 ++++++++++- .../core/src/dfs_process_radar_found_ind.h | 12 +++ .../src/filtering/dfs_partial_offload_radar.c | 98 +++++++++++++++++++ .../core/src/filtering/dfs_process_phyerr.c | 5 + umac/dfs/core/src/misc/dfs_nol.c | 30 ++++++ .../src/misc/dfs_process_radar_found_ind.c | 6 +- umac/dfs/dispatcher/inc/wlan_dfs_lmac_api.h | 16 +++ umac/dfs/dispatcher/inc/wlan_dfs_mlme_api.h | 36 ++++++- umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h | 42 ++++++++ umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h | 9 ++ umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h | 18 ++++ .../dispatcher/src/wlan_dfs_init_deinit_api.c | 4 + umac/dfs/dispatcher/src/wlan_dfs_lmac_api.c | 17 ++++ umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c | 22 +++++ umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c | 51 ++++++++++ umac/dfs/dispatcher/src/wlan_dfs_utils_api.c | 20 ++++ 17 files changed, 473 insertions(+), 5 deletions(-) diff --git a/umac/dfs/core/src/dfs.h b/umac/dfs/core/src/dfs.h index 1f7d294b524d..4d387538d715 100644 --- a/umac/dfs/core/src/dfs.h +++ b/umac/dfs/core/src/dfs.h @@ -1118,6 +1118,24 @@ enum { WLAN_DEBUG_DFS_ALWAYS = WLAN_DEBUG_DFS_MAX }; +/** + * enum host dfs spoof check status. + * @HOST_DFS_CHECK_PASSED: Host indicates RADAR detected and the FW + * confirms it to be spoof radar to host. + * @HOST_DFS_CHECK_FAILED: Host doesn't indicate RADAR detected or spoof + * radar parameters by + * WMI_HOST_DFS_RADAR_FOUND_CMDID doesn't match. + * @HOST_DFS_STATUS_CHECK_HW_RADAR: Host indicates RADAR detected and the + * FW confirms it to be real HW radar to host. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +enum { + HOST_DFS_STATUS_CHECK_PASSED = 0, + HOST_DFS_STATUS_CHECK_FAILED = 1, + HOST_DFS_STATUS_CHECK_HW_RADAR = 2 +}; +#endif + /** * struct dfs_phy_err - DFS phy error. * @fulltsf: 64-bit TSF as read from MAC. @@ -1617,6 +1635,21 @@ void dfs_reset_ar(struct wlan_dfs *dfs); */ void dfs_reset_arq(struct wlan_dfs *dfs); +/** + * dfs_is_radar_enabled() - check if radar detection is enabled. + * @dfs: Pointer to wlan_dfs structure. + * @ignore_dfs: if 1 then radar detection is disabled.. + */ +#if defined(WLAN_DFS_DIRECT_ATTACH) || defined(WLAN_DFS_PARTIAL_OFFLOAD) +void dfs_is_radar_enabled(struct wlan_dfs *dfs, + int *ignore_dfs); +#else +static inline void dfs_is_radar_enabled(struct wlan_dfs *dfs, + int *ignore_dfs) +{ +} +#endif + /** * dfs_process_phyerr_bb_tlv() - Parses the PHY error and populates the * dfs_phy_err struct. diff --git a/umac/dfs/core/src/dfs_partial_offload_radar.h b/umac/dfs/core/src/dfs_partial_offload_radar.h index 6a03a2809361..012f4275cb7b 100644 --- a/umac/dfs/core/src/dfs_partial_offload_radar.h +++ b/umac/dfs/core/src/dfs_partial_offload_radar.h @@ -32,7 +32,7 @@ #if defined(WLAN_DFS_PARTIAL_OFFLOAD) void dfs_get_po_radars(struct wlan_dfs *dfs); #else -static void dfs_get_po_radars(struct wlan_dfs *dfs) +static inline void dfs_get_po_radars(struct wlan_dfs *dfs) { } #endif @@ -123,4 +123,61 @@ static inline void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, { } #endif + +/** + * dfs_host_wait_timer_reset() - Stop dfs host wait timer. + * @dfs: Pointer to wlan_dfs structure. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +void dfs_host_wait_timer_reset(struct wlan_dfs *dfs); +#else +static inline void dfs_host_wait_timer_reset(struct wlan_dfs *dfs) +{ +} +#endif + +/** + * dfs_remove_spoof_channel_from_nol() - Remove the spoofed radar hit channel + * from NOL. + * @dfs: Pointer to wlan_dfs structure. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs); +#else +static inline void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs) +{ +} +#endif + +/** + * dfs_reset_spoof_test() - reset the spoof test variables. + * @dfs: Pointer to wlan_dfs structure. + * + * Return: None. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +void dfs_reset_spoof_test(struct wlan_dfs *dfs); +#else +static inline void dfs_reset_spoof_test(struct wlan_dfs *dfs) +{ +} +#endif + +/** + * dfs_action_on_fw_radar_status_check() - The dfs action on host dfs + * confirmation by fw. + * @dfs: Pointer to wlan_dfs structure. + * @status: pointer to host dfs status. + * + * Return: None + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs, + uint32_t *status); +#else +static inline void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs, + uint32_t *status) +{ +} +#endif #endif /* _DFS_PARTIAL_OFFLOAD_RADAR_H_ */ diff --git a/umac/dfs/core/src/dfs_process_radar_found_ind.h b/umac/dfs/core/src/dfs_process_radar_found_ind.h index b2346fee9406..d53f893984fb 100644 --- a/umac/dfs/core/src/dfs_process_radar_found_ind.h +++ b/umac/dfs/core/src/dfs_process_radar_found_ind.h @@ -132,3 +132,15 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs, */ void dfs_radarfound_action_generic(struct wlan_dfs *dfs, uint8_t seg_id, int false_radar_found); + +/** + * dfs_get_bonding_channels() - Get bonding channels. + * @curchan: Pointer to dfs_channels to know width and primary channel. + * @segment_id: Segment id, useful for 80+80/160 MHz operating band. + * @channels: Pointer to save radar affected channels. + * + * Return: Number of channels. + */ +uint8_t dfs_get_bonding_channels(struct dfs_channel *curchan, + uint32_t segment_id, + uint8_t *channels); diff --git a/umac/dfs/core/src/filtering/dfs_partial_offload_radar.c b/umac/dfs/core/src/filtering/dfs_partial_offload_radar.c index 37696181e041..ba44f4955506 100644 --- a/umac/dfs/core/src/filtering/dfs_partial_offload_radar.c +++ b/umac/dfs/core/src/filtering/dfs_partial_offload_radar.c @@ -549,3 +549,101 @@ void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, uint8_t seg_id, -1) ? HOST_DFS_STATUS_WAIT_TIMER_MS : dfs->dfs_status_timeout_override); } + +void dfs_host_wait_timer_reset(struct wlan_dfs *dfs) +{ + dfs->dfs_is_host_wait_running = 0; + qdf_timer_stop(&dfs->dfs_host_wait_timer); +} + +/** + * dfs_action_on_spoof_success() - DFS action on spoof test pass + * @dfs: Pointer to DFS object + */ +static void dfs_action_on_spoof_success(struct wlan_dfs *dfs) +{ + dfs->dfs_spoof_test_done = 1; + if (dfs->dfs_radar_found_chan.dfs_ch_freq == + dfs->dfs_curchan->dfs_ch_freq) { + dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, + "cac timer started for channel %d", + dfs->dfs_curchan->dfs_ch_ieee); + dfs_start_cac_timer(dfs); + } else{ + dfs_remove_spoof_channel_from_nol(dfs); + } +} + +void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs, + uint32_t *status) +{ + struct wlan_objmgr_pdev *dfs_pdev; + int no_chans_avail = 0; + int error_flag = 0; + + dfs_host_wait_timer_reset(dfs); + dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "Host DFS status = %d", + *status); + + dfs_pdev = dfs->dfs_pdev_obj; + if (!dfs_pdev) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_pdev_obj is NULL"); + return; + } + + switch (*status) { + case HOST_DFS_STATUS_CHECK_PASSED: + if (dfs->dfs_average_params_sent) + dfs_action_on_spoof_success(dfs); + else + error_flag = 1; + break; + case HOST_DFS_STATUS_CHECK_FAILED: + dfs->dfs_spoof_check_failed = 1; + no_chans_avail = + dfs_mlme_rebuild_chan_list_with_non_dfs_channels(dfs_pdev); + dfs_mlme_restart_vaps_with_non_dfs_chan(dfs_pdev, + no_chans_avail); + break; + case HOST_DFS_STATUS_CHECK_HW_RADAR: + if (dfs->dfs_average_params_sent) { + if (dfs->dfs_radar_found_chan.dfs_ch_freq == + dfs->dfs_curchan->dfs_ch_freq) { + dfs_radarfound_action_generic( + dfs, + dfs->dfs_seg_id, + dfs->dfs_false_radar_found); + } else { + /* Else of this case, no action is needed as + * dfs_action would have been done at timer + * expiry itself. + */ + dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, + "DFS Action already taken"); + } + } else { + error_flag = 1; + } + break; + default: + dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, + "Status event mismatch:%d, Ignoring it", + *status); + } + + dfs->dfs_average_params_sent = 0; + qdf_mem_zero(&dfs->dfs_radar_found_chan, sizeof(struct dfs_channel)); + + if (error_flag == 1) { + dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, + "Received imroper response %d. Discarding it", + *status); + } +} + +void dfs_reset_spoof_test(struct wlan_dfs *dfs) +{ + dfs->dfs_spoof_test_done = 0; + dfs->dfs_spoof_check_failed = 0; +} +#endif diff --git a/umac/dfs/core/src/filtering/dfs_process_phyerr.c b/umac/dfs/core/src/filtering/dfs_process_phyerr.c index d5afc16935f0..5ea9e5454077 100644 --- a/umac/dfs/core/src/filtering/dfs_process_phyerr.c +++ b/umac/dfs/core/src/filtering/dfs_process_phyerr.c @@ -981,3 +981,8 @@ void dfs_process_phyerr_filter_offload(struct wlan_dfs *dfs, } } #endif + +void dfs_is_radar_enabled(struct wlan_dfs *dfs, int *ignore_dfs) +{ + *ignore_dfs = dfs->dfs_ignore_dfs; +} diff --git a/umac/dfs/core/src/misc/dfs_nol.c b/umac/dfs/core/src/misc/dfs_nol.c index a56c56b4110d..87b334b3092c 100644 --- a/umac/dfs/core/src/misc/dfs_nol.c +++ b/umac/dfs/core/src/misc/dfs_nol.c @@ -34,6 +34,10 @@ #include #include #include +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +#include "../dfs_process_radar_found_ind.h" +#include "../dfs_partial_offload_radar.h" +#endif /** * dfs_nol_timeout() - NOL timeout function. @@ -585,3 +589,29 @@ void dfs_clear_nolhistory(struct wlan_dfs *dfs) WLAN_CHAN_CLR_HISTORY_RADAR(c); } } + +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs) +{ + struct dfs_nolelem *nol; + uint8_t channels[NUM_CHANNELS_160MHZ]; + int i, nchans = 0; + + nchans = dfs_get_bonding_channels(&dfs->dfs_radar_found_chan, 0, + channels); + + WLAN_DFSNOL_LOCK(dfs); + for (i = 0; i < nchans && i < NUM_CHANNELS_160MHZ; i++) { + nol = dfs->dfs_nol; + while (nol) { + if (nol->nol_freq == (uint16_t)utils_dfs_chan_to_freq( + channels[i])) { + OS_SET_TIMER(&nol->nol_timer, 0); + break; + } + nol = nol->nol_next; + } + } + WLAN_DFSNOL_UNLOCK(dfs); +} +#endif diff --git a/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c b/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c index af8155f6e5f3..8819305e95fd 100644 --- a/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c +++ b/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c @@ -366,9 +366,9 @@ static uint8_t dfs_find_radar_affected_subchans(struct wlan_dfs *dfs, * * Return: Number of channels. */ -static uint8_t dfs_get_bonding_channels(struct dfs_channel *curchan, - uint32_t segment_id, - uint8_t *channels) +uint8_t dfs_get_bonding_channels(struct dfs_channel *curchan, + uint32_t segment_id, + uint8_t *channels) { uint8_t center_chan; uint8_t nchannels = 0; diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_lmac_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_lmac_api.h index d8a5ef916c57..38bbc22268e6 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_lmac_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_lmac_api.h @@ -116,4 +116,20 @@ uint32_t lmac_get_target_type(struct wlan_objmgr_pdev *pdev); uint32_t lmac_get_phymode_info(struct wlan_objmgr_pdev *pdev, uint32_t chan_mode); +/** + * lmac_is_host_dfs_check_support_enabled() - Check if Host DFS confirmation + * feature is supported. + * @pdev: Pointer to PDEV structure. + * + * Return: true, host dfs check supported, else false. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +bool lmac_is_host_dfs_check_support_enabled(struct wlan_objmgr_pdev *pdev); +#else +static inline bool lmac_is_host_dfs_check_support_enabled( + struct wlan_objmgr_pdev *pdev) +{ + return false; +} +#endif #endif /* _WLAN_DFS_LMAC_API_H_ */ diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_mlme_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_mlme_api.h index 750332f30a9f..ed81d676da36 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_mlme_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_mlme_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -221,4 +221,38 @@ int dfs_mlme_get_cac_timeout(struct wlan_objmgr_pdev *pdev, uint8_t dfs_ch_vhtop_ch_freq_seg2, uint64_t dfs_ch_flags); +/** + * dfs_mlme_rebuild_chan_list_with_non_dfs_channels() - Rebuild the channel list + * with only non DFS channels. + * @pdev: Pointer to DFS pdev object. + * + * return: On success return 1 or 0, else failure. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +int dfs_mlme_rebuild_chan_list_with_non_dfs_channels( + struct wlan_objmgr_pdev *pdev); +#else +static inline int dfs_mlme_rebuild_chan_list_with_non_dfs_channels( + struct wlan_objmgr_pdev *pdev) +{ + return 0; +} +#endif + +/** + * dfs_mlme_restart_vaps_with_non_dfs_chan() - Restart vaps with non DFS + * channels + * @pdev: Pointer to DFS pdev object. + * @no_chans_avail: Indicates if no channel is available. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +void dfs_mlme_restart_vaps_with_non_dfs_chan(struct wlan_objmgr_pdev *pdev, + int no_chans_avail); +#else +static inline +void dfs_mlme_restart_vaps_with_non_dfs_chan(struct wlan_objmgr_pdev *pdev, + int no_chans_avail) +{ +} +#endif #endif /* _WLAN_DFS_MLME_API_H_ */ diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h index 80bcca44480c..04ce38338afb 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h @@ -298,4 +298,46 @@ tgt_dfs_send_avg_params_to_fw(struct wlan_objmgr_pdev *pdev, struct dfs_radar_found_params *params); #endif +/** + * tgt_dfs_action_on_status_from_fw() - trigger the action to be taken based on + * host dfs status received from fw. + * @pdev: Pointer to pdev object. + * @status: Pointer to the host dfs status received from fw. + * + * Return: QDF_STATUS + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +QDF_STATUS tgt_dfs_action_on_status_from_fw(struct wlan_objmgr_pdev *pdev, + uint32_t *status); +#else +static inline +QDF_STATUS tgt_dfs_action_on_status_from_fw(struct wlan_objmgr_pdev *pdev, + uint32_t *status) +{ + return QDF_STATUS_SUCCESS; +} +#endif + +/** + * tgt_dfs_is_radar_enabled() - checks if radar detection is enabled. + * @pdev: Pointer to pdev object. + * @ignore_dfs: Pointer to check the value. If 1, radar detection is disabled. + */ +void tgt_dfs_is_radar_enabled(struct wlan_objmgr_pdev *pdev, int *ignore_dfs); + +/** + * tgt_dfs_reset_spoof_test() - reset the dfs spoof check variables + * @pdev: Pointer to pdev object. + * + * Return: QDF_STATUS + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +QDF_STATUS tgt_dfs_reset_spoof_test(struct wlan_objmgr_pdev *pdev); +#else +static inline +QDF_STATUS tgt_dfs_reset_spoof_test(struct wlan_objmgr_pdev *pdev) +{ + return QDF_STATUS_SUCCESS; +} +#endif #endif /* _WLAN_DFS_TGT_API_H_ */ diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h index cf85d5aa8c6c..cbe70e933cbf 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h @@ -52,6 +52,9 @@ * @mlme_nol_timeout_notification: NOL timeout notification. * @mlme_clist_update: Updates the channel list. * @mlme_get_cac_timeout: Gets the CAC timeout. + * @mlme_rebuild_chan_list_with_non_dfs_channel: Rebuild channels with non-dfs + * channels. + * @mlme_restart_vaps_with_non_dfs_chan: Restart vaps with non-dfs channel. */ struct dfs_to_mlme { QDF_STATUS (*pdev_component_obj_attach)(struct wlan_objmgr_pdev *pdev, @@ -128,6 +131,12 @@ struct dfs_to_mlme { uint8_t c_vhtop_ch_freq_seg2, uint64_t dfs_ch_flags, int *cac_timeout); +#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); + QDF_STATUS (*mlme_restart_vaps_with_non_dfs_chan) + (struct wlan_objmgr_pdev *pdev, int no_chans_avail); +#endif }; extern struct dfs_to_mlme global_dfs_to_mlme; diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h index e36b7aa4b5f2..4171ab1cb5f7 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h @@ -452,4 +452,22 @@ int utils_get_dfsdomain(struct wlan_objmgr_pdev *pdev); */ uint16_t utils_dfs_get_cur_rd(struct wlan_objmgr_pdev *pdev); +/** + * utils_dfs_is_spoof_check_failed() - get spoof check status. + * @pdev: pdev ptr + * @is_spoof_check_failed: pointer containing the status. + * + * Return: QDF_STATUS. + */ +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev, + bool *is_spoof_check_failed); +#else +static inline +QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev, + bool *is_spoof_check_failed) +{ + return QDF_STATUS_SUCCESS; +} +#endif #endif /* _WLAN_DFS_UTILS_API_H_ */ diff --git a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c index 449630b5a868..7203b873e96c 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c @@ -80,6 +80,10 @@ void register_dfs_callbacks(void) mlme_dfs_nol_timeout_notification; tmp_dfs_to_mlme->mlme_clist_update = mlme_dfs_clist_update; tmp_dfs_to_mlme->mlme_get_cac_timeout = mlme_dfs_get_cac_timeout; + 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_restart_vaps_with_non_dfs_chan = + mlme_dfs_restart_vaps_with_non_dfs_chan; } #else void register_dfs_callbacks(void) diff --git a/umac/dfs/dispatcher/src/wlan_dfs_lmac_api.c b/umac/dfs/dispatcher/src/wlan_dfs_lmac_api.c index 63f78ea8c179..58b93b85b71e 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_lmac_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_lmac_api.c @@ -209,3 +209,20 @@ uint32_t lmac_get_phymode_info(struct wlan_objmgr_pdev *pdev, return mode_info; } + +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +bool lmac_is_host_dfs_check_support_enabled(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_objmgr_psoc *psoc; + struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops; + bool enabled = false; + + psoc = wlan_pdev_get_psoc(pdev); + dfs_tx_ops = &psoc->soc_cb.tx_ops.dfs_tx_ops; + + if (dfs_tx_ops->dfs_host_dfs_check_support) + dfs_tx_ops->dfs_host_dfs_check_support(pdev, &enabled); + + return enabled; +} +#endif diff --git a/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c b/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c index 2986ad92fe31..51bc004ead34 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c @@ -295,3 +295,25 @@ int dfs_mlme_get_cac_timeout(struct wlan_objmgr_pdev *pdev, return cac_timeout; } + +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +int dfs_mlme_rebuild_chan_list_with_non_dfs_channels( + struct wlan_objmgr_pdev *pdev) +{ + if (!global_dfs_to_mlme.mlme_rebuild_chan_list_with_non_dfs_channels) + return 1; + + return global_dfs_to_mlme.mlme_rebuild_chan_list_with_non_dfs_channels( + pdev); +} + +void dfs_mlme_restart_vaps_with_non_dfs_chan(struct wlan_objmgr_pdev *pdev, + int no_chans_avail) +{ + if (!global_dfs_to_mlme.mlme_restart_vaps_with_non_dfs_chan) + return; + + global_dfs_to_mlme.mlme_restart_vaps_with_non_dfs_chan(pdev, + no_chans_avail); +} +#endif diff --git a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c index 561454163444..c8f9a7d1dab3 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c @@ -30,6 +30,7 @@ #include "../../core/src/dfs_zero_cac.h" #include "../../core/src/dfs_process_radar_found_ind.h" #include +#include "../../core/src/dfs_partial_offload_radar.h" struct wlan_lmac_if_dfs_tx_ops * wlan_psoc_get_dfs_txops(struct wlan_objmgr_psoc *psoc) @@ -106,6 +107,21 @@ QDF_STATUS tgt_dfs_radar_enable(struct wlan_objmgr_pdev *pdev, } qdf_export_symbol(tgt_dfs_radar_enable); +void tgt_dfs_is_radar_enabled(struct wlan_objmgr_pdev *pdev, int *ignore_dfs) +{ + struct wlan_dfs *dfs; + + dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev); + if (!dfs) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL"); + return; + } + + dfs_is_radar_enabled(dfs, ignore_dfs); +} + +qdf_export_symbol(tgt_dfs_is_radar_enabled); + QDF_STATUS tgt_dfs_process_phyerr(struct wlan_objmgr_pdev *pdev, void *buf, uint16_t datalen, @@ -485,4 +501,39 @@ tgt_dfs_send_avg_params_to_fw(struct wlan_objmgr_pdev *pdev, } qdf_export_symbol(tgt_dfs_send_avg_params_to_fw); + +QDF_STATUS tgt_dfs_action_on_status_from_fw(struct wlan_objmgr_pdev *pdev, + uint32_t *status) +{ + struct wlan_dfs *dfs; + + dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev); + if (!dfs) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL"); + return QDF_STATUS_E_FAILURE; + } + + dfs_action_on_fw_radar_status_check(dfs, status); + + return QDF_STATUS_SUCCESS; +} + +qdf_export_symbol(tgt_dfs_action_on_status_from_fw); + +QDF_STATUS tgt_dfs_reset_spoof_test(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_dfs *dfs; + + dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev); + if (!dfs) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL"); + return QDF_STATUS_E_FAILURE; + } + + dfs_reset_spoof_test(dfs); + + return QDF_STATUS_SUCCESS; +} + +qdf_export_symbol(tgt_dfs_reset_spoof_test); #endif diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c index 04fcfe2457e0..04bcd2f62910 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c @@ -889,3 +889,23 @@ uint16_t utils_dfs_get_cur_rd(struct wlan_objmgr_pdev *pdev) return cur_regdmn.regdmn_pair_id; } + +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST) +QDF_STATUS utils_dfs_is_spoof_check_failed(struct wlan_objmgr_pdev *pdev, + bool *is_spoof_check_failed) +{ + struct wlan_dfs *dfs; + + dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev); + if (!dfs) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "null dfs"); + return QDF_STATUS_E_FAILURE; + } + + *is_spoof_check_failed = dfs->dfs_spoof_check_failed; + + return QDF_STATUS_SUCCESS; +} + +qdf_export_symbol(utils_dfs_is_spoof_check_failed); +#endif