From 2220048ec2992c0194bdcde9935d0b1ca740e252 Mon Sep 17 00:00:00 2001 From: Vignesh Mohan Date: Mon, 14 Oct 2019 10:58:17 +0530 Subject: [PATCH] qcacmn: enable the NOL channels in regulatory after NOL reset Before mode switch command is sent to firmware, the NOL channels are reset. But the regulatory channel structure for these corresponding channels are still disabled. After mode switch response, when the new umac channel list is built, these channels are still marked as disabled in regulatory, which results in the umac channel list not having these channels at all. Re-enable the NOL channels in the regulatory channel list after NOL reset. Change-Id: Ifad8ec7a5be53e061045c068f9a6bfc313d4985c CRs-Fixed: 2580403 --- umac/dfs/core/src/misc/dfs_nol.c | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/umac/dfs/core/src/misc/dfs_nol.c b/umac/dfs/core/src/misc/dfs_nol.c index b2a9831e9ae0..31f096c299e8 100644 --- a/umac/dfs/core/src/misc/dfs_nol.c +++ b/umac/dfs/core/src/misc/dfs_nol.c @@ -680,9 +680,11 @@ void dfs_nol_free_list(struct wlan_dfs *dfs) dfs->dfs_nol = NULL; } +#ifdef CONFIG_CHAN_FREQ_API void dfs_nol_timer_cleanup(struct wlan_dfs *dfs) { struct dfs_nolelem *nol; + uint16_t nol_freq; while (true) { WLAN_DFSNOL_LOCK(dfs); @@ -691,7 +693,13 @@ void dfs_nol_timer_cleanup(struct wlan_dfs *dfs) if (nol) { dfs->dfs_nol = nol->nol_next; dfs->dfs_nol_count--; + nol_freq = nol->nol_freq; WLAN_DFSNOL_UNLOCK(dfs); + utils_dfs_reg_update_nol_chan_for_freq( + dfs->dfs_pdev_obj, + &nol_freq, + 1, + DFS_NOL_RESET); qdf_timer_free(&nol->nol_timer); qdf_mem_free(nol); @@ -701,6 +709,37 @@ void dfs_nol_timer_cleanup(struct wlan_dfs *dfs) } } } +#else +#ifdef CONFIG_CHAN_NUM_API +void dfs_nol_timer_cleanup(struct wlan_dfs *dfs) +{ + struct dfs_nolelem *nol; + uint8_t nol_chan; + + while (true) { + WLAN_DFSNOL_LOCK(dfs); + + nol = dfs->dfs_nol; + if (nol) { + dfs->dfs_nol = nol->nol_next; + dfs->dfs_nol_count--; + nol_chan = utils_dfs_freq_to_chan(nol->nol_freq); + WLAN_DFSNOL_UNLOCK(dfs); + utils_dfs_reg_update_nol_ch(dfs->dfs_pdev_obj, + &nol_chan, + 1, + DFS_NOL_RESET); + + qdf_timer_free(&nol->nol_timer); + qdf_mem_free(nol); + } else { + WLAN_DFSNOL_UNLOCK(dfs); + break; + } + } +} +#endif +#endif void dfs_nol_workqueue_cleanup(struct wlan_dfs *dfs) {