|
@@ -458,83 +458,6 @@ void dfs_get_nol(struct wlan_dfs *dfs,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_CHAN_FREQ_API
|
|
|
|
-void dfs_set_nol(struct wlan_dfs *dfs,
|
|
|
|
- struct dfsreq_nolelem *dfs_nol,
|
|
|
|
- int nchan)
|
|
|
|
-{
|
|
|
|
-#define TIME_IN_MS 1000
|
|
|
|
- uint32_t nol_time_lft_ms;
|
|
|
|
- struct dfs_channel chan;
|
|
|
|
- int i;
|
|
|
|
-
|
|
|
|
- if (!dfs) {
|
|
|
|
- dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (i = 0; i < nchan; i++) {
|
|
|
|
- nol_time_lft_ms = qdf_do_div(qdf_get_monotonic_boottime() -
|
|
|
|
- dfs_nol[i].nol_start_us, 1000);
|
|
|
|
-
|
|
|
|
- if (nol_time_lft_ms < dfs_nol[i].nol_timeout_ms) {
|
|
|
|
- chan.dfs_ch_freq = dfs_nol[i].nol_freq;
|
|
|
|
- chan.dfs_ch_flags = 0;
|
|
|
|
- chan.dfs_ch_flagext = 0;
|
|
|
|
- nol_time_lft_ms =
|
|
|
|
- (dfs_nol[i].nol_timeout_ms - nol_time_lft_ms);
|
|
|
|
-
|
|
|
|
- DFS_NOL_ADD_CHAN_LOCKED(dfs, chan.dfs_ch_freq,
|
|
|
|
- (nol_time_lft_ms / TIME_IN_MS));
|
|
|
|
- utils_dfs_reg_update_nol_chan_for_freq(dfs->dfs_pdev_obj,
|
|
|
|
- &chan.dfs_ch_freq,
|
|
|
|
- 1, DFS_NOL_SET);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-#undef TIME_IN_MS
|
|
|
|
- dfs_nol_update(dfs);
|
|
|
|
-}
|
|
|
|
-#else
|
|
|
|
-#ifdef CONFIG_CHAN_NUM_API
|
|
|
|
-void dfs_set_nol(struct wlan_dfs *dfs,
|
|
|
|
- struct dfsreq_nolelem *dfs_nol,
|
|
|
|
- int nchan)
|
|
|
|
-{
|
|
|
|
-#define TIME_IN_MS 1000
|
|
|
|
- uint32_t nol_time_left_ms;
|
|
|
|
- struct dfs_channel chan;
|
|
|
|
- int i;
|
|
|
|
- uint8_t chan_num;
|
|
|
|
-
|
|
|
|
- if (!dfs) {
|
|
|
|
- dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (i = 0; i < nchan; i++) {
|
|
|
|
- nol_time_left_ms = qdf_do_div(qdf_get_monotonic_boottime() -
|
|
|
|
- dfs_nol[i].nol_start_us, 1000);
|
|
|
|
-
|
|
|
|
- if (nol_time_left_ms < dfs_nol[i].nol_timeout_ms) {
|
|
|
|
- chan.dfs_ch_freq = dfs_nol[i].nol_freq;
|
|
|
|
- chan.dfs_ch_flags = 0;
|
|
|
|
- chan.dfs_ch_flagext = 0;
|
|
|
|
- nol_time_left_ms =
|
|
|
|
- (dfs_nol[i].nol_timeout_ms - nol_time_left_ms);
|
|
|
|
-
|
|
|
|
- DFS_NOL_ADD_CHAN_LOCKED(dfs, chan.dfs_ch_freq,
|
|
|
|
- (nol_time_left_ms / TIME_IN_MS));
|
|
|
|
- chan_num = utils_dfs_freq_to_chan(chan.dfs_ch_freq);
|
|
|
|
- utils_dfs_reg_update_nol_ch(dfs->dfs_pdev_obj,
|
|
|
|
- &chan_num, 1, DFS_NOL_SET);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-#undef TIME_IN_MS
|
|
|
|
- dfs_nol_update(dfs);
|
|
|
|
-}
|
|
|
|
-#endif
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
void dfs_nol_addchan(struct wlan_dfs *dfs,
|
|
void dfs_nol_addchan(struct wlan_dfs *dfs,
|
|
uint16_t freq,
|
|
uint16_t freq,
|
|
uint32_t dfs_nol_timeout)
|
|
uint32_t dfs_nol_timeout)
|
|
@@ -970,105 +893,3 @@ void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
-
|
|
|
|
-void dfs_init_tmp_psoc_nol(struct wlan_dfs *dfs, uint8_t num_radios)
|
|
|
|
-{
|
|
|
|
- struct dfs_soc_priv_obj *dfs_soc_obj = dfs->dfs_soc_obj;
|
|
|
|
-
|
|
|
|
- if (WLAN_UMAC_MAX_PDEVS < num_radios) {
|
|
|
|
- dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
|
|
|
- "num_radios (%u) exceeds limit", num_radios);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /* Allocate the temporary psoc NOL copy structure for the number
|
|
|
|
- * of radios provided.
|
|
|
|
- */
|
|
|
|
- dfs_soc_obj->dfs_psoc_nolinfo =
|
|
|
|
- qdf_mem_malloc(sizeof(struct dfsreq_nolinfo) * num_radios);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void dfs_deinit_tmp_psoc_nol(struct wlan_dfs *dfs)
|
|
|
|
-{
|
|
|
|
- struct dfs_soc_priv_obj *dfs_soc_obj = dfs->dfs_soc_obj;
|
|
|
|
-
|
|
|
|
- if (!dfs_soc_obj->dfs_psoc_nolinfo)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- qdf_mem_free(dfs_soc_obj->dfs_psoc_nolinfo);
|
|
|
|
- dfs_soc_obj->dfs_psoc_nolinfo = NULL;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs,
|
|
|
|
- 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;
|
|
|
|
-
|
|
|
|
- if (!dfs->dfs_nol_count)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- if (!dfs_soc_obj->dfs_psoc_nolinfo)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- nolinfo = &dfs_soc_obj->dfs_psoc_nolinfo[pdev_id];
|
|
|
|
- /* Fetch the NOL entries for the DFS object. */
|
|
|
|
- dfs_getnol(dfs, &tmp_nolinfo);
|
|
|
|
-
|
|
|
|
- /* 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++) {
|
|
|
|
- /* Figure out the completed duration of each NOL. */
|
|
|
|
- uint32_t nol_completed_ms = qdf_do_div(
|
|
|
|
- qdf_get_monotonic_boottime() -
|
|
|
|
- tmp_nolinfo.dfs_nol[i].nol_start_us, 1000);
|
|
|
|
-
|
|
|
|
- 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,
|
|
|
|
- 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, req_nol;
|
|
|
|
- uint8_t i, j = 0;
|
|
|
|
-
|
|
|
|
- if (!dfs_soc_obj->dfs_psoc_nolinfo)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- if (!dfs_soc_obj->dfs_psoc_nolinfo[pdev_id].dfs_ch_nchans)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- nol = &dfs_soc_obj->dfs_psoc_nolinfo[pdev_id];
|
|
|
|
-
|
|
|
|
- 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_us =
|
|
|
|
- qdf_get_monotonic_boottime();
|
|
|
|
- req_nol.dfs_nol[j++] = nol->dfs_nol[i];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- dfs_set_nol(dfs, req_nol.dfs_nol, j);
|
|
|
|
-}
|
|
|