qcacmn: Check discrepancies in Spectral timestamps
If the timestamp field in the current Spectral report is equal to the timestamp field in the previous report, assert the FW. Change-Id: Idb32807f0cdd59a2eaab5dd6c1e62567fd5a45d0 CRs-Fixed: 2478593
This commit is contained in:
@@ -841,6 +841,8 @@ struct spectral_param_properties {
|
|||||||
* @dbr_ring_debug: Whether Spectral DBR ring debug is enabled
|
* @dbr_ring_debug: Whether Spectral DBR ring debug is enabled
|
||||||
* @dbr_buff_debug: Whether Spectral DBR buffer debug is enabled
|
* @dbr_buff_debug: Whether Spectral DBR buffer debug is enabled
|
||||||
* @direct_dma_support: Whether Direct-DMA is supported on the current radio
|
* @direct_dma_support: Whether Direct-DMA is supported on the current radio
|
||||||
|
* @prev_tstamp: Timestamp of the previously received sample, which has to be
|
||||||
|
* compared with the current tstamp to check descrepancy
|
||||||
*/
|
*/
|
||||||
struct target_if_spectral {
|
struct target_if_spectral {
|
||||||
struct wlan_objmgr_pdev *pdev_obj;
|
struct wlan_objmgr_pdev *pdev_obj;
|
||||||
@@ -958,6 +960,7 @@ struct target_if_spectral {
|
|||||||
bool dbr_ring_debug;
|
bool dbr_ring_debug;
|
||||||
bool dbr_buff_debug;
|
bool dbr_buff_debug;
|
||||||
bool direct_dma_support;
|
bool direct_dma_support;
|
||||||
|
uint32_t prev_tstamp;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1603,6 +1603,27 @@ static void target_if_spectral_check_buffer_poisoning(
|
|||||||
target_if_spectral_fw_hang(spectral);
|
target_if_spectral_fw_hang(spectral);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void target_if_spectral_verify_ts(struct target_if_spectral *spectral,
|
||||||
|
uint8_t *buf, uint32_t current_ts)
|
||||||
|
{
|
||||||
|
if (!spectral) {
|
||||||
|
spectral_err_rl("Spectral LMAC object is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!spectral->dbr_buff_debug)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (spectral->prev_tstamp) {
|
||||||
|
if (current_ts == spectral->prev_tstamp) {
|
||||||
|
spectral_err("Spectral timestamp(%u) in the current buffer(%pK) is equal to the previous timestamp, same report DMAed twice? Asserting the FW",
|
||||||
|
current_ts, buf);
|
||||||
|
target_if_spectral_fw_hang(spectral);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spectral->prev_tstamp = current_ts;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static void target_if_spectral_check_buffer_poisoning(
|
static void target_if_spectral_check_buffer_poisoning(
|
||||||
struct target_if_spectral *spectral,
|
struct target_if_spectral *spectral,
|
||||||
@@ -1610,6 +1631,11 @@ static void target_if_spectral_check_buffer_poisoning(
|
|||||||
int num_fft_bins, enum spectral_scan_mode smode)
|
int num_fft_bins, enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void target_if_spectral_verify_ts(struct target_if_spectral *spectral,
|
||||||
|
uint8_t *buf, uint32_t current_ts)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -1840,6 +1866,9 @@ target_if_consume_spectral_report_gen3(
|
|||||||
params.datalen = (fft_hdr_length * 4);
|
params.datalen = (fft_hdr_length * 4);
|
||||||
params.pwr_count = fft_bin_len;
|
params.pwr_count = fft_bin_len;
|
||||||
params.tstamp = (tsf64 & SPECTRAL_TSMASK);
|
params.tstamp = (tsf64 & SPECTRAL_TSMASK);
|
||||||
|
|
||||||
|
target_if_spectral_verify_ts(spectral, report->data,
|
||||||
|
params.tstamp);
|
||||||
} else if (is_secondaryseg_expected(spectral)) {
|
} else if (is_secondaryseg_expected(spectral)) {
|
||||||
/* RSSI is in 1/2 dBm steps, Covert it to dBm scale */
|
/* RSSI is in 1/2 dBm steps, Covert it to dBm scale */
|
||||||
rssi = (sscan_report_fields.inband_pwr_db) >> 1;
|
rssi = (sscan_report_fields.inband_pwr_db) >> 1;
|
||||||
|
Reference in New Issue
Block a user