Commit 03224678 authored by Simon Wunderlich's avatar Simon Wunderlich Committed by Kalle Valo

ath9k: add counters for good and errorneous FFT/spectral frames

This is helpful to see whether spectral samples get discarded.
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent ec95e84c
...@@ -144,6 +144,8 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, ...@@ -144,6 +144,8 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
RXS_ERR("BEACONS", rx_beacons); RXS_ERR("BEACONS", rx_beacons);
RXS_ERR("FRAGS", rx_frags); RXS_ERR("FRAGS", rx_frags);
RXS_ERR("SPECTRAL", rx_spectral); RXS_ERR("SPECTRAL", rx_spectral);
RXS_ERR("SPECTRAL SMPL GOOD", rx_spectral_sample_good);
RXS_ERR("SPECTRAL SMPL ERR", rx_spectral_sample_err);
RXS_ERR("CRC ERR", crc_err); RXS_ERR("CRC ERR", crc_err);
RXS_ERR("DECRYPT CRC ERR", decrypt_crc_err); RXS_ERR("DECRYPT CRC ERR", decrypt_crc_err);
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
* @rx_beacons: No. of beacons received. * @rx_beacons: No. of beacons received.
* @rx_frags: No. of rx-fragements received. * @rx_frags: No. of rx-fragements received.
* @rx_spectral: No of spectral packets received. * @rx_spectral: No of spectral packets received.
* @rx_spectral_sample_good: No. of good spectral samples
* @rx_spectral_sample_err: No. of good spectral samples
*/ */
struct ath_rx_stats { struct ath_rx_stats {
u32 rx_pkts_all; u32 rx_pkts_all;
...@@ -58,6 +60,8 @@ struct ath_rx_stats { ...@@ -58,6 +60,8 @@ struct ath_rx_stats {
u32 rx_beacons; u32 rx_beacons;
u32 rx_frags; u32 rx_frags;
u32 rx_spectral; u32 rx_spectral;
u32 rx_spectral_sample_good;
u32 rx_spectral_sample_err;
}; };
#ifdef CONFIG_ATH9K_COMMON_DEBUG #ifdef CONFIG_ATH9K_COMMON_DEBUG
......
...@@ -501,6 +501,7 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h ...@@ -501,6 +501,7 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
u8 sample_buf[SPECTRAL_SAMPLE_MAX_LEN] = {0}; u8 sample_buf[SPECTRAL_SAMPLE_MAX_LEN] = {0};
struct ath_hw *ah = spec_priv->ah; struct ath_hw *ah = spec_priv->ah;
struct ath_common *common = ath9k_hw_common(spec_priv->ah); struct ath_common *common = ath9k_hw_common(spec_priv->ah);
struct ath_softc *sc = (struct ath_softc *)common->priv;
u8 num_bins, *vdata = (u8 *)hdr; u8 num_bins, *vdata = (u8 *)hdr;
struct ath_radar_info *radar_info; struct ath_radar_info *radar_info;
int len = rs->rs_datalen; int len = rs->rs_datalen;
...@@ -649,9 +650,14 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h ...@@ -649,9 +650,14 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
sample_buf, sample_len, sample_buf, sample_len,
sample_bytes); sample_bytes);
fft_handler(rs, spec_priv, sample_buf, ret = fft_handler(rs, spec_priv, sample_buf,
tsf, freq, chan_type); tsf, freq, chan_type);
if (ret == 0)
RX_STAT_INC(rx_spectral_sample_good);
else
RX_STAT_INC(rx_spectral_sample_err);
memset(sample_buf, 0, SPECTRAL_SAMPLE_MAX_LEN); memset(sample_buf, 0, SPECTRAL_SAMPLE_MAX_LEN);
/* Mix the received bins to the /dev/random /* Mix the received bins to the /dev/random
...@@ -665,6 +671,11 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h ...@@ -665,6 +671,11 @@ int ath_cmn_process_fft(struct ath_spec_scan_priv *spec_priv, struct ieee80211_h
ret = fft_handler(rs, spec_priv, sample_start, ret = fft_handler(rs, spec_priv, sample_start,
tsf, freq, chan_type); tsf, freq, chan_type);
if (ret == 0)
RX_STAT_INC(rx_spectral_sample_good);
else
RX_STAT_INC(rx_spectral_sample_err);
/* Mix the received bins to the /dev/random /* Mix the received bins to the /dev/random
* pool * pool
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment