]> git.baikalelectronics.ru Git - kernel.git/commit
ath9k: feeding entropy in kernel from ADC capture
authorMiaoqing Pan <miaoqing@codeaurora.org>
Fri, 9 Oct 2015 09:06:45 +0000 (17:06 +0800)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 11 Dec 2015 12:08:58 +0000 (14:08 +0200)
commite31c29235301463dd6acf41ffd8b5b920c7881ab
tree5637d4614b1551994648675ef7b12b8cd0f77784
parent2511d4531667175bbc1d9646460fb0efc4e58c3f
ath9k: feeding entropy in kernel from ADC capture

This patch is derived from
commit 4b8324ce567b ("ath9k: export HW random number generator"),

We evaluated the entropy of the ADC data on QCA9531, QCA9561, QCA955x,
and AR9340, and it has sufficient quality random data (at least 10 bits
and up to 22 bits of min-entropy for a 32-bit value). We conservatively
assume the min-entropy is 10 bits out of 32 bits. Thus, ATH9K_RNG_BUF_SIZE
is set to 320 (u32) i.e., 1.25 kilobytes of data is inserted to fill up
the pool as soon as the entropy counter becomes 896/4096 (set by random.c).
Since ADC was not designed to be a dedicated HW RNG, we do not want to bind
it to /dev/hwrng framework directly. This patch feeds the entropy directly
from the WiFi driver to the input pool. The ADC register output is only
used as a seed for the Linux entropy pool. No conditioning is needed,
since all the conditioning is performed by the pool itself.

Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath9k/Kconfig
drivers/net/wireless/ath/ath9k/Makefile
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/rng.c [new file with mode: 0644]