wifi: wcn36xx: Add RX frame SNR as a source of system entropy
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Thu, 15 Sep 2022 00:41:17 +0000 (01:41 +0100)
committerKalle Valo <quic_kvalo@quicinc.com>
Mon, 19 Sep 2022 12:42:37 +0000 (15:42 +0300)
commite1a6b5d3a9719dc9d4d8b55fe85dace7c4ffcc32
tree613dc4d52ce0ecbe8a0fafa1625e5396cf068f28
parent3f505a30ea6b0fdfa4bf214b5383e8d4e6a2832e
wifi: wcn36xx: Add RX frame SNR as a source of system entropy

The signal-to-noise-ratio SNR is returned by the wcn36xx firmware for each
received frame. SNR represents all of the unwanted interference signal
after filtering out the fundamental frequency and harmonics of the
frequency.

Noise can come from various electromagnetic sources, from temperature
affecting the performance hardware components or quantization effects
converting from analog to digital domains.

The SNR value returned by the WiFi firmware then is a good source of
entropy.

Other WiFi drivers offer up the noise component of the FFT as an entropy
source for the random pool e.g.

commit 2aa56cca3571 ("ath9k: Mix the received FFT bins to the random pool")

I attended Jason's talk on sources of randomness at Plumbers and it
occurred to me that SNR is a reasonable candidate to add.

Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220915004117.1562703-2-bryan.odonoghue@linaro.org
drivers/net/wireless/ath/wcn36xx/txrx.c