Răsfoiți Sursa

qcacmn: Fill "blanking status" field of SAMP message

Extract the blanking status from Spectral reports and upload
it to user space via SAMP message.

CRs-Fixed: 3413925
Change-Id: Ib033b88190be6bca3dff903cf279a9883821fb10
Edayilliam Jayadev 2 ani în urmă
părinte
comite
7f60898cfc

+ 2 - 2
target_if/spectral/target_if_spectral.c

@@ -3234,13 +3234,13 @@ target_if_spectral_report_params_init(
 
 	switch (rparams->version) {
 	case SPECTRAL_REPORT_FORMAT_VERSION_1:
-		rparams->ssumaary_padding_bytes =
+		rparams->ssummary_padding_bytes =
 			NUM_PADDING_BYTES_SSCAN_SUMARY_REPORT_GEN3_V1;
 		rparams->fft_report_hdr_len =
 			FFT_REPORT_HEADER_LENGTH_GEN3_V1;
 		break;
 	case SPECTRAL_REPORT_FORMAT_VERSION_2:
-		rparams->ssumaary_padding_bytes =
+		rparams->ssummary_padding_bytes =
 			NUM_PADDING_BYTES_SSCAN_SUMARY_REPORT_GEN3_V2;
 		rparams->fft_report_hdr_len =
 			FFT_REPORT_HEADER_LENGTH_GEN3_V2;

+ 25 - 2
target_if/spectral/target_if_spectral.h

@@ -327,6 +327,9 @@ struct spectral_process_phyerr_info_gen2 {
 #define SSCAN_SUMMARY_REPORT_HDR_B_GAINCHANGE_SIZE_GEN3_V1      (1)
 #define SSCAN_SUMMARY_REPORT_HDR_C_GAINCHANGE_POS_GEN3_V2       (16)
 #define SSCAN_SUMMARY_REPORT_HDR_C_GAINCHANGE_SIZE_GEN3_V2      (1)
+#define SSCAN_SUMMARY_REPORT_PAD_HDR_A_BLANKING_POS_GEN3_V2     (0)
+#define SSCAN_SUMMARY_REPORT_PAD_HDR_A_BLANKING_SIZE_GEN3_V2    (32)
+#define SSCAN_SUMMARY_REPORT_PAD_HDR_A_BLANKING_TAG_GEN3_V2     (0xdeadbeaf)
 #define SPECTRAL_REPORT_LTS_HDR_LENGTH_POS_GEN3                 (0)
 #define SPECTRAL_REPORT_LTS_HDR_LENGTH_SIZE_GEN3                (16)
 #define SPECTRAL_REPORT_LTS_TAG_POS_GEN3                        (16)
@@ -473,6 +476,10 @@ struct spectral_phyerr_fft_report_gen3 {
  *                 disregard the FFT sample if this is set to 1 but detector ID
  *                 does not correspond to the ID for the pri80 segment.
  * @sscan_detector_id: Detector ID in Spectral scan report
+ * @blanking_status: Indicates whether scan blanking was enabled during this
+ * spectral report capture. This field is applicable only when scan blanking
+ * feature is enabled. When scan blanking feature is disabled, this field
+ * will be set to zero.
  */
 struct sscan_report_fields_gen3 {
 	uint8_t sscan_agc_total_gain;
@@ -480,6 +487,7 @@ struct sscan_report_fields_gen3 {
 	uint8_t sscan_gainchange;
 	uint8_t sscan_pri80;
 	uint8_t sscan_detector_id;
+	uint8_t blanking_status;
 };
 
 /**
@@ -501,6 +509,21 @@ struct spectral_sscan_summary_report_gen3 {
 	u_int32_t hdr_c;
 } __ATTRIB_PACK;
 
+/**
+ * struct spectral_sscan_summary_report_padding_gen3_v2 - Spectral summary
+ * report padding region
+ * @hdr_a: Header[0:31]
+ * @hdr_b: Header[32:63]
+ * @hdr_c: Header[64:95]
+ * @hdr_d: Header[96:127]
+ */
+struct spectral_sscan_summary_report_padding_gen3_v2 {
+	u_int32_t hdr_a;
+	u_int32_t hdr_b;
+	u_int32_t hdr_c;
+	u_int32_t hdr_d;
+} __ATTRIB_PACK;
+
 #ifdef DIRECT_BUF_RX_ENABLE
 /**
  * struct Spectral_report - spectral report
@@ -601,7 +624,7 @@ struct spectral_fft_bin_len_adj_swar {
  * report.
  * @version: This represents the report format version number within each
  * Spectral generation.
- * @ssumaary_padding_bytes: Number of bytes of padding after Spectral summary
+ * @ssummary_padding_bytes: Number of bytes of padding after Spectral summary
  * report
  * @fft_report_hdr_len: Number of bytes in the header of the FFT report. This
  * has to be subtracted from the length field of FFT report to find the length
@@ -615,7 +638,7 @@ struct spectral_fft_bin_len_adj_swar {
  */
 struct spectral_report_params {
 	enum spectral_report_format_version version;
-	uint8_t ssumaary_padding_bytes;
+	uint8_t ssummary_padding_bytes;
 	uint8_t fft_report_hdr_len;
 	bool fragmentation_160[SPECTRAL_SCAN_MODE_MAX];
 	enum spectral_scan_mode detid_mode_table[SPECTRAL_DETECTOR_ID_MAX];

+ 34 - 3
target_if/spectral/target_if_spectral_phyerr.c

@@ -2983,7 +2983,7 @@ QDF_STATUS target_if_byte_swap_spectral_headers_gen3(
 	}
 
 	/* No need to swap the padding bytes */
-	ptr32 += (spectral->rparams.ssumaary_padding_bytes >> 2);
+	ptr32 += (spectral->rparams.ssummary_padding_bytes >> 2);
 
 	/* Search FFT Report */
 	words32 = sizeof(struct spectral_phyerr_fft_report_gen3) >> 2;
@@ -3039,6 +3039,8 @@ target_if_consume_sscan_summary_report_gen3(
 				struct target_if_spectral *spectral)
 {
 	struct spectral_sscan_summary_report_gen3 *psscan_summary_report;
+	struct spectral_sscan_summary_report_padding_gen3_v2 *padding;
+	bool scan_radio_blanking;
 
 	if (!data) {
 		spectral_err_rl("Summary report buffer is null");
@@ -3109,7 +3111,35 @@ target_if_consume_sscan_summary_report_gen3(
 
 	/* Advance buf pointer to the search fft report */
 	*data += sizeof(struct spectral_sscan_summary_report_gen3);
-	*data += spectral->rparams.ssumaary_padding_bytes;
+
+	if (!spectral->rparams.ssummary_padding_bytes)
+		return QDF_STATUS_SUCCESS;
+
+	scan_radio_blanking =
+		wlan_pdev_nif_feat_ext_cap_get(spectral->pdev_obj,
+					       WLAN_PDEV_FEXT_SCAN_BLANKING_EN);
+	padding = (struct spectral_sscan_summary_report_padding_gen3_v2 *)*data;
+
+	if (scan_radio_blanking) {
+		uint32_t blanking_tag;
+		uint8_t blanking_tag_size;
+		uint8_t blanking_tag_pos;
+
+		blanking_tag_size =
+			SSCAN_SUMMARY_REPORT_PAD_HDR_A_BLANKING_SIZE_GEN3_V2;
+		blanking_tag_pos =
+			SSCAN_SUMMARY_REPORT_PAD_HDR_A_BLANKING_POS_GEN3_V2;
+		blanking_tag = get_bitfield(padding->hdr_a, blanking_tag_size,
+					    blanking_tag_pos);
+
+		if (blanking_tag ==
+		    SSCAN_SUMMARY_REPORT_PAD_HDR_A_BLANKING_TAG_GEN3_V2)
+			fields->blanking_status = 1;
+		else
+			fields->blanking_status = 0;
+	}
+
+	*data += sizeof(struct spectral_sscan_summary_report_padding_gen3_v2);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -3401,6 +3431,7 @@ target_if_spectral_populate_samp_params_gen3(
 	params->noise_floor = report->noisefloor[chn_idx_lowest_enabled];
 	params->agc_total_gain = sscan_fields->sscan_agc_total_gain;
 	params->gainchange = sscan_fields->sscan_gainchange;
+	params->blanking_status = sscan_fields->blanking_status;
 	params->pri80ind = sscan_fields->sscan_pri80;
 
 	params->bin_pwr_data = p_sfft->bin_pwr_data;
@@ -3722,7 +3753,7 @@ target_if_consume_spectral_report_gen3(
 						    &spectral->rparams);
 	/* Advance buf pointer to the search fft report */
 	data += sizeof(struct spectral_sscan_summary_report_gen3);
-	data += spectral->rparams.ssumaary_padding_bytes;
+	data += spectral->rparams.ssummary_padding_bytes;
 	params.vhtop_ch_freq_seg1 = report->cfreq1;
 	params.vhtop_ch_freq_seg2 = report->cfreq2;