Przeglądaj źródła

qcacmn: Add fft bin size WAR check

Add the fft bin size WAR check in spectral
report processing routine.

CRs-fixed: 2300341
Change-Id: I662fb469cb3716287663bc6d94d4adccb01a83c4
Edayilliam Jayadev 6 lat temu
rodzic
commit
1f91a239b6
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      target_if/spectral/target_if_spectral_phyerr.c

+ 8 - 2
target_if/spectral/target_if_spectral_phyerr.c

@@ -1406,7 +1406,10 @@ target_if_consume_spectral_report_gen3(
 	report_len = (fft_hdr_length + 8);
 
 	fft_bin_len = (fft_hdr_length - 16);
-	fft_bin_len >>= 2;
+	/* Divide fft bin length by 4 if fftbin_size_war is enabled */
+	if (spectral->fftbin_size_war) {
+		fft_bin_len >>= 2;
+	}
 	if ((spectral->params.ss_rpt_mode == 2) &&
 			spectral->inband_fftbin_size_adj) {
 		fft_bin_len >>= 1;
@@ -1526,7 +1529,10 @@ target_if_consume_spectral_report_gen3(
 		report_len     = (fft_hdr_length + 8);
 
 		fft_bin_len    = (fft_hdr_length - 16);
-		fft_bin_len >>= 2;
+		/* Divide fft bin length by 4 if fftbin_size_war is enabled */
+		if (spectral->fftbin_size_war) {
+			fft_bin_len >>= 2;
+		}
 		if ((spectral->params.ss_rpt_mode == 2) &&
 				spectral->inband_fftbin_size_adj) {
 			fft_bin_len >>= 1;