Re: [PATCH ath-next v4 6/8] wifi: ath9k: count spectral samples in the driver's own RX stats

From: Toke Høiland-Jørgensen

Date: Mon Oct 19 2026 - 15:45:08 EST


Nerijus Bendžiūnas <nerijus.bendziunas@xxxxxxxxx> writes:

> ath_cmn_process_fft() is shared by ath9k and ath9k_htc, but it casts
> common->priv to struct ath_softc to reach the rx_spectral_sample_good
> and rx_spectral_sample_err counters. On ath9k_htc common->priv is a
> struct ath9k_htc_priv, a much smaller structure, and with
> CONFIG_ATH9K_DEBUGFS the increment lands far past the end of that
> allocation, once per FFT sample.
>
> Store a pointer to the driver's struct ath_rx_stats in struct
> ath_spec_scan_priv and count through it. Both drivers pass their own
> stats to ath9k_cmn_spectral_init_debug(), and both print them in the
> shared recv debugfs file, so the two counters now also work on
> ath9k_htc. Without debugfs the pointer stays NULL and nothing is
> counted, as before.
>
> Fixes: 03224678c013 ("ath9k: add counters for good and errorneous FFT/spectral frames")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@xxxxxxxxx>

Acked-by: Toke Høiland-Jørgensen <toke@xxxxxxx>