From ab2a46185c28d1dd449b0725595e389f5d629fad Mon Sep 17 00:00:00 2001 From: Priyadarshnee S Date: Mon, 4 Mar 2019 14:52:49 +0530 Subject: [PATCH] qcacmn: Remove NOL channels from the scan channel list sent Consider a WDS Repeater(RE) connected to the Root on a DFS channel and reverse CSA is enabled. When RE detects radar, it adds the radar infected channel to its NOL list and it informs the Root of the radar detect. Let the target channel chosen by the Root be a DFS channel.The RE on receiving the RCSA, brings down the STA vap and begins to scan again. The scan is initiated from the supplicant (wlan_cfg80211_scan) and it provides all the supported channels including the NOL channels. (supplicant is unaware of the radar detect and NOL channels). As the scan channel list sent to the FW includes NOL channels, FW reports DFS SCAN VIOLATION and all DFS channels are blocked in RE. The supplicant keeps sending the same scan list but scan is never successful and thus the RE does not connect back to the Root. To fix the DFS violation, remove the NOL channel(s) from the scan channel list before sending the list to the FW. Change-Id: I62090e381c11fab78ab1ee920da77f3603f48eaf CRs-Fixed: 2405532 --- umac/scan/core/src/wlan_scan_manager.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/umac/scan/core/src/wlan_scan_manager.c b/umac/scan/core/src/wlan_scan_manager.c index 86268e2eb9b5..a3c9dcea8f5f 100644 --- a/umac/scan/core/src/wlan_scan_manager.c +++ b/umac/scan/core/src/wlan_scan_manager.c @@ -31,10 +31,9 @@ #include #endif #ifdef WLAN_POLICY_MGR_ENABLE -#include #include #endif - +#include QDF_STATUS scm_scan_free_scan_request_mem(struct scan_start_request *req) @@ -764,6 +763,7 @@ scm_update_channel_list(struct scan_start_request *req, struct wlan_objmgr_pdev *pdev; bool first_scan_done = true; bool p2p_search = false; + bool skip_dfs_ch = true; pdev = wlan_vdev_get_pdev(req->vdev); @@ -782,7 +782,10 @@ scm_update_channel_list(struct scan_start_request *req, p2p_search = true; /* * No need to update channels if req is passive scan and single channel - * ie ROC, Preauth etc + * ie ROC, Preauth etc. + * If the single chan in the scan channel list is an NOL channel,it is + * not removed as it would reduce the number of scan channels to 0 + * and FW would scan all chans which is unexpected in this scenerio. */ if (req->scan_req.scan_f_passive && req->scan_req.chan_list.num_chan == 1) @@ -792,20 +795,25 @@ scm_update_channel_list(struct scan_start_request *req, if ((!(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_STA_MODE) && !(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_P2P_CLIENT_MODE)) && !p2p_search) - return; + skip_dfs_ch = false; if ((scan_obj->scan_def.allow_dfs_chan_in_scan && (scan_obj->scan_def.allow_dfs_chan_in_first_scan || first_scan_done)) && !(scan_obj->scan_def.skip_dfs_chan_in_p2p_search && p2p_search)) - return; + skip_dfs_ch = false; for (i = 0; i < req->scan_req.chan_list.num_chan; i++) { - if (wlan_reg_is_dfs_ch(pdev, wlan_reg_freq_to_chan(pdev, - req->scan_req.chan_list.chan[i].freq))) + uint32_t freq; + + freq = req->scan_req.chan_list.chan[i].freq; + if (skip_dfs_ch && + wlan_reg_is_dfs_ch(pdev, wlan_reg_freq_to_chan(pdev, freq))) + continue; + if (utils_dfs_freq_is_in_nol(pdev, freq)) continue; req->scan_req.chan_list.chan[num_scan_channels++] = - req->scan_req.chan_list.chan[i]; + req->scan_req.chan_list.chan[i]; } req->scan_req.chan_list.num_chan = num_scan_channels; }