diff --git a/target_if/dfs/src/target_if_dfs.c b/target_if/dfs/src/target_if_dfs.c index dc1162d1c8..811c18a3eb 100644 --- a/target_if/dfs/src/target_if_dfs.c +++ b/target_if/dfs/src/target_if_dfs.c @@ -213,6 +213,42 @@ static bool target_if_dfs_offload(struct wlan_objmgr_psoc *psoc) wmi_service_dfs_phyerr_offload); } +#ifdef WLAN_FEATURE_11BE +/** + * target_if_dfs_is_radar_found_chan_freq_eq_center_freq: Check whether the + * service of 'radar_found_chan_freq' representing the center frequency of the + * radar segment is supported or not. If the service is not enabled, then + * chan_freq will indicate the channel's primary 20MHz center. + */ +static bool +target_if_dfs_is_radar_found_chan_freq_eq_center_freq( + struct wlan_objmgr_psoc *psoc) +{ + wmi_unified_t wmi_handle; + + wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); + if (!wmi_handle) { + target_if_err("null wmi_handle"); + return false; + } + + /* + * Uncomment the following service as soon as it is ready. + * + * return wmi_service_enabled(wmi_handle, + * wmi_is_radar_found_chan_freq_eq_center_freq); + */ + return false; +} +#else +static bool +target_if_dfs_is_radar_found_chan_freq_eq_center_freq( + struct wlan_objmgr_psoc *psoc) +{ + return false; +} +#endif + static QDF_STATUS target_if_dfs_get_target_type(struct wlan_objmgr_pdev *pdev, uint32_t *target_type) { @@ -402,6 +438,8 @@ QDF_STATUS target_if_register_dfs_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) dfs_tx_ops->dfs_send_avg_radar_params_to_fw = &target_if_dfs_send_avg_params_to_fw; 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; dfs_tx_ops->dfs_send_usenol_pdev_param = &target_send_usenol_pdev_param; diff --git a/umac/dfs/core/src/dfs.h b/umac/dfs/core/src/dfs.h index e7168d6621..9010afd8ec 100644 --- a/umac/dfs/core/src/dfs.h +++ b/umac/dfs/core/src/dfs.h @@ -1056,6 +1056,9 @@ struct dfs_rcac_params { * @dfs_cac_started_chan: CAC started channel. * @dfs_pdev_obj: DFS pdev object. * @dfs_is_offload_enabled: Set if DFS offload enabled. + * @dfs_is_radar_found_chan_freq_eq_center_freq: + * Set if chan_freq parameter of the radar + * found wmi event indicates channel center. * @dfs_agile_precac_freq_mhz: Freq in MHZ configured on Agile DFS engine. * @dfs_use_nol: Use the NOL when radar found(default: TRUE) * @dfs_nol_lock: Lock to protect nol list. @@ -1247,6 +1250,7 @@ struct wlan_dfs { uint16_t dfs_agile_precac_freq_mhz; #endif bool dfs_is_offload_enabled; + bool dfs_is_radar_found_chan_freq_eq_center_freq; int dfs_use_nol; qdf_spinlock_t dfs_nol_lock; uint16_t tx_leakage_threshold; 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 47a100b1cf..1e7ed30652 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 @@ -320,6 +320,14 @@ dfs_compute_radar_found_cfreq(struct wlan_dfs *dfs, { struct dfs_channel *curchan = dfs->dfs_curchan; + /* In case of 11BE Chipsets, radar found center frequency is + * directly obtained from WMI. + */ + if (dfs->dfs_is_radar_found_chan_freq_eq_center_freq) { + *freq_center = radar_found->chan_freq; + return; + } + /* Radar found on agile detector ID. * Applicable to chips that have a separate agile radar detector * engine. 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 11543f8a77..9cd955d221 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c @@ -471,6 +471,20 @@ QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev, dfs->dfs_is_offload_enabled = dfs_tx_ops->dfs_is_tgt_offload(psoc); dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_offload %d", dfs->dfs_is_offload_enabled); + + if (!dfs_tx_ops->dfs_is_tgt_radar_found_chan_freq_eq_center_freq) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, + "dfs_is_radar_found_chan_freq_eq_center_freq is null"); + dfs_destroy_object(dfs); + return QDF_STATUS_E_FAILURE; + } + + dfs->dfs_is_radar_found_chan_freq_eq_center_freq = + dfs_tx_ops->dfs_is_tgt_radar_found_chan_freq_eq_center_freq(psoc); + dfs_info(dfs, WLAN_DEBUG_DFS, + "dfs_is_radar_found_chan_freq_eq_center_freq %d", + dfs->dfs_is_radar_found_chan_freq_eq_center_freq); + dfs_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_DFS); dfs->dfs_soc_obj = dfs_soc_obj; diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index ae6c04ef08..cc720bfebf 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -1028,6 +1028,10 @@ struct wlan_lmac_if_reg_tx_ops { * @dfs_ocac_abort_cmd: Send Off-Channel CAC abort command. * @dfs_is_pdev_5ghz: Check if the given pdev is 5GHz. * @dfs_set_phyerr_filter_offload: Config phyerr filter offload. + * @dfs_is_tgt_radar_found_chan_freq_eq_center_freq: + * Check if chan_freq parameter of the + * radar found wmi event points to channel + * center. * @dfs_send_offload_enable_cmd: Send dfs offload enable command to fw. * @dfs_host_dfs_check_support: To check Host DFS confirmation feature * support. @@ -1075,6 +1079,8 @@ struct wlan_lmac_if_dfs_tx_ops { struct wlan_objmgr_pdev *pdev, bool dfs_phyerr_filter_offload); bool (*dfs_is_tgt_offload)(struct wlan_objmgr_psoc *psoc); + bool (*dfs_is_tgt_radar_found_chan_freq_eq_center_freq) + (struct wlan_objmgr_psoc *psoc); QDF_STATUS (*dfs_send_offload_enable_cmd)( struct wlan_objmgr_pdev *pdev, bool enable);