diff --git a/spectral/dispatcher/inc/spectral_ioctl.h b/spectral/dispatcher/inc/spectral_ioctl.h index 88cd7e314f..cae051fdc7 100644 --- a/spectral/dispatcher/inc/spectral_ioctl.h +++ b/spectral/dispatcher/inc/spectral_ioctl.h @@ -342,6 +342,20 @@ struct spectral_classifier_params { * segment * @ch_width: Channel width 20/40/80/160 MHz * @spectral_mode: Spectral scan mode + * @spectral_pri80ind: Indication from hardware that the sample was + * received on the primary 80 MHz segment. If this + * is set when smode = SPECTRAL_SCAN_MODE_AGILE, it + * indicates that Spectral was carried out on pri80 + * instead of the Agile frequency due to a + * channel switch - Software may choose + * to ignore the sample in this case. + * @spectral_pri80ind_sec80: Indication from hardware that the sample was + * received on the primary 80 MHz segment instead of + * the secondary 80 MHz segment due to a channel + * switch - Software may choose to ignore the sample + * if this is set. Applicable only if smode = + * SPECTRAL_SCAN_MODE_NORMAL and for 160/80+80 MHz + * Spectral operation. */ struct spectral_samp_data { int16_t spectral_data_len; @@ -399,6 +413,8 @@ struct spectral_samp_data { uint8_t spectral_gainchange; uint8_t spectral_gainchange_sec80; enum spectral_scan_mode spectral_mode; + uint8_t spectral_pri80ind; + uint8_t spectral_pri80ind_sec80; } __packed; /** diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h index 32a1ed5652..d7743da089 100644 --- a/target_if/spectral/target_if_spectral.h +++ b/target_if/spectral/target_if_spectral.h @@ -244,6 +244,8 @@ struct spectral_phyerr_fft_gen2 { #define SSCAN_SUMMARY_REPORT_HDR_A_AGC_TOTAL_GAIN_SIZE_GEN3 (8) #define SSCAN_SUMMARY_REPORT_HDR_A_INBAND_PWR_DB_POS_GEN3 (18) #define SSCAN_SUMMARY_REPORT_HDR_A_INBAND_PWR_DB_SIZE_GEN3 (10) +#define SSCAN_SUMMARY_REPORT_HDR_A_PRI80_POS_GEN3 (31) +#define SSCAN_SUMMARY_REPORT_HDR_A_PRI80_SIZE_GEN3 (1) #define SSCAN_SUMMARY_REPORT_HDR_B_GAINCHANGE_POS_GEN3 (30) #define SSCAN_SUMMARY_REPORT_HDR_B_GAINCHANGE_SIZE_GEN3 (1) @@ -344,11 +346,16 @@ struct spectral_phyerr_fft_report_gen3 { * @sscan_gainchange: This bit is set to 1 if a gainchange occurred during * the spectral scan FFT. Software may choose to * disregard the results. + * @sscan_pri80: This is set to 1 to indicate that the Spectral scan was + * performed on the pri80 segment. Software may choose to + * disregard the FFT sample if this is set to 1 but detector ID + * does not correspond to the ID for the pri80 segment. */ struct sscan_report_fields_gen3 { uint8_t sscan_agc_total_gain; int16_t inband_pwr_db; uint8_t sscan_gainchange; + uint8_t sscan_pri80; }; /** @@ -979,6 +986,16 @@ struct target_if_spectral { * @interf_list: List of interfernce sources * @classifier_params: classifier parameters * @sc: classifier parameters + * @pri80ind: Indication from hardware that the sample was received on the + * primary 80 MHz segment. If this is set when smode = + * SPECTRAL_SCAN_MODE_AGILE, it indicates that Spectral was carried out on + * pri80 instead of the Agile frequency due to a channel switch - Software may + * choose to ignore the sample in this case. + * @pri80ind_sec80: Indication from hardware that the sample was received on the + * primary 80 MHz segment instead of the secondary 80 MHz segment due to a + * channel switch - Software may choose to ignore the sample if this is set. + * Applicable only if smode = SPECTRAL_SCAN_MODE_NORMAL and for 160/80+80 MHz + * Spectral operation. */ struct target_if_samp_msg_params { int8_t rssi; @@ -1020,6 +1037,8 @@ struct target_if_samp_msg_params { uint8_t gainchange; uint8_t gainchange_sec80; enum spectral_scan_mode smode; + uint8_t pri80ind; + uint8_t pri80ind_sec80; }; #ifdef WLAN_CONV_SPECTRAL_ENABLE diff --git a/target_if/spectral/target_if_spectral_netlink.c b/target_if/spectral/target_if_spectral_netlink.c index a57746ac73..32538b700f 100644 --- a/target_if/spectral/target_if_spectral_netlink.c +++ b/target_if/spectral/target_if_spectral_netlink.c @@ -79,6 +79,7 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral, samp_data->ch_width = spectral->ch_width; samp_data->spectral_agc_total_gain = params->agc_total_gain; samp_data->spectral_gainchange = params->gainchange; + samp_data->spectral_pri80ind = params->pri80ind; samp_data->spectral_combined_rssi = (uint8_t)params->rssi; @@ -179,6 +180,8 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral, params->agc_total_gain_sec80; spec_samp_msg->samp_data.spectral_gainchange_sec80 = params->gainchange_sec80; + spec_samp_msg->samp_data.spectral_pri80ind_sec80 = + params->pri80ind_sec80; samp_data->spectral_data_len_sec80 = params->datalen_sec80; diff --git a/target_if/spectral/target_if_spectral_phyerr.c b/target_if/spectral/target_if_spectral_phyerr.c index 9d8ae72bcb..90814ecb88 100644 --- a/target_if/spectral/target_if_spectral_phyerr.c +++ b/target_if/spectral/target_if_spectral_phyerr.c @@ -1458,6 +1458,10 @@ target_if_consume_sscan_summary_report_gen3(struct target_if_spectral *spectral, psscan_summary_report->hdr_a, SSCAN_SUMMARY_REPORT_HDR_A_INBAND_PWR_DB_SIZE_GEN3, SSCAN_SUMMARY_REPORT_HDR_A_INBAND_PWR_DB_POS_GEN3); + fields->sscan_pri80 = get_bitfield( + psscan_summary_report->hdr_a, + SSCAN_SUMMARY_REPORT_HDR_A_PRI80_SIZE_GEN3, + SSCAN_SUMMARY_REPORT_HDR_A_PRI80_POS_GEN3); fields->sscan_gainchange = get_bitfield( psscan_summary_report->hdr_b, SSCAN_SUMMARY_REPORT_HDR_B_GAINCHANGE_SIZE_GEN3, @@ -1614,6 +1618,7 @@ target_if_consume_spectral_report_gen3( params.agc_total_gain = sscan_report_fields.sscan_agc_total_gain; params.gainchange = sscan_report_fields.sscan_gainchange; + params.pri80ind = sscan_report_fields.sscan_pri80; /* Process Spectral search FFT report */ if (target_if_verify_sig_and_tag_gen3( @@ -1765,6 +1770,7 @@ target_if_consume_spectral_report_gen3( params.agc_total_gain_sec80 = sscan_report_fields.sscan_agc_total_gain; params.gainchange_sec80 = sscan_report_fields.sscan_gainchange; + params.pri80ind_sec80 = sscan_report_fields.sscan_pri80; /* Process Spectral search FFT report */ if (target_if_verify_sig_and_tag_gen3(