Browse Source

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
bings 6 years ago
parent
commit
50112bb4bb
1 changed files with 11 additions and 1 deletions
  1. 11 1
      core/hdd/src/wlan_hdd_cfg80211.c

+ 11 - 1
core/hdd/src/wlan_hdd_cfg80211.c

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