diff --git a/umac/dfs/core/src/dfs.h b/umac/dfs/core/src/dfs.h index 24f5a84c9590..ee89cd2b1e20 100644 --- a/umac/dfs/core/src/dfs.h +++ b/umac/dfs/core/src/dfs.h @@ -2773,28 +2773,28 @@ void dfs_deinit_tmp_psoc_nol(struct wlan_dfs *dfs); * dfs_save_dfs_nol_in_psoc() - Save NOL data of given pdev. * @dfs: Pointer to wlan_dfs object. * @pdev_id: The pdev ID which will have the NOL data. - * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id. - * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id. * * Based on the frequency of the NOL channel, copy it to the target pdev_id * structure in psoc. * * Return: void. */ -void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs, - uint8_t pdev_id, - uint16_t low_5ghz_freq, - uint16_t high_5ghz_freq); +void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs, uint8_t pdev_id); /** * dfs_reinit_nol_from_psoc_copy() - Reinit saved NOL data to corresponding * DFS object. * @dfs: Pointer to wlan_dfs object. * @pdev_id: pdev_id of the given dfs object. + * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id. + * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id. * * Return: void. */ -void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, uint8_t pdev_id); +void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, + uint8_t pdev_id, + uint16_t low_5ghz_freq, + uint16_t high_5ghz_freq); /** * dfs_is_hw_mode_switch_in_progress() - Check if HW mode switch in progress. diff --git a/umac/dfs/core/src/misc/dfs_nol.c b/umac/dfs/core/src/misc/dfs_nol.c index eda749ad4c1b..dfece71cbc19 100644 --- a/umac/dfs/core/src/misc/dfs_nol.c +++ b/umac/dfs/core/src/misc/dfs_nol.c @@ -929,14 +929,11 @@ void dfs_deinit_tmp_psoc_nol(struct wlan_dfs *dfs) } void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs, - uint8_t pdev_id, - uint16_t low_5ghz_freq, - uint16_t high_5ghz_freq) + uint8_t pdev_id) { struct dfs_soc_priv_obj *dfs_soc_obj = dfs->dfs_soc_obj; struct dfsreq_nolinfo tmp_nolinfo, *nolinfo; uint32_t i, num_chans = 0; - uint16_t tmp_freq; if (!dfs->dfs_nol_count) return; @@ -951,32 +948,30 @@ void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs, /* nolinfo might already have some data. Do not overwrite it */ num_chans = nolinfo->dfs_ch_nchans; for (i = 0; i < tmp_nolinfo.dfs_ch_nchans; i++) { - tmp_freq = tmp_nolinfo.dfs_nol[i].nol_freq; + /* Figure out the completed duration of each NOL. */ + uint32_t nol_completed_ms = + qdf_system_ticks_to_msecs(qdf_system_ticks() - + tmp_nolinfo.dfs_nol[i].nol_start_ticks); - /* Add to nolinfo only if within the pdev's frequency range. */ - if ((low_5ghz_freq < tmp_freq) && (high_5ghz_freq > tmp_freq)) { - /* Figure out the completed duration of each NOL. */ - uint32_t nol_completed_ms = - qdf_system_ticks_to_msecs(qdf_system_ticks() - - tmp_nolinfo.dfs_nol[i].nol_start_ticks); - - nolinfo->dfs_nol[num_chans] = tmp_nolinfo.dfs_nol[i]; - /* Remember the remaining NOL time in the timeout - * variable. - */ - nolinfo->dfs_nol[num_chans++].nol_timeout_ms -= - nol_completed_ms; - } + nolinfo->dfs_nol[num_chans] = tmp_nolinfo.dfs_nol[i]; + /* Remember the remaining NOL time in the timeout + * variable. + */ + nolinfo->dfs_nol[num_chans++].nol_timeout_ms -= + nol_completed_ms; } nolinfo->dfs_ch_nchans = num_chans; } -void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, uint8_t pdev_id) +void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, + uint8_t pdev_id, + uint16_t low_5ghz_freq, + uint16_t high_5ghz_freq) { struct dfs_soc_priv_obj *dfs_soc_obj = dfs->dfs_soc_obj; - struct dfsreq_nolinfo *nol; - uint8_t i; + struct dfsreq_nolinfo *nol, req_nol; + uint8_t i, j = 0; if (!dfs_soc_obj->dfs_psoc_nolinfo) return; @@ -986,14 +981,22 @@ void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, uint8_t pdev_id) nol = &dfs_soc_obj->dfs_psoc_nolinfo[pdev_id]; - /* The NOL timeout value in each entry points to the remaining time - * of the NOL. This is to indicate that the NOL entries are paused - * and are not left to continue. - * While adding these NOL, update the start ticks to current time - * to avoid losing entries which might have timed out during - * the pause and resume mechanism. - */ - for (i = 0; i < nol->dfs_ch_nchans; i++) - nol->dfs_nol[i].nol_start_ticks = qdf_system_ticks(); - dfs_set_nol(dfs, nol->dfs_nol, nol->dfs_ch_nchans); + for (i = 0; i < nol->dfs_ch_nchans; i++) { + uint16_t tmp_freq = nol->dfs_nol[i].nol_freq; + + /* Add to nol only if within the tgt pdev's frequency range. */ + if ((low_5ghz_freq < tmp_freq) && (high_5ghz_freq > tmp_freq)) { + /* The NOL timeout value in each entry points to the + * remaining time of the NOL. This is to indicate that + * the NOL entries are paused and are not left to + * continue. + * While adding these NOL, update the start ticks to + * current time to avoid losing entries which might + * have timed out during the pause and resume mechanism. + */ + nol->dfs_nol[i].nol_start_ticks = qdf_system_ticks(); + req_nol.dfs_nol[j++] = nol->dfs_nol[i]; + } + } + dfs_set_nol(dfs, req_nol.dfs_nol, j); } diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h index c49a497ae22d..738814b0668e 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h @@ -627,8 +627,6 @@ void tgt_dfs_deinit_tmp_psoc_nol(struct wlan_objmgr_pdev *pdev); * tgt_dfs_save_dfs_nol_in_psoc() - Save NOL data of given pdev. * @pdev: Pointer to pdev object. * @pdev_id: The pdev ID which will have the NOL data. - * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id. - * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id. * * Based on the frequency of the NOL channel, copy it to the target pdev_id * structure in psoc. @@ -636,20 +634,22 @@ void tgt_dfs_deinit_tmp_psoc_nol(struct wlan_objmgr_pdev *pdev); * Return: void. */ void tgt_dfs_save_dfs_nol_in_psoc(struct wlan_objmgr_pdev *pdev, - uint8_t pdev_id, - uint16_t low_5ghz_freq, - uint16_t high_5ghz_freq); + uint8_t pdev_id); /** * tgt_dfs_reinit_nol_from_psoc_copy() - Reinit saved NOL data to corresponding * pdevs. * @pdev: Pointer to pdev object. * @pdev_id: pdev_id of the given pdev. + * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id. + * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id. * * Return: void. */ void tgt_dfs_reinit_nol_from_psoc_copy(struct wlan_objmgr_pdev *pdev, - uint8_t pdev_id); + uint8_t pdev_id, + uint16_t low_5ghz_freq, + uint16_t high_5ghz_freq); /** * tgt_dfs_reinit_precac_lists() - Reinit preCAC lists. diff --git a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c index 577976dad0ea..fd8b888d7e6c 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c @@ -977,9 +977,7 @@ void tgt_dfs_deinit_tmp_psoc_nol(struct wlan_objmgr_pdev *pdev) qdf_export_symbol(tgt_dfs_deinit_tmp_psoc_nol); void tgt_dfs_save_dfs_nol_in_psoc(struct wlan_objmgr_pdev *pdev, - uint8_t pdev_id, - uint16_t low_5ghz_freq, - uint16_t high_5ghz_freq) + uint8_t pdev_id) { struct wlan_dfs *dfs; @@ -989,13 +987,15 @@ void tgt_dfs_save_dfs_nol_in_psoc(struct wlan_objmgr_pdev *pdev, return; } - dfs_save_dfs_nol_in_psoc(dfs, pdev_id, low_5ghz_freq, high_5ghz_freq); + dfs_save_dfs_nol_in_psoc(dfs, pdev_id); } qdf_export_symbol(tgt_dfs_save_dfs_nol_in_psoc); void tgt_dfs_reinit_nol_from_psoc_copy(struct wlan_objmgr_pdev *pdev, - uint8_t pdev_id) + uint8_t pdev_id, + uint16_t low_5ghz_freq, + uint16_t high_5ghz_freq) { struct wlan_dfs *dfs; @@ -1005,7 +1005,10 @@ void tgt_dfs_reinit_nol_from_psoc_copy(struct wlan_objmgr_pdev *pdev, return; } - dfs_reinit_nol_from_psoc_copy(dfs, pdev_id); + dfs_reinit_nol_from_psoc_copy(dfs, + pdev_id, + low_5ghz_freq, + high_5ghz_freq); } qdf_export_symbol(tgt_dfs_reinit_nol_from_psoc_copy); 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 b79e1c419090..57259ab4a0a2 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 @@ -1592,11 +1592,11 @@ struct wlan_lmac_if_dfs_rx_ops { uint8_t num_radios); void (*dfs_deinit_tmp_psoc_nol)(struct wlan_objmgr_pdev *pdev); void (*dfs_save_dfs_nol_in_psoc)(struct wlan_objmgr_pdev *pdev, - uint8_t pdev_id, - uint16_t low_5ghz_freq, - uint16_t high_5ghz_freq); + uint8_t pdev_id); void (*dfs_reinit_nol_from_psoc_copy)(struct wlan_objmgr_pdev *pdev, - uint8_t pdev_id); + uint8_t pdev_id, + uint16_t low_5ghz_freq, + uint16_t high_5ghz_freq); void (*dfs_reinit_precac_lists)(struct wlan_objmgr_pdev *src_pdev, struct wlan_objmgr_pdev *dest_pdev, uint16_t low_5g_freq,