summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/Kconfig
diff options
context:
space:
mode:
authorMiaoqing Pan <miaoqing@codeaurora.org>2015-10-09 17:06:45 +0800
committerKalle Valo <kvalo@qca.qualcomm.com>2015-12-11 14:08:58 +0200
commited14dc0af7ccea867b479feb88efdfe43ca2a0f9 (patch)
tree5637d4614b1551994648675ef7b12b8cd0f77784 /drivers/net/wireless/ath/ath9k/Kconfig
parentf0b2c30a20299083665f3f14870ff5ce631d32ef (diff)
ath9k: feeding entropy in kernel from ADC capture
This patch is derived from commit 6301566e0b2d ("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>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/Kconfig')
-rw-r--r--drivers/net/wireless/ath/ath9k/Kconfig11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig
index fee0cadb0f5e..40fa915d6f35 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -176,3 +176,14 @@ config ATH9K_HTC_DEBUGFS
depends on ATH9K_HTC && DEBUG_FS
---help---
Say Y, if you need access to ath9k_htc's statistics.
+
+config ATH9K_HWRNG
+ bool "Random number generator support"
+ depends on ATH9K && (HW_RANDOM = y || HW_RANDOM = ATH9K)
+ default y
+ ---help---
+ This option incorporates the ADC register output as a source of
+ randomness into Linux entropy pool (/dev/urandom and /dev/random)
+
+ Say Y, feeds the entropy directly from the WiFi driver to the input
+ pool.