qcacmn: Skip DFS channels in p2p scan

Add support for the INI gSkipDfsChannelInP2pSearch
to remove the DFS channels from the given scan list in
p2p scan.

Change-Id: I44a6208ab5f3ee062073550143e23e5800342376
CRs-Fixed: 2405191
This commit is contained in:
Bala Venkatesh 2019-02-26 14:26:23 +05:30 • committed by nshrivas
commit fbf6d922d6
5 changed files with 35 additions and 5 deletions

View file

@ -218,7 +218,6 @@ struct wlan_objmgr_psoc_user_config {
bool is_11d_support_enabled;
bool is_11h_support_enabled;
uint8_t dot11_mode;
bool skip_dfs_chnl_in_p2p_search;
uint8_t band_capability;
};

View file

@ -291,6 +291,7 @@ struct extscan_def_config {
* @active_dwell: default active dwell time
* @allow_dfs_chan_in_first_scan: first scan should contain dfs channels or not.
* @allow_dfs_chan_in_scan: Scan DFS channels or not.
* @skip_dfs_chan_in_p2p_search: Skip DFS channels in p2p search.
* @use_wake_lock_in_user_scan: if wake lock will be acquired during user scan
* @active_dwell_2g: default active dwell time for 2G channels, if it's not zero
* @passive_dwell:default passive dwell time
@ -370,6 +371,7 @@ struct scan_default_params {
uint32_t active_dwell;
bool allow_dfs_chan_in_first_scan;
bool allow_dfs_chan_in_scan;
bool skip_dfs_chan_in_p2p_search;
bool use_wake_lock_in_user_scan;
uint32_t active_dwell_2g;
uint32_t passive_dwell;

View file

@ -763,6 +763,7 @@ scm_update_channel_list(struct scan_start_request *req,
struct scan_vdev_obj *scan_vdev_obj;
struct wlan_objmgr_pdev *pdev;
bool first_scan_done = true;
bool p2p_search = false;
pdev = wlan_vdev_get_pdev(req->vdev);
@ -777,6 +778,8 @@ scm_update_channel_list(struct scan_start_request *req,
scan_vdev_obj->first_scan_done = true;
}
if(req->scan_req.p2p_scan_type == SCAN_P2P_SEARCH)
p2p_search = true;
/*
* No need to update channels if req is passive scan and single channel
* ie ROC, Preauth etc
@ -786,13 +789,15 @@ scm_update_channel_list(struct scan_start_request *req,
return;
/* do this only for STA and P2P-CLI mode */
if (!(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_STA_MODE) &&
!(wlan_vdev_mlme_get_opmode(req->vdev) == QDF_P2P_CLIENT_MODE))
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;
if (scan_obj->scan_def.allow_dfs_chan_in_scan &&
if ((scan_obj->scan_def.allow_dfs_chan_in_scan &&
(scan_obj->scan_def.allow_dfs_chan_in_first_scan ||
first_scan_done))
first_scan_done)) &&
!(scan_obj->scan_def.skip_dfs_chan_in_p2p_search && p2p_search))
return;
for (i = 0; i < req->scan_req.chan_list.num_chan; i++) {

View file

@ -1046,6 +1046,27 @@
CFG_VALUE_OR_DEFAULT, \
"ap scan burst duration")
/*
* <ini>
* gSkipDfsChannelInP2pSearch - Skip DFS Channel in case of P2P Search
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini is used to disable(skip) dfs channel in p2p search.
* Related: None.
*
* Supported Feature: DFS P2P
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH CFG_INI_BOOL( \
"gSkipDfsChannelInP2pSearch", \
1, \
"skip dfs channel in p2p search")
#define CFG_SCAN_ALL \
CFG(CFG_DROP_BCN_ON_CHANNEL_MISMATCH) \
CFG(CFG_ENABLE_WAKE_LOCK_IN_SCAN) \
@ -1071,6 +1092,7 @@
CFG(CFG_P2P_SCAN_BURST_DURATION) \
CFG(CFG_GO_SCAN_BURST_DURATION) \
CFG(CFG_AP_SCAN_BURST_DURATION) \
CFG(CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH) \
CFG_SCAN_PNO
#endif /* __CONFIG_SCAN_H */

View file

@ -950,6 +950,8 @@ wlan_scan_global_init(struct wlan_objmgr_psoc *psoc,
!cfg_get(psoc, CFG_INITIAL_NO_DFS_SCAN);
scan_obj->scan_def.allow_dfs_chan_in_scan =
cfg_get(psoc, CFG_ENABLE_DFS_SCAN);
scan_obj->scan_def.skip_dfs_chan_in_p2p_search =
cfg_get(psoc, CFG_ENABLE_SKIP_DFS_IN_P2P_SEARCH);
scan_obj->scan_def.use_wake_lock_in_user_scan =
cfg_get(psoc, CFG_ENABLE_WAKE_LOCK_IN_SCAN);
scan_obj->scan_def.active_dwell_2g =