qcacld-3.0: Do DFS flag configure only when DFS channels are supported

When gEnableDFSChnlScan is configured as 0, it is incorrect that DFS
channels are not skipped when scanning.
Android O/P framework always enables DFS flag for station interface, then
gEnableDFSChnlScan is always overwritten currently.

Only support DFS flag configuration when gEnableDFSChnlScan is set as 1.

Change-Id: I4c819c4cc8c44d95ebe1ce074e67f3f1d9b254e0
CRs-Fixed: 2368131
This commit is contained in:
bings 2018-12-21 15:51:51 +08:00 • committed by nshrivas
commit 50112bb4bb

View file

@ -4356,7 +4356,17 @@ static int __wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy,
return -EINVAL;
}
ret_val = wlan_hdd_enable_dfs_chan_scan(hdd_ctx, !no_dfs_flag);
if (hdd_ctx->config->enableDFSChnlScan) {
ret_val = wlan_hdd_enable_dfs_chan_scan(hdd_ctx, !no_dfs_flag);
} else {
if ((!no_dfs_flag) != hdd_ctx->config->enableDFSChnlScan) {
hdd_err("DFS chan ini configured %d, no dfs flag: %d",
hdd_ctx->config->enableDFSChnlScan,
no_dfs_flag);
return -EINVAL;
}
}
return ret_val;
}