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