qcacmn: Expand DFS Radar found on curchan sanity check
Move the dfs current channel NULL check inside the routine that does the sanity check(dfs_radarevent_basic_sanity()). Since we have two completely different functions to handle radar from: 1) Home channel 2) Agile Channel we do not need agile detector check in "radar from home channel" function. Change-Id: Ie91f1d24c948e9d136f49d9ce8bc4cff29327862 CRs-Fixed: 2737944
This commit is contained in:
@@ -772,9 +772,15 @@ void dfs_reset_bangradar(struct wlan_dfs *dfs)
|
||||
int dfs_radarevent_basic_sanity(struct wlan_dfs *dfs,
|
||||
struct dfs_channel *chan)
|
||||
{
|
||||
if (!chan) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"dfs->dfs_curchan is NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(WLAN_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(chan))) {
|
||||
dfs_debug(dfs, WLAN_DEBUG_DFS2,
|
||||
"radar event on non-DFS chan");
|
||||
dfs_debug(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"radar event on non-DFS chan");
|
||||
if (!(dfs->dfs_is_offload_enabled)) {
|
||||
dfs_reset_radarq(dfs);
|
||||
dfs_reset_alldelaylines(dfs);
|
||||
@@ -1189,22 +1195,13 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs,
|
||||
|
||||
dfs_curchan = dfs->dfs_curchan;
|
||||
|
||||
if (!dfs_curchan) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs->dfs_curchan is NULL");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Check if the current channel is a non DFS channel
|
||||
* If the current channel is non-DFS and the radar is from Agile
|
||||
* Detector we need to process it since Agile Detector has a
|
||||
* different channel.
|
||||
*/
|
||||
if (!dfs_radarevent_basic_sanity(dfs, dfs_curchan) &&
|
||||
!(radar_found->detector_id == dfs_get_agile_detector_id(dfs))) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS,
|
||||
"radar event on a non-DFS channel");
|
||||
if (!dfs_radarevent_basic_sanity(dfs, dfs_curchan))
|
||||
goto exit;
|
||||
}
|
||||
|
||||
dfs_compute_radar_found_cfreq(dfs, radar_found, &freq_center);
|
||||
radarfound_freq = freq_center + radar_found->freq_offset;
|
||||
|
Reference in New Issue
Block a user