diff mbox series

[OpenWrt-Devel] ath9k: allow enabling hardware random number generator support.

Message ID 20200128125744.2378-1-rsalvaterra@gmail.com
State Not Applicable
Delegated to: Petr Štetiar
Headers show
Series [OpenWrt-Devel] ath9k: allow enabling hardware random number generator support. | expand

Commit Message

Rui Salvaterra Jan. 28, 2020, 12:57 p.m. UTC
Changes since RFC: keep the current entropy patch untouched. It will be
modified in order to support older (AR5008 and AR9002) hardware.

The ath9k driver is able to leverage the PHY ADC in order to provide a
generic hardware random number generator to the kernel, filling up the
entropy pool as required. Expose this feature in the build system.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
---
 config/Config-kernel.in        | 4 ++++
 package/kernel/mac80211/ath.mk | 7 +++++++
 2 files changed, 11 insertions(+)

Comments

Rui Salvaterra Jan. 30, 2020, 7:47 p.m. UTC | #1
Please ignore this patch too. I'm going to send a more complete one
(against master), implementing ath9k-rng support for both AR5008 and AR9002
(in addition to the already supported AR9003).

A terça, 28/01/2020, 12:58, Rui Salvaterra <rsalvaterra@gmail.com> escreveu:

> Changes since RFC: keep the current entropy patch untouched. It will be
> modified in order to support older (AR5008 and AR9002) hardware.
>
> The ath9k driver is able to leverage the PHY ADC in order to provide a
> generic hardware random number generator to the kernel, filling up the
> entropy pool as required. Expose this feature in the build system.
>
> Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
> ---
>  config/Config-kernel.in        | 4 ++++
>  package/kernel/mac80211/ath.mk | 7 +++++++
>  2 files changed, 11 insertions(+)
>
> diff --git a/config/Config-kernel.in b/config/Config-kernel.in
> index 20930326ca..2f4cda4275 100644
> --- a/config/Config-kernel.in
> +++ b/config/Config-kernel.in
> @@ -220,6 +220,10 @@ config KERNEL_AIO
>         bool "Compile the kernel with asynchronous IO support"
>         default y if !SMALL_FLASH
>
> +config KERNEL_HW_RANDOM
> +       bool "Compile the kernel with support for hardware random number
> generators"
> +       default n
> +
>  config KERNEL_FHANDLE
>         bool "Compile the kernel with support for fhandle syscalls"
>         default y if !SMALL_FLASH
> diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/
> ath.mk
> index 788131b751..56859cd3c1 100644
> --- a/package/kernel/mac80211/ath.mk
> +++ b/package/kernel/mac80211/ath.mk
> @@ -8,6 +8,7 @@ PKG_CONFIG_DEPENDS += \
>         CONFIG_PACKAGE_ATH_SPECTRAL \
>         CONFIG_PACKAGE_ATH_DYNACK \
>         CONFIG_ATH9K_SUPPORT_PCOEM \
> +       CONFIG_ATH9K_HWRNG \
>         CONFIG_ATH9K_TX99 \
>         CONFIG_ATH10K_LEDS \
>         CONFIG_ATH10K_THERMAL \
> @@ -45,6 +46,7 @@ config-$(CONFIG_TARGET_ipq40xx) += ATH10K_AHB
>  config-$(CONFIG_PCI) += ATH9K_PCI
>  config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD
>  config-$(CONFIG_ATH9K_SUPPORT_PCOEM) += ATH9K_PCOEM
> +config-$(CONFIG_ATH9K_HWRNG) += ATH9K_HWRNG
>  config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99
>  config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
>  config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS
> @@ -211,6 +213,11 @@ define KernelPackage/ath9k/config
>                 bool "Support chips used in PC OEM cards"
>                 depends on PACKAGE_kmod-ath9k
>
> +       config ATH9K_HWRNG
> +               bool "Random number generator support"
> +               depends on PACKAGE_kmod-ath9k
> +               select KERNEL_HW_RANDOM
> +
>         config ATH9K_TX99
>                 bool "Enable TX99 support (WARNING: testing only, breaks
> normal operation!)"
>                 depends on PACKAGE_kmod-ath9k
> --
> 2.25.0
>
>
diff mbox series

Patch

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 20930326ca..2f4cda4275 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -220,6 +220,10 @@  config KERNEL_AIO
 	bool "Compile the kernel with asynchronous IO support"
 	default y if !SMALL_FLASH
 
+config KERNEL_HW_RANDOM
+	bool "Compile the kernel with support for hardware random number generators"
+	default n
+
 config KERNEL_FHANDLE
 	bool "Compile the kernel with support for fhandle syscalls"
 	default y if !SMALL_FLASH
diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk
index 788131b751..56859cd3c1 100644
--- a/package/kernel/mac80211/ath.mk
+++ b/package/kernel/mac80211/ath.mk
@@ -8,6 +8,7 @@  PKG_CONFIG_DEPENDS += \
 	CONFIG_PACKAGE_ATH_SPECTRAL \
 	CONFIG_PACKAGE_ATH_DYNACK \
 	CONFIG_ATH9K_SUPPORT_PCOEM \
+	CONFIG_ATH9K_HWRNG \
 	CONFIG_ATH9K_TX99 \
 	CONFIG_ATH10K_LEDS \
 	CONFIG_ATH10K_THERMAL \
@@ -45,6 +46,7 @@  config-$(CONFIG_TARGET_ipq40xx) += ATH10K_AHB
 config-$(CONFIG_PCI) += ATH9K_PCI
 config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD
 config-$(CONFIG_ATH9K_SUPPORT_PCOEM) += ATH9K_PCOEM
+config-$(CONFIG_ATH9K_HWRNG) += ATH9K_HWRNG
 config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99
 config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
 config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS
@@ -211,6 +213,11 @@  define KernelPackage/ath9k/config
 		bool "Support chips used in PC OEM cards"
 		depends on PACKAGE_kmod-ath9k
 
+	config ATH9K_HWRNG
+		bool "Random number generator support"
+		depends on PACKAGE_kmod-ath9k
+		select KERNEL_HW_RANDOM
+
        config ATH9K_TX99
                bool "Enable TX99 support (WARNING: testing only, breaks normal operation!)"
                depends on PACKAGE_kmod-ath9k