qcacmn: Configure agile preCAC timeout values

Send proper minimum and maximum agile preCAC timeout values to the target
as part of starting agile DFS detector. Add a common agile preCAC
parameter structure with the timeout values, channel and width fields
which are to be sent as part of configuring agile detector.

Change-Id: If5f5b179aa12a6c549cb9a4402aa10e957129d78
CRs-Fixed: 2482929
This commit is contained in:
Vignesh Mohan 2019-07-16 03:06:58 +05:30 • committed by nshrivas
commit a1a1945c1c
5 changed files with 52 additions and 20 deletions

View file

@ -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;
}

View file

@ -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(&param, 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, &param);
if (QDF_IS_STATUS_ERROR(status))

View file

@ -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

View file

@ -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

View file

@ -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);