Browse Source

qcacmn: Do not modify radar found params while processing it

The radar found parameters processing API dfs_process_radar_ind() is
supposed to read-only the radar_found_info parameters and not modify
them. A block of code for PO platforms modify the radar_found_info
parameters.

The function dfs_process_radar_ind() should not modify the radar found
input parameters.

Since in this case the parameter modifications are specific to partial
offload, move the code that modifies the parameters out of the function
into a partial offload specific code.

NOTE:- The previous change I2c717219d0b0f9263734767bee6070f335032b04 also
does the same that is mentioned here but for modification of
full-offload parameters.

Change-Id: Ic438d70eaadb9ef91d28f6a0c22caf4926ed1df1
CRs-Fixed: 2737060
Vignesh U 5 years ago
parent
commit
adae9cdb21

+ 0 - 3
umac/dfs/core/src/dfs.h

@@ -1003,8 +1003,6 @@ struct dfs_rcac_params {
  * @wlan_dfs_debug_timer:            Dfs debug timer.
  * @wlan_dfs_debug_timer:            Dfs debug timer.
  * @dfs_bangradar_type:              Radar simulation type.
  * @dfs_bangradar_type:              Radar simulation type.
  * @is_radar_found_on_secondary_seg: Radar on second segment.
  * @is_radar_found_on_secondary_seg: Radar on second segment.
- * @dfs_radar_found_for_fo:          Radar found event for FO(Full Offload) is
- *                                   received.
  * @is_radar_during_precac:          Radar found during precac.
  * @is_radar_during_precac:          Radar found during precac.
  * @dfs_precac_lock:                 Lock to protect precac lists.
  * @dfs_precac_lock:                 Lock to protect precac lists.
  * @dfs_precac_secondary_freq:       Second segment freq for precac.
  * @dfs_precac_secondary_freq:       Second segment freq for precac.
@@ -1180,7 +1178,6 @@ struct wlan_dfs {
 	qdf_timer_t    wlan_dfs_debug_timer;
 	qdf_timer_t    wlan_dfs_debug_timer;
 	enum dfs_bangradar_types dfs_bangradar_type;
 	enum dfs_bangradar_types dfs_bangradar_type;
 	bool           is_radar_found_on_secondary_seg;
 	bool           is_radar_found_on_secondary_seg;
-	bool           dfs_radar_found_for_fo;
 	bool           is_radar_during_precac;
 	bool           is_radar_during_precac;
 	qdf_spinlock_t dfs_precac_lock;
 	qdf_spinlock_t dfs_precac_lock;
 	bool           dfs_precac_enable;
 	bool           dfs_precac_enable;

+ 20 - 0
umac/dfs/core/src/filtering/dfs_process_radarevent.c

@@ -1377,6 +1377,25 @@ void dfs_false_radarfound_reset_vars(
 	dfs->dfs_phyerr_queued_count = 0;
 	dfs->dfs_phyerr_queued_count = 0;
 }
 }
 
 
+/**
+ * dfs_process_radarevent() - For Full Offload, FW sends segment id,freq_offset
+ * and chirp information and gets assigned when there is radar detect. In
+ * case of radartool bangradar enhanced command and real radar for DA and PO,
+ * we assign these information here.
+ *
+ * @dfs: Pointer to wlan_dfs structure.
+ * @radar_found: Pointer to radar_found_info structure.
+ */
+
+static void
+dfs_fill_radar_found_info(struct wlan_dfs *dfs,
+			  struct radar_found_info *radar_found)
+{
+	radar_found->segment_id = dfs->dfs_seg_id;
+	radar_found->freq_offset = dfs->dfs_freq_offset;
+	radar_found->is_chirp = dfs->dfs_is_chirp;
+}
+
 void dfs_radarfound_action_generic(struct wlan_dfs *dfs, uint8_t seg_id)
 void dfs_radarfound_action_generic(struct wlan_dfs *dfs, uint8_t seg_id)
 {
 {
 	struct radar_found_info *radar_found;
 	struct radar_found_info *radar_found;
@@ -1391,6 +1410,7 @@ void dfs_radarfound_action_generic(struct wlan_dfs *dfs, uint8_t seg_id)
 	radar_found->pdev_id =
 	radar_found->pdev_id =
 		wlan_objmgr_pdev_get_pdev_id(dfs->dfs_pdev_obj);
 		wlan_objmgr_pdev_get_pdev_id(dfs->dfs_pdev_obj);
 
 
+	dfs_fill_radar_found_info(dfs, radar_found);
 	dfs_process_radar_ind(dfs, radar_found);
 	dfs_process_radar_ind(dfs, radar_found);
 	qdf_mem_free(radar_found);
 	qdf_mem_free(radar_found);
 }
 }

+ 0 - 11
umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

@@ -1092,17 +1092,6 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
 		goto exit;
 		goto exit;
 	}
 	}
 
 
-	/* For Full Offload, FW sends segment id,freq_offset and chirp
-	 * information and gets assigned when there is radar detect. In
-	 * case of radartool bangradar enhanced command and real radar
-	 * for DA and PO, we assign these information here.
-	 */
-	if (!(dfs->dfs_is_offload_enabled && dfs->dfs_radar_found_for_fo)) {
-		radar_found->segment_id = dfs->dfs_seg_id;
-		radar_found->freq_offset = dfs->dfs_freq_offset;
-		radar_found->is_chirp = dfs->dfs_is_chirp;
-	}
-
 	dfs_compute_radar_found_cfreq(dfs, radar_found, &freq_center);
 	dfs_compute_radar_found_cfreq(dfs, radar_found, &freq_center);
 	radarfound_freq = freq_center + radar_found->freq_offset;
 	radarfound_freq = freq_center + radar_found->freq_offset;
 
 

+ 0 - 2
umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c

@@ -654,10 +654,8 @@ QDF_STATUS tgt_dfs_process_radar_ind(struct wlan_objmgr_pdev *pdev,
 		return status;
 		return status;
 	}
 	}
 
 
-	dfs->dfs_radar_found_for_fo = 1;
 	dfs_translate_radar_params(dfs, radar_found);
 	dfs_translate_radar_params(dfs, radar_found);
 	status = dfs_process_radar_ind(dfs, radar_found);
 	status = dfs_process_radar_ind(dfs, radar_found);
-	dfs->dfs_radar_found_for_fo = 0;
 
 
 	return status;
 	return status;
 }
 }