diff --git a/target_if/dfs/inc/target_if_dfs_full_offload.h b/target_if/dfs/inc/target_if_dfs_full_offload.h index 624aaf57b244..513b8413d987 100644 --- a/target_if/dfs/inc/target_if_dfs_full_offload.h +++ b/target_if/dfs/inc/target_if_dfs_full_offload.h @@ -70,14 +70,16 @@ static QDF_STATUS target_process_bang_radar_cmd(struct wlan_objmgr_pdev *pdev, */ QDF_STATUS target_send_ocac_abort_cmd(struct wlan_objmgr_pdev *pdev); /** - * target_send_agile_ch_cfg_cmd() - Send agile channel to target for + * target_send_agile_ch_cfg_cmd() - Send agile channel parameters to target for * off channel precac. * @pdev: Pointer to DFS pdev object. + * @adfs_param: Agile-DFS CAC parameters. * * Return: QDF_STATUS */ -QDF_STATUS target_send_agile_ch_cfg_cmd(struct wlan_objmgr_pdev *pdev, - uint8_t *ch_freq); +QDF_STATUS +target_send_agile_ch_cfg_cmd(struct wlan_objmgr_pdev *pdev, + struct dfs_agile_cac_params *adfs_param); #else static inline QDF_STATUS target_send_ocac_abort_cmd(struct wlan_objmgr_pdev *pdev) @@ -87,7 +89,7 @@ target_send_ocac_abort_cmd(struct wlan_objmgr_pdev *pdev) static inline QDF_STATUS target_send_agile_ch_cfg_cmd(struct wlan_objmgr_pdev *pdev, - uint8_t *ch_freq) + struct dfs_agile_cac_params *adfs_param) { return QDF_STATUS_SUCCESS; } diff --git a/target_if/dfs/src/target_if_dfs_full_offload.c b/target_if/dfs/src/target_if_dfs_full_offload.c index fa89af33c88b..9c29ce31cb02 100644 --- a/target_if/dfs/src/target_if_dfs_full_offload.c +++ b/target_if/dfs/src/target_if_dfs_full_offload.c @@ -344,7 +344,7 @@ free_vdevref: } QDF_STATUS target_send_agile_ch_cfg_cmd(struct wlan_objmgr_pdev *pdev, - uint8_t *ch_freq) + struct dfs_agile_cac_params *adfs_param) { wmi_unified_t wmi_handle; struct vdev_adfs_ch_cfg_params param; @@ -373,11 +373,11 @@ QDF_STATUS target_send_agile_ch_cfg_cmd(struct wlan_objmgr_pdev *pdev, qdf_mem_set(¶m, sizeof(param), 0); param.vdev_id = wlan_vdev_get_id(vdev); param.ocac_mode = QUICK_OCAC_MODE; - param.min_duration_ms = 60000; - param.max_duration_ms = 0; - param.chan_freq = *ch_freq; - param.chan_width = wlan_vdev_get_ch_width(vdev); - param.center_freq = *ch_freq; + param.min_duration_ms = adfs_param->min_precac_timeout; + param.max_duration_ms = adfs_param->max_precac_timeout; + param.chan_freq = adfs_param->precac_chan; + param.chan_width = adfs_param->precac_chwidth; + param.center_freq = adfs_param->precac_chan; status = wmi_unified_send_vdev_adfs_ch_cfg_cmd(wmi_handle, ¶m); if (QDF_IS_STATUS_ERROR(status)) diff --git a/umac/dfs/core/src/dfs_zero_cac.h b/umac/dfs/core/src/dfs_zero_cac.h index b13294d02b6e..5ddacd109c4c 100644 --- a/umac/dfs/core/src/dfs_zero_cac.h +++ b/umac/dfs/core/src/dfs_zero_cac.h @@ -54,6 +54,15 @@ #define DFS_CHWIDTH_40_VAL 40 #define DFS_CHWIDTH_80_VAL 80 #define DFS_CHWIDTH_160_VAL 160 + +#define WEATHER_CHAN_START 120 +#define WEATHER_CHAN_END 128 + +/* PreCAC timeout durations in ms. */ +#define MIN_PRECAC_DURATION (6 * 60 * 1000) /* 6 mins */ +#define MIN_WEATHER_PRECAC_DURATION (60 * 60 * 1000) /* 1 hour */ +#define MAX_PRECAC_DURATION (4 * 60 * 60 * 1000) /* 4 hours */ +#define MAX_WEATHER_PRECAC_DURATION (24 * 60 * 60 * 1000) /* 24 hours */ /** * struct precac_tree_node - Individual tree node structure for every node in * the precac forest maintained. @@ -434,14 +443,19 @@ void dfs_get_ieeechan_for_agilecac(struct wlan_dfs *dfs, void dfs_agile_precac_start(struct wlan_dfs *dfs); /** - * dfs_start_agile_precac_timer() - Start precac timer. - * @dfs: Pointer to wlan_dfs structure. - * @precac_chan: Start thr precac timer in this channel. + * dfs_start_agile_precac_timer() - Start precac timer for the given channel. + * @dfs: Pointer to wlan_dfs structure. * @ocac_status: Status of the off channel CAC. + * @adfs_param: Agile DFS CAC parameters. + * + * Start the precac timer with proper timeout values based on the channel to + * be preCACed. The preCAC channel number and chwidth information is present + * in the adfs_param argument. Once the timer is started, update the timeout + * fields in adfs_param. */ void dfs_start_agile_precac_timer(struct wlan_dfs *dfs, - uint8_t precac_chan, - uint8_t ocac_status); + uint8_t ocac_status, + struct dfs_agile_cac_params *adfs_param); #else static inline void dfs_find_pdev_for_agile_precac(struct wlan_objmgr_pdev *pdev, uint8_t *cur_precac_dfs_index) @@ -470,9 +484,10 @@ static inline void dfs_agile_precac_start(struct wlan_dfs *dfs) { } -static inline void dfs_start_agile_precac_timer(struct wlan_dfs *dfs, - uint8_t precac_chan, - uint8_t ocac_status) +static inline void +dfs_start_agile_precac_timer(struct wlan_dfs *dfs, + uint8_t ocac_status, + struct dfs_agile_cac_params *adfs_param) { } #endif diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_public_struct.h b/umac/dfs/dispatcher/inc/wlan_dfs_public_struct.h index 5ee103a4ac9e..b27e679fda49 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_public_struct.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_public_struct.h @@ -124,4 +124,18 @@ struct dfs_radar_found_params { u_int32_t sidx_min; u_int32_t sidx_max; }; + +/** + * struct dfs_agile_cac_params - Agile DFS-CAC parameters. + * @precac_chan: Agile preCAC channel. + * @precac_chwidth: Agile preCAC channel width. + * @min_precac_timeout: Minimum agile preCAC timeout. + * @max_precac_timeout: Maximum agile preCAC timeout. + */ +struct dfs_agile_cac_params { + uint8_t precac_chan; + enum phy_ch_width precac_chwidth; + uint32_t min_precac_timeout; + uint32_t max_precac_timeout; +}; #endif 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 c1266a7f8ed0..327443a16838 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 @@ -755,8 +755,9 @@ struct wlan_lmac_if_dfs_tx_ops { QDF_STATUS (*dfs_process_emulate_bang_radar_cmd)( struct wlan_objmgr_pdev *pdev, struct dfs_emulate_bang_radar_test_cmd *dfs_unit_test); - QDF_STATUS (*dfs_agile_ch_cfg_cmd)(struct wlan_objmgr_pdev *pdev, - uint8_t *ch_freq); + QDF_STATUS (*dfs_agile_ch_cfg_cmd)( + struct wlan_objmgr_pdev *pdev, + struct dfs_agile_cac_params *adfs_params); QDF_STATUS (*dfs_ocac_abort_cmd)(struct wlan_objmgr_pdev *pdev); QDF_STATUS (*dfs_is_pdev_5ghz)(struct wlan_objmgr_pdev *pdev, bool *is_5ghz);