Forráskód Böngészése

qcacmn: Fix Enhanced Bangradar in Partial Offload

Fix Enhanced Bangradar to add only the subchannels into NOL
based on its parameters during call, and not the entire set
of current subchannels.

Current implementation of enhanced bangradar sets bangradar entry,
in DFS, to 1. Since bangradar does not use subchannel marking,
enhanced bangradar did not work either.

Introduce a new boolean entry in DFS structure that does not follow
bangradar and does subchannel marking.

Change-Id: Idf44b80a6cae3f1c8a3c7b430a233e3fd29ba0c5
CRs-Fixed: 2368100
Vignesh Mohan 6 éve
szülő
commit
cadbce4bca

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

@@ -884,6 +884,8 @@ struct dfs_event_log {
 
 #define MIN_DFS_SUBCHAN_BW 20 /* Minimum bandwidth of each subchannel. */
 
+#define FREQ_OFFSET_BOUNDARY_FOR_80MHZ 40
+
 /**
  * struct wlan_dfs -                 The main dfs structure.
  * @dfs_debug_mask:                  Current debug bitmask.
@@ -920,6 +922,9 @@ struct dfs_event_log {
  * @wlan_dfswaittimer:               Dfs wait timer.
  * @wlan_dfstesttimer:               Dfs mute test timer.
  * @wlan_dfs_debug_timer:            Dfs debug timer.
+ * @dfs_bangradar:                   Radar simulation on entire segment.
+ * @dfs_enh_bangradar:               Radar (Chirp or non-chirp) simulation on
+ *                                   particular frequency.
  * @dfs_second_segment_bangradar:    Bangaradar on second segment of
  *                                   VHT80_80/160.
  * @is_radar_found_on_secondary_seg: Radar on second segment.
@@ -1069,6 +1074,7 @@ struct wlan_dfs {
 	os_timer_t     wlan_dfstesttimer;
 	os_timer_t     wlan_dfs_debug_timer;
 	uint8_t        dfs_bangradar;
+	bool           dfs_enh_bangradar;
 	bool           dfs_second_segment_bangradar;
 	bool           is_radar_found_on_secondary_seg;
 	bool           dfs_radar_found_for_fo;

+ 12 - 5
umac/dfs/core/src/filtering/dfs_process_radarevent.c

@@ -588,13 +588,20 @@ static inline int dfs_handle_bangradar(
 	int *retval)
 {
 
-	if (dfs->dfs_bangradar) {
+	if (dfs->dfs_enh_bangradar || dfs->dfs_bangradar) {
 		/*
-		 * Bangradar will always simulate radar found on the primary
-		 * channel.
-		 */
+		* Bangradar will always simulate radar found on
+		* the primary channel.
+		*
+		* Enhanced Bangradar will save the params in dfs
+		* and simulate radar on given frequency
+		*/
 		*rs = &dfs->dfs_radar[dfs->dfs_curchan_radindex];
-		dfs_debug(dfs, WLAN_DEBUG_DFS, "bangradar");
+		if (dfs->dfs_enh_bangradar)
+			*seg_id = dfs->dfs_seg_id;
+		dfs_debug(dfs, WLAN_DEBUG_DFS,
+			  "bangradar %d, Enhanced Bangradar %d",
+			  dfs->dfs_bangradar, dfs->dfs_enh_bangradar);
 		*retval = 1;
 		return 1;
 	}

+ 9 - 1
umac/dfs/core/src/misc/dfs.c

@@ -383,6 +383,13 @@ int dfs_control(struct wlan_dfs *dfs,
 		bangradar_enh_params =
 				      (struct dfs_bangradar_enh_params *)indata;
 		if (bangradar_enh_params) {
+			if (abs(bangradar_enh_params->freq_offset) >
+			    FREQ_OFFSET_BOUNDARY_FOR_80MHZ) {
+				dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
+					 "Frequency Offset out of bound");
+				error = -EINVAL;
+				break;
+			}
 			dfs->dfs_seg_id = bangradar_enh_params->seg_id;
 			dfs->dfs_is_chirp = bangradar_enh_params->is_chirp;
 			dfs->dfs_freq_offset =
@@ -393,7 +400,8 @@ int dfs_control(struct wlan_dfs *dfs,
 							(dfs, SEG_ID_PRIMARY,
 							 &dfs_unit_test);
 			} else {
-				dfs->dfs_bangradar = 1;
+				dfs->dfs_enh_bangradar = true;
+				dfs->dfs_bangradar = 0;
 				error = dfs_start_host_based_bangradar(dfs);
 			}
 		} else {

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

@@ -561,6 +561,7 @@ static inline void dfs_reset_bangradar(struct wlan_dfs *dfs)
 {
 	dfs->dfs_bangradar  = 0;
 	dfs->dfs_second_segment_bangradar = 0;
+	dfs->dfs_enh_bangradar = false;
 }
 
 /* dfs_prepare_nol_ie_bitmap: Create a Bitmap from the radar found subchannels