qcacmn: Add more fields to SAMP message
Add new fields such as agc_total_gain, sscan_gainchange to the Spectral SAMP message. CRs-Fixed: 2291499 Change-Id: Ia6a9fd742c2ee98fd9d7102f0d8c66dcd22a1614
This commit is contained in:

committed by
nshrivas

parent
6ca6f83556
commit
8e3eb14984
@@ -440,6 +440,10 @@ struct spectral_samp_data {
|
|||||||
int16_t noise_floor;
|
int16_t noise_floor;
|
||||||
int16_t noise_floor_sec80;
|
int16_t noise_floor_sec80;
|
||||||
uint32_t ch_width;
|
uint32_t ch_width;
|
||||||
|
uint8_t spectral_agc_total_gain;
|
||||||
|
uint8_t spectral_agc_total_gain_sec80;
|
||||||
|
uint8_t spectral_gainchange;
|
||||||
|
uint8_t spectral_gainchange_sec80;
|
||||||
} __ATTRIB_PACKED;
|
} __ATTRIB_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -288,6 +288,20 @@ struct spectral_phyerr_fft_report_gen3 {
|
|||||||
uint8_t buf[0];
|
uint8_t buf[0];
|
||||||
} __ATTRIB_PACK;
|
} __ATTRIB_PACK;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct sscan_report_fields_gen3 - Fields of spectral report
|
||||||
|
* @sscan_agc_total_gain: The AGC total gain in DB.
|
||||||
|
* @inband_pwr_db: The in-band power of the signal in 1/2 DB steps
|
||||||
|
* @sscan_gainchange: This bit is set to 1 if a gainchange occurred during
|
||||||
|
* the spectral scan FFT. Software may choose to
|
||||||
|
* disregard the results.
|
||||||
|
*/
|
||||||
|
struct sscan_report_fields_gen3 {
|
||||||
|
uint8_t sscan_agc_total_gain;
|
||||||
|
int16_t inband_pwr_db;
|
||||||
|
uint8_t sscan_gainchange;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct spectral_sscan_report_gen3 - spectral report in phyerr event
|
* struct spectral_sscan_report_gen3 - spectral report in phyerr event
|
||||||
* @sscan_timestamp: Timestamp at which fft report was generated
|
* @sscan_timestamp: Timestamp at which fft report was generated
|
||||||
@@ -888,6 +902,10 @@ struct target_if_samp_msg_params {
|
|||||||
struct interf_src_rsp interf_list;
|
struct interf_src_rsp interf_list;
|
||||||
struct spectral_classifier_params classifier_params;
|
struct spectral_classifier_params classifier_params;
|
||||||
struct ath_softc *sc;
|
struct ath_softc *sc;
|
||||||
|
uint8_t agc_total_gain;
|
||||||
|
uint8_t agc_total_gain_sec80;
|
||||||
|
uint8_t gainchange;
|
||||||
|
uint8_t gainchange_sec80;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef WLAN_CONV_SPECTRAL_ENABLE
|
#ifdef WLAN_CONV_SPECTRAL_ENABLE
|
||||||
|
@@ -154,6 +154,9 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral,
|
|||||||
spec_samp_msg->freq_loading = params->freq_loading;
|
spec_samp_msg->freq_loading = params->freq_loading;
|
||||||
spec_samp_msg->samp_data.spectral_data_len = params->datalen;
|
spec_samp_msg->samp_data.spectral_data_len = params->datalen;
|
||||||
spec_samp_msg->samp_data.spectral_rssi = params->rssi;
|
spec_samp_msg->samp_data.spectral_rssi = params->rssi;
|
||||||
|
spec_samp_msg->samp_data.spectral_agc_total_gain =
|
||||||
|
params->agc_total_gain;
|
||||||
|
spec_samp_msg->samp_data.spectral_gainchange = params->gainchange;
|
||||||
spec_samp_msg->samp_data.ch_width = spectral->ch_width;
|
spec_samp_msg->samp_data.ch_width = spectral->ch_width;
|
||||||
|
|
||||||
spec_samp_msg->samp_data.spectral_combined_rssi =
|
spec_samp_msg->samp_data.spectral_combined_rssi =
|
||||||
@@ -226,6 +229,10 @@ target_if_spectral_create_samp_msg(struct target_if_spectral *spectral,
|
|||||||
params->rssi_sec80;
|
params->rssi_sec80;
|
||||||
spec_samp_msg->samp_data.noise_floor_sec80 =
|
spec_samp_msg->samp_data.noise_floor_sec80 =
|
||||||
params->noise_floor_sec80;
|
params->noise_floor_sec80;
|
||||||
|
spec_samp_msg->samp_data.spectral_agc_total_gain_sec80 =
|
||||||
|
params->agc_total_gain_sec80;
|
||||||
|
spec_samp_msg->samp_data.spectral_gainchange_sec80 =
|
||||||
|
params->gainchange_sec80;
|
||||||
|
|
||||||
spec_samp_msg->samp_data.spectral_data_len_sec80 =
|
spec_samp_msg->samp_data.spectral_data_len_sec80 =
|
||||||
params->datalen_sec80;
|
params->datalen_sec80;
|
||||||
|
@@ -1251,19 +1251,18 @@ target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
|||||||
*
|
*
|
||||||
* Consume spectral summary report for gen3
|
* Consume spectral summary report for gen3
|
||||||
*
|
*
|
||||||
* Return: rssi
|
* Return: void
|
||||||
*/
|
*/
|
||||||
static int
|
static void
|
||||||
target_if_consume_sscan_report_gen3(struct target_if_spectral *spectral,
|
target_if_consume_sscan_report_gen3(struct target_if_spectral *spectral,
|
||||||
uint8_t *data) {
|
uint8_t *data,
|
||||||
int rssi;
|
struct sscan_report_fields_gen3 *fields) {
|
||||||
struct spectral_sscan_report_gen3 *psscan_report;
|
struct spectral_sscan_report_gen3 *psscan_report;
|
||||||
|
|
||||||
psscan_report = (struct spectral_sscan_report_gen3 *)data;
|
psscan_report = (struct spectral_sscan_report_gen3 *)data;
|
||||||
/* RSSI is in 1/2 dBm steps, Covert it to dBm scale */
|
fields->sscan_agc_total_gain = get_bitfield(psscan_report->hdr_a, 8, 0);
|
||||||
rssi = (get_bitfield(psscan_report->hdr_a, 10, 18)) >> 1;
|
fields->inband_pwr_db = get_bitfield(psscan_report->hdr_a, 10, 18);
|
||||||
|
fields->sscan_gainchange = get_bitfield(psscan_report->hdr_b, 1, 30);
|
||||||
return rssi;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1375,6 +1374,7 @@ target_if_consume_spectral_report_gen3(
|
|||||||
uint8_t *data = report->data;
|
uint8_t *data = report->data;
|
||||||
struct wlan_objmgr_vdev *vdev;
|
struct wlan_objmgr_vdev *vdev;
|
||||||
uint8_t vdev_rxchainmask;
|
uint8_t vdev_rxchainmask;
|
||||||
|
struct sscan_report_fields_gen3 sscan_report_fields;
|
||||||
|
|
||||||
OS_MEMZERO(¶ms, sizeof(params));
|
OS_MEMZERO(¶ms, sizeof(params));
|
||||||
|
|
||||||
@@ -1382,7 +1382,12 @@ target_if_consume_spectral_report_gen3(
|
|||||||
spectral, data,
|
spectral, data,
|
||||||
TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3) != 0)
|
TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
rssi = target_if_consume_sscan_report_gen3(spectral, data);
|
target_if_consume_sscan_report_gen3(spectral, data,
|
||||||
|
&sscan_report_fields);
|
||||||
|
/* RSSI is in 1/2 dBm steps, Covert it to dBm scale */
|
||||||
|
rssi = (sscan_report_fields.inband_pwr_db) >> 1;
|
||||||
|
params.agc_total_gain = sscan_report_fields.sscan_agc_total_gain;
|
||||||
|
params.gainchange = sscan_report_fields.sscan_gainchange;
|
||||||
/* Advance buf pointer to the search fft report */
|
/* Advance buf pointer to the search fft report */
|
||||||
data += sizeof(struct spectral_sscan_report_gen3);
|
data += sizeof(struct spectral_sscan_report_gen3);
|
||||||
|
|
||||||
@@ -1502,7 +1507,13 @@ target_if_consume_spectral_report_gen3(
|
|||||||
spectral, data,
|
spectral, data,
|
||||||
TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3) != 0)
|
TLV_TAG_SPECTRAL_SUMMARY_REPORT_GEN3) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
rssi = target_if_consume_sscan_report_gen3(spectral, data);
|
target_if_consume_sscan_report_gen3(spectral, data,
|
||||||
|
&sscan_report_fields);
|
||||||
|
/* RSSI is in 1/2 dBm steps, Covert it to dBm scale */
|
||||||
|
rssi = (sscan_report_fields.inband_pwr_db) >> 1;
|
||||||
|
params.agc_total_gain_sec80 =
|
||||||
|
sscan_report_fields.sscan_agc_total_gain;
|
||||||
|
params.gainchange_sec80 = sscan_report_fields.sscan_gainchange;
|
||||||
/* Advance buf pointer to the search fft report */
|
/* Advance buf pointer to the search fft report */
|
||||||
data += sizeof(struct spectral_sscan_report_gen3);
|
data += sizeof(struct spectral_sscan_report_gen3);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user