diff --git a/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 b/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 index 9e8241d83af..a3d12779628 100644 --- a/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 +++ b/arch/arm/soc/nxp_kinetis/k6x/Kconfig.defconfig.mk64f12 @@ -74,12 +74,12 @@ config ETH_MCUX endif # NET_L2_ETHERNET -if RANDOM_GENERATOR +if ENTROPY_GENERATOR -config RANDOM_MCUX_RNGA +config ENTROPY_MCUX_RNGA def_bool y -endif # RANDOM_GENERATOR +endif # ENTROPY_GENERATOR if FLASH diff --git a/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw2xd512 b/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw2xd512 index 418bcd32d03..0b8ed4a9187 100644 --- a/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw2xd512 +++ b/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw2xd512 @@ -79,12 +79,12 @@ config SPI_MCUX_DSPI endif # SPI -if RANDOM_GENERATOR +if ENTROPY_GENERATOR -config RANDOM_MCUX_RNGA +config ENTROPY_MCUX_RNGA def_bool y -endif # RANDOM_GENERATOR +endif # ENTROPY_GENERATOR if FLASH diff --git a/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw40z4 b/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw40z4 index b93bf030af2..dd6087fe8f6 100644 --- a/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw40z4 +++ b/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw40z4 @@ -57,12 +57,12 @@ config I2C_MCUX endif # I2C -if RANDOM_GENERATOR +if ENTROPY_GENERATOR -config RANDOM_MCUX_TRNG +config ENTROPY_MCUX_TRNG def_bool y -endif # RANDOM_GENERATOR +endif # ENTROPY_GENERATOR if FLASH diff --git a/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw41z4 b/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw41z4 index 782d08f0523..83fef98ab3b 100644 --- a/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw41z4 +++ b/arch/arm/soc/nxp_kinetis/kwx/Kconfig.defconfig.mkw41z4 @@ -57,12 +57,12 @@ config I2C_MCUX endif # I2C -if RANDOM_GENERATOR +if ENTROPY_GENERATOR -config RANDOM_MCUX_TRNG +config ENTROPY_MCUX_TRNG def_bool y -endif # RANDOM_GENERATOR +endif # ENTROPY_GENERATOR if FLASH diff --git a/arch/arm/soc/st_stm32/stm32f4/soc.h b/arch/arm/soc/st_stm32/stm32f4/soc.h index 7e523b24066..915345a465c 100644 --- a/arch/arm/soc/st_stm32/stm32f4/soc.h +++ b/arch/arm/soc/st_stm32/stm32f4/soc.h @@ -48,7 +48,7 @@ #include #endif -#ifdef CONFIG_RANDOM_STM32_RNG +#ifdef CONFIG_ENTROPY_STM32_RNG #include #endif diff --git a/arch/arm/soc/ti_simplelink/cc2650/soc.c b/arch/arm/soc/ti_simplelink/cc2650/soc.c index 7b934e54ad4..ed184f3514c 100644 --- a/arch/arm/soc/ti_simplelink/cc2650/soc.c +++ b/arch/arm/soc/ti_simplelink/cc2650/soc.c @@ -66,7 +66,7 @@ ti_ccfg[CCFG_SIZE / sizeof(u32_t)] = { static const u32_t clkloadctl = REG_ADDR(TI_CC2650_PRCM_40082000_BASE_ADDRESS, CC2650_PRCM_CLKLOADCTL); -#ifdef CONFIG_CC2650_TRNG_RANDOM_GENERATOR +#ifdef CONFIG_CC2650_TRNG_ENTROPY_GENERATOR static const u32_t secdmaclkgr = REG_ADDR(TI_CC2650_PRCM_40082000_BASE_ADDRESS, CC2650_PRCM_SECDMACLKGR); @@ -90,11 +90,11 @@ static const u32_t uartclkgr = static void setup_modules_prcm(void) { #if defined(CONFIG_GPIO_CC2650) || \ - defined(CONFIG_CC2650_TRNG_RANDOM_GENERATOR) || \ + defined(CONFIG_CC2650_TRNG_ENTROPY_GENERATOR) || \ defined(CONFIG_SERIAL) /* Setup power */ -#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_RANDOM_GENERATOR) +#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_ENTROPY_GENERATOR) sys_set_bit(pdctl0, CC2650_PRCM_PDCTL0_PERIPH_ON_POS); #endif #ifdef CONFIG_SERIAL @@ -105,7 +105,7 @@ static void setup_modules_prcm(void) #ifdef CONFIG_GPIO_CC2650 sys_set_bit(gpioclkgr, CC2650_PRCM_GPIOCLKGR_CLK_EN_POS); #endif -#ifdef CONFIG_CC2650_TRNG_RANDOM_GENERATOR +#ifdef CONFIG_CC2650_TRNG_ENTROPY_GENERATOR sys_set_bit(secdmaclkgr, CC2650_PRCM_SECDMACLKGR_TRNG_CLK_EN_POS); #endif #ifdef CONFIG_SERIAL @@ -117,7 +117,7 @@ static void setup_modules_prcm(void) /* Wait for power to be completely on, to avoid bus faults * when accessing modules' registers. */ -#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_RANDOM_GENERATOR) +#if defined(CONFIG_GPIO_CC2650) || defined(CONFIG_CC2650_TRNG_ENTROPY_GENERATOR) while (!(sys_read32(pdstat0) & BIT(CC2650_PRCM_PDSTAT0_PERIPH_ON_POS))) { continue; diff --git a/boards/arm/cc2650_sensortag/cc2650_sensortag_defconfig b/boards/arm/cc2650_sensortag/cc2650_sensortag_defconfig index adcff58adba..3d53c5e5f77 100644 --- a/boards/arm/cc2650_sensortag/cc2650_sensortag_defconfig +++ b/boards/arm/cc2650_sensortag/cc2650_sensortag_defconfig @@ -40,6 +40,6 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y # Random number generator driver -CONFIG_RANDOM_GENERATOR=y -CONFIG_CC2650_TRNG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y +CONFIG_CC2650_TRNG_ENTROPY_GENERATOR=y CONFIG_CC2650_TRNG_IRQ_PRIO=0 diff --git a/boards/arm/olimex_stm32_e407/olimex_stm32_e407_defconfig b/boards/arm/olimex_stm32_e407/olimex_stm32_e407_defconfig index 0d3bec75fb7..2149239d9bd 100644 --- a/boards/arm/olimex_stm32_e407/olimex_stm32_e407_defconfig +++ b/boards/arm/olimex_stm32_e407/olimex_stm32_e407_defconfig @@ -39,9 +39,9 @@ CONFIG_CLOCK_STM32_APB1_PRESCALER=4 CONFIG_CLOCK_STM32_APB2_PRESCALER=2 -CONFIG_RANDOM_GENERATOR=y -# CONFIG_RANDOM_HAS_DRIVER is not set -CONFIG_RANDOM_NAME="RANDOM_0" +CONFIG_ENTROPY_GENERATOR=y +# CONFIG_ENTROPY_HAS_DRIVER is not set +CONFIG_ENTROPY_NAME="ENTROPY_0" CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TIMER_RANDOM_GENERATOR=y diff --git a/boards/arm/olimex_stm32_p405/olimex_stm32_p405_defconfig b/boards/arm/olimex_stm32_p405/olimex_stm32_p405_defconfig index 7c8c4baecb1..bae53f6063b 100644 --- a/boards/arm/olimex_stm32_p405/olimex_stm32_p405_defconfig +++ b/boards/arm/olimex_stm32_p405/olimex_stm32_p405_defconfig @@ -36,9 +36,9 @@ CONFIG_CLOCK_STM32_APB1_PRESCALER=4 CONFIG_CLOCK_STM32_APB2_PRESCALER=2 -CONFIG_RANDOM_GENERATOR=y -# CONFIG_RANDOM_HAS_DRIVER is not set -CONFIG_RANDOM_NAME="RANDOM_0" +CONFIG_ENTROPY_GENERATOR=y +# CONFIG_ENTROPY_HAS_DRIVER is not set +CONFIG_ENTROPY_NAME="ENTROPY_0" CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TIMER_RANDOM_GENERATOR=y diff --git a/boards/xtensa/esp32/esp32_defconfig b/boards/xtensa/esp32/esp32_defconfig index 578cd3ba0f0..c068def7303 100644 --- a/boards/xtensa/esp32/esp32_defconfig +++ b/boards/xtensa/esp32/esp32_defconfig @@ -23,7 +23,7 @@ CONFIG_PINMUX_ESP32=y CONFIG_GPIO=y CONFIG_GPIO_ESP32=y -CONFIG_RANDOM_ESP32_RNG=y +CONFIG_ENTROPY_ESP32_RNG=y CONFIG_SW_ISR_TABLE=y CONFIG_GEN_ISR_TABLES=y diff --git a/doc/api/io_interfaces.rst b/doc/api/io_interfaces.rst index 2ebbe2149c2..59bc1b16f19 100644 --- a/doc/api/io_interfaces.rst +++ b/doc/api/io_interfaces.rst @@ -60,10 +60,10 @@ SPI Interface .. doxygengroup:: spi_interface :project: Zephyr -Random Interface -**************** +Entropy Interface +***************** -.. doxygengroup:: random_interface +.. doxygengroup:: entropy_interface :project: Zephyr UART Interface diff --git a/drivers/Kconfig b/drivers/Kconfig index 54da2d609f0..7855f5db5ef 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -30,7 +30,7 @@ source "drivers/interrupt_controller/Kconfig" source "drivers/timer/Kconfig" -source "drivers/random/Kconfig" +source "drivers/entropy/Kconfig" source "drivers/grove/Kconfig" diff --git a/drivers/Makefile b/drivers/Makefile index fbed062c555..df09ebd4d74 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -1,7 +1,7 @@ subdir-ccflags-y += -I$(srctree)/include/drivers obj-y = console/ -obj-y += random/ +obj-y += entropy/ obj-y += serial/ obj-y += display/ obj-$(CONFIG_SYS_CLOCK_EXISTS) += timer/ diff --git a/drivers/entropy/Kconfig b/drivers/entropy/Kconfig new file mode 100644 index 00000000000..d5e2fac1a82 --- /dev/null +++ b/drivers/entropy/Kconfig @@ -0,0 +1,49 @@ +# Kconfig - entropy generator driver configuration options + +# +# Copyright (c) 2014-2015 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +menuconfig ENTROPY_GENERATOR + bool + prompt "Entropy Drivers" + default n + help + Include entropy drivers in system config. + +if ENTROPY_GENERATOR + +source "drivers/entropy/Kconfig.mcux" +source "drivers/entropy/Kconfig.stm32" +source "drivers/entropy/Kconfig.esp32" + +config ENTROPY_HAS_DRIVER + bool + default n + help + This is an option to be enabled by individual entropy driver + to signal that there is a true entropy driver. + +config ENTROPY_NAME + string "Entropy Device Name" + default "ENTROPY_0" + help + Specify the device name to be used for the ENTROPY driver. + +config SYS_LOG_ENTROPY_LEVEL + int "Random Log level" + depends on SYS_LOG + default 0 + range 0 4 + help + Sets log level for entropy driver. + Levels are: + - 0 OFF: do not write + - 1 ERROR: only write SYS_LOG_ERR + - 2 WARNING: write SYS_LOG_WRN in addition to previous level + - 3 INFO: write SYS_LOG_INF in addition to previous levels + - 4 DEBUG: write SYS_LOG_DBG in addition to previous levels + +endif diff --git a/drivers/entropy/Kconfig.esp32 b/drivers/entropy/Kconfig.esp32 new file mode 100644 index 00000000000..69ae063d770 --- /dev/null +++ b/drivers/entropy/Kconfig.esp32 @@ -0,0 +1,18 @@ +# Kconfig.esp32 - esp32 entropy generator driver configuration +# +# Copyright (c) 2017 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +config ENTROPY_ESP32_RNG + bool "ESP32 entropy number generator driver" + depends on ENTROPY_GENERATOR && SOC_ESP32 + default n + select ENTROPY_HAS_DRIVER + select ENTROPY_DEVICE_ENTROPY_GENERATOR + help + This option enables the entropy number generator for ESP32 SoCs. + + With Wi-Fi and Bluetooth disabled, this will produce pseudo-entropy + numbers: noise from these radios are used to feed entropy in this + generator. diff --git a/drivers/random/Kconfig.mcux b/drivers/entropy/Kconfig.mcux similarity index 58% rename from drivers/random/Kconfig.mcux rename to drivers/entropy/Kconfig.mcux index 1082852b2dc..73ce6e0d4c9 100644 --- a/drivers/random/Kconfig.mcux +++ b/drivers/entropy/Kconfig.mcux @@ -1,23 +1,23 @@ -# Kconfig.mcux - mcux random generator driver configuration +# Kconfig.mcux - mcux entropy generator driver configuration # # Copyright (c) 2016 ARM Ltd. # # SPDX-License-Identifier: Apache-2.0 -menuconfig RANDOM_MCUX_RNGA +menuconfig ENTROPY_MCUX_RNGA bool "MCUX RNGA driver" - depends on RANDOM_GENERATOR && HAS_MCUX_RNGA + depends on ENTROPY_GENERATOR && HAS_MCUX_RNGA default n - select RANDOM_HAS_DRIVER + select ENTROPY_HAS_DRIVER help This option enables the random number generator accelerator (RNGA) driver based on the MCUX RNGA driver. -menuconfig RANDOM_MCUX_TRNG +menuconfig ENTROPY_MCUX_TRNG bool "MCUX TRNG driver" - depends on RANDOM_GENERATOR && HAS_MCUX_TRNG + depends on ENTROPY_GENERATOR && HAS_MCUX_TRNG default n - select RANDOM_HAS_DRIVER + select ENTROPY_HAS_DRIVER help This option enables the true random number generator (TRNG) driver based on the MCUX TRNG driver. diff --git a/drivers/entropy/Kconfig.stm32 b/drivers/entropy/Kconfig.stm32 new file mode 100644 index 00000000000..a342a205d31 --- /dev/null +++ b/drivers/entropy/Kconfig.stm32 @@ -0,0 +1,16 @@ +# Kconfig.stm32 - STM32 entropy generator driver configuration +# +# Copyright (c) 2017 Erwin Rol +# +# SPDX-License-Identifier: Apache-2.0 + +menuconfig ENTROPY_STM32_RNG + bool "STM32 RNG driver" + depends on ENTROPY_GENERATOR + default n + select ENTROPY_HAS_DRIVER + select ENTROPY_DEVICE_ENTROPY_GENERATOR + help + This option enables the RNG processor, which is a entropy number + generator, based on a continuous analog noise, that provides + a entropy 32-bit value to the host when read. diff --git a/drivers/entropy/Makefile b/drivers/entropy/Makefile new file mode 100644 index 00000000000..066cdcc0584 --- /dev/null +++ b/drivers/entropy/Makefile @@ -0,0 +1,5 @@ +obj-$(CONFIG_ENTROPY_MCUX_RNGA) += entropy_mcux_rnga.o +obj-$(CONFIG_ENTROPY_MCUX_TRNG) += entropy_mcux_trng.o +obj-$(CONFIG_ENTROPY_STM32_RNG) += entropy_stm32.o +obj-$(CONFIG_ENTROPY_ESP32_RNG) += entropy_esp32.o +obj-$(CONFIG_USERSPACE) += entropy_handlers.o diff --git a/drivers/random/random_esp32.c b/drivers/entropy/entropy_esp32.c similarity index 69% rename from drivers/random/random_esp32.c rename to drivers/entropy/entropy_esp32.c index c4a33ca6c98..10a860a6c7c 100644 --- a/drivers/random/random_esp32.c +++ b/drivers/entropy/entropy_esp32.c @@ -5,9 +5,9 @@ */ #include -#include +#include -static inline u32_t random_esp32_get_u32(void) +static inline u32_t entropy_esp32_get_u32(void) { /* The documentation specifies the random number generator at the * following address, which is at odds with the SDK, that specifies @@ -25,10 +25,10 @@ static inline u32_t random_esp32_get_u32(void) return *rng_data_reg; } -static int random_esp32_get_entropy(struct device *device, u8_t *buf, u16_t len) +static int entropy_esp32_get_entropy(struct device *device, u8_t *buf, u16_t len) { while (len) { - u32_t v = random_esp32_get_u32(); + u32_t v = entropy_esp32_get_u32(); if (len >= sizeof(v)) { memcpy(buf, &v, sizeof(v)); @@ -44,19 +44,19 @@ static int random_esp32_get_entropy(struct device *device, u8_t *buf, u16_t len) return 0; } -static int random_esp32_init(struct device *device) +static int entropy_esp32_init(struct device *device) { return 0; } -static struct random_driver_api random_esp32_api_funcs = { - .get_entropy = random_esp32_get_entropy +static struct entropy_driver_api entropy_esp32_api_funcs = { + .get_entropy = entropy_esp32_get_entropy }; -DEVICE_AND_API_INIT(random_esp32, CONFIG_RANDOM_NAME, - random_esp32_init, NULL, NULL, +DEVICE_AND_API_INIT(entropy_esp32, CONFIG_ENTROPY_NAME, + entropy_esp32_init, NULL, NULL, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, - &random_esp32_api_funcs); + &entropy_esp32_api_funcs); u32_t sys_rand32_get(void) { diff --git a/drivers/entropy/entropy_handlers.c b/drivers/entropy/entropy_handlers.c new file mode 100644 index 00000000000..61070e7cd48 --- /dev/null +++ b/drivers/entropy/entropy_handlers.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2017 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include + +_SYSCALL_HANDLER(entropy_get_entropy, dev, buffer, len) +{ + _SYSCALL_OBJ(dev, K_OBJ_DRIVER_ENTROPY); + _SYSCALL_MEMORY_WRITE(buffer, len); + return _impl_entropy_get_entropy((struct device *)dev, (u8_t *)buffer, + len); +} diff --git a/drivers/random/random_mcux_rnga.c b/drivers/entropy/entropy_mcux_rnga.c similarity index 73% rename from drivers/random/random_mcux_rnga.c rename to drivers/entropy/entropy_mcux_rnga.c index 43cec692259..6b7a0834c28 100644 --- a/drivers/random/random_mcux_rnga.c +++ b/drivers/entropy/entropy_mcux_rnga.c @@ -5,13 +5,13 @@ */ #include -#include +#include #include #include #include "fsl_rnga.h" -static u8_t random_mcux_rnga_get_uint8(void) +static u8_t entropy_mcux_rnga_get_uint8(void) { u32_t random; u8_t output = 0; @@ -36,7 +36,7 @@ static u8_t random_mcux_rnga_get_uint8(void) return output; } -static int random_mcux_rnga_get_entropy(struct device *dev, u8_t *buffer, +static int entropy_mcux_rnga_get_entropy(struct device *dev, u8_t *buffer, u16_t length) { int i; @@ -44,24 +44,24 @@ static int random_mcux_rnga_get_entropy(struct device *dev, u8_t *buffer, ARG_UNUSED(dev); for (i = 0; i < length; i++) { - buffer[i] = random_mcux_rnga_get_uint8(); + buffer[i] = entropy_mcux_rnga_get_uint8(); } return 0; } -static const struct random_driver_api random_mcux_rnga_api_funcs = { - .get_entropy = random_mcux_rnga_get_entropy +static const struct entropy_driver_api entropy_mcux_rnga_api_funcs = { + .get_entropy = entropy_mcux_rnga_get_entropy }; -static int random_mcux_rnga_init(struct device *); +static int entropy_mcux_rnga_init(struct device *); -DEVICE_AND_API_INIT(random_mcux_rnga, CONFIG_RANDOM_NAME, - random_mcux_rnga_init, NULL, NULL, +DEVICE_AND_API_INIT(entropy_mcux_rnga, CONFIG_ENTROPY_NAME, + entropy_mcux_rnga_init, NULL, NULL, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, - &random_mcux_rnga_api_funcs); + &entropy_mcux_rnga_api_funcs); -static int random_mcux_rnga_init(struct device *dev) +static int entropy_mcux_rnga_init(struct device *dev) { u32_t seed = k_cycle_get_32(); diff --git a/drivers/random/random_mcux_trng.c b/drivers/entropy/entropy_mcux_trng.c similarity index 62% rename from drivers/random/random_mcux_trng.c rename to drivers/entropy/entropy_mcux_trng.c index cfd32fec7d2..933c43f452f 100644 --- a/drivers/random/random_mcux_trng.c +++ b/drivers/entropy/entropy_mcux_trng.c @@ -5,14 +5,14 @@ */ #include -#include +#include #include #include #include "fsl_trng.h" -static int random_mcux_trng_get_entropy(struct device *dev, u8_t *buffer, - u16_t length) +static int entropy_mcux_trng_get_entropy(struct device *dev, u8_t *buffer, + u16_t length) { status_t status; @@ -24,18 +24,18 @@ static int random_mcux_trng_get_entropy(struct device *dev, u8_t *buffer, return 0; } -static const struct random_driver_api random_mcux_trng_api_funcs = { - .get_entropy = random_mcux_trng_get_entropy +static const struct entropy_driver_api entropy_mcux_trng_api_funcs = { + .get_entropy = entropy_mcux_trng_get_entropy }; -static int random_mcux_trng_init(struct device *); +static int entropy_mcux_trng_init(struct device *); -DEVICE_AND_API_INIT(random_mcux_trng, CONFIG_RANDOM_NAME, - random_mcux_trng_init, NULL, NULL, +DEVICE_AND_API_INIT(entropy_mcux_trng, CONFIG_ENTROPY_NAME, + entropy_mcux_trng_init, NULL, NULL, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, - &random_mcux_trng_api_funcs); + &entropy_mcux_trng_api_funcs); -static int random_mcux_trng_init(struct device *dev) +static int entropy_mcux_trng_init(struct device *dev) { trng_config_t conf; status_t status; diff --git a/drivers/random/random_stm32_rng.c b/drivers/entropy/entropy_stm32.c similarity index 68% rename from drivers/random/random_stm32_rng.c rename to drivers/entropy/entropy_stm32.c index a17c0b61c7a..6c2efe4beca 100644 --- a/drivers/random/random_stm32_rng.c +++ b/drivers/entropy/entropy_stm32.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -17,22 +17,22 @@ #include #include -struct random_stm32_rng_dev_cfg { +struct entropy_stm32_rng_dev_cfg { struct stm32_pclken pclken; }; -struct random_stm32_rng_dev_data { +struct entropy_stm32_rng_dev_data { RNG_TypeDef *rng; struct device *clock; }; #define DEV_DATA(dev) \ - ((struct random_stm32_rng_dev_data *)(dev)->driver_data) + ((struct entropy_stm32_rng_dev_data *)(dev)->driver_data) #define DEV_CFG(dev) \ - ((struct random_stm32_rng_dev_cfg *)(dev)->config->config_info) + ((struct entropy_stm32_rng_dev_cfg *)(dev)->config->config_info) -static void random_stm32_rng_reset(RNG_TypeDef *rng) +static void entropy_stm32_rng_reset(RNG_TypeDef *rng) { __ASSERT_NO_MSG(rng != NULL); @@ -46,7 +46,7 @@ static void random_stm32_rng_reset(RNG_TypeDef *rng) LL_RNG_Enable(rng); } -static int random_stm32_got_error(RNG_TypeDef *rng) +static int entropy_stm32_got_error(RNG_TypeDef *rng) { __ASSERT_NO_MSG(rng != NULL); @@ -61,7 +61,7 @@ static int random_stm32_got_error(RNG_TypeDef *rng) return 0; } -static int random_stm32_wait_ready(RNG_TypeDef *rng) +static int entropy_stm32_wait_ready(RNG_TypeDef *rng) { /* Agording to the reference manual it takes 40 periods * of the RNG_CLK clock signal between two consecutive @@ -79,7 +79,7 @@ static int random_stm32_wait_ready(RNG_TypeDef *rng) __ASSERT_NO_MSG(rng != NULL); while (!LL_RNG_IsActiveFlag_DRDY(rng)) { - if (random_stm32_got_error(rng)) { + if (entropy_stm32_got_error(rng)) { return -EIO; } @@ -90,17 +90,17 @@ static int random_stm32_wait_ready(RNG_TypeDef *rng) k_yield(); } - if (random_stm32_got_error(rng)) { + if (entropy_stm32_got_error(rng)) { return -EIO; } else { return 0; } } -static int random_stm32_rng_get_entropy(struct device *dev, u8_t *buffer, - u16_t length) +static int entropy_stm32_rng_get_entropy(struct device *dev, u8_t *buffer, + u16_t length) { - struct random_stm32_rng_dev_data *dev_data; + struct entropy_stm32_rng_dev_data *dev_data; int n = sizeof(u32_t); int res; @@ -112,15 +112,15 @@ static int random_stm32_rng_get_entropy(struct device *dev, u8_t *buffer, __ASSERT_NO_MSG(dev_data != NULL); /* if the RNG has errors reset it before use */ - if (random_stm32_got_error(dev_data->rng)) { - random_stm32_rng_reset(dev_data->rng); + if (entropy_stm32_got_error(dev_data->rng)) { + entropy_stm32_rng_reset(dev_data->rng); } while (length > 0) { u32_t rndbits; u8_t *p_rndbits = (u8_t *)&rndbits; - res = random_stm32_wait_ready(dev_data->rng); + res = entropy_stm32_wait_ready(dev_data->rng); if (res < 0) return res; @@ -139,10 +139,10 @@ static int random_stm32_rng_get_entropy(struct device *dev, u8_t *buffer, return 0; } -static int random_stm32_rng_init(struct device *dev) +static int entropy_stm32_rng_init(struct device *dev) { - struct random_stm32_rng_dev_data *dev_data; - struct random_stm32_rng_dev_cfg *dev_cfg; + struct entropy_stm32_rng_dev_data *dev_data; + struct entropy_stm32_rng_dev_cfg *dev_cfg; __ASSERT_NO_MSG(dev != NULL); @@ -163,24 +163,24 @@ static int random_stm32_rng_init(struct device *dev) return 0; } -static const struct random_driver_api random_stm32_rng_api = { - .get_entropy = random_stm32_rng_get_entropy +static const struct entropy_driver_api entropy_stm32_rng_api = { + .get_entropy = entropy_stm32_rng_get_entropy }; -static const struct random_stm32_rng_dev_cfg random_stm32_rng_config = { +static const struct entropy_stm32_rng_dev_cfg entropy_stm32_rng_config = { .pclken = { .bus = STM32_CLOCK_BUS_AHB2, .enr = LL_AHB2_GRP1_PERIPH_RNG }, }; -static struct random_stm32_rng_dev_data random_stm32_rng_data = { +static struct entropy_stm32_rng_dev_data entropy_stm32_rng_data = { .rng = RNG, }; -DEVICE_AND_API_INIT(random_stm32_rng, CONFIG_RANDOM_NAME, - random_stm32_rng_init, - &random_stm32_rng_data, &random_stm32_rng_config, +DEVICE_AND_API_INIT(entropy_stm32_rng, CONFIG_ENTROPY_NAME, + entropy_stm32_rng_init, + &entropy_stm32_rng_data, &entropy_stm32_rng_config, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, - &random_stm32_rng_api); + &entropy_stm32_rng_api); u32_t sys_rand32_get(void) { @@ -193,4 +193,3 @@ u32_t sys_rand32_get(void) return output; } - diff --git a/drivers/ethernet/Kconfig.mcux b/drivers/ethernet/Kconfig.mcux index 6e5f0ba3994..295efab4a1b 100644 --- a/drivers/ethernet/Kconfig.mcux +++ b/drivers/ethernet/Kconfig.mcux @@ -72,7 +72,7 @@ config ETH_MCUX_0_IRQ_PRI config ETH_MCUX_0_RANDOM_MAC bool "Random MAC address" - depends on ETH_MCUX_0 && RANDOM_GENERATOR + depends on ETH_MCUX_0 && ENTROPY_GENERATOR default y help Generate a random MAC address dynamically. diff --git a/drivers/ethernet/Kconfig.stm32_hal b/drivers/ethernet/Kconfig.stm32_hal index 5a565f923a3..26a23d1eb84 100644 --- a/drivers/ethernet/Kconfig.stm32_hal +++ b/drivers/ethernet/Kconfig.stm32_hal @@ -50,7 +50,7 @@ config ETH_STM32_HAL_PHY_ADDRESS config ETH_STM32_HAL_RANDOM_MAC bool "Random MAC address" - depends on ETH_STM32_HAL && RANDOM_GENERATOR + depends on ETH_STM32_HAL && ENTROPY_GENERATOR default y help Generate a random MAC address dynamically. diff --git a/drivers/random/Kconfig b/drivers/random/Kconfig deleted file mode 100644 index 9d74b76b449..00000000000 --- a/drivers/random/Kconfig +++ /dev/null @@ -1,50 +0,0 @@ -# Kconfig - random generator driver configuration options - -# -# Copyright (c) 2014-2015 Wind River Systems, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -menuconfig RANDOM_GENERATOR - bool - prompt "Random Drivers" - default n - help - Include RANDOM drivers in system config. - -if RANDOM_GENERATOR - -source "drivers/random/Kconfig.mcux" -source "drivers/random/Kconfig.stm32" -source "drivers/random/Kconfig.esp32" - -config RANDOM_HAS_DRIVER - bool - default n - help - This is an option to be enabled by individual random driver - to signal that there is a true random driver. - -config RANDOM_NAME - string "Random Device Name" - depends on RANDOM_GENERATOR - default "RANDOM_0" - help - Specify the device name to be used for the RANDOM driver. - -config SYS_LOG_RANDOM_LEVEL - int "Random Log level" - depends on SYS_LOG && RANDOM_GENERATOR - default 0 - range 0 4 - help - Sets log level for random driver. - Levels are: - - 0 OFF: do not write - - 1 ERROR: only write SYS_LOG_ERR - - 2 WARNING: write SYS_LOG_WRN in addition to previous level - - 3 INFO: write SYS_LOG_INF in addition to previous levels - - 4 DEBUG: write SYS_LOG_DBG in addition to previous levels - -endif diff --git a/drivers/random/Kconfig.esp32 b/drivers/random/Kconfig.esp32 deleted file mode 100644 index 6b2208b2309..00000000000 --- a/drivers/random/Kconfig.esp32 +++ /dev/null @@ -1,17 +0,0 @@ -# Kconfig.esp32 - esp32 random generator driver configuration -# -# Copyright (c) 2017 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -config RANDOM_ESP32_RNG - bool "ESP32 random number generator driver" - depends on RANDOM_GENERATOR && SOC_ESP32 - default n - select RANDOM_HAS_DRIVER - help - This option enables the random number generator for ESP32 SoCs. - - With Wi-Fi and Bluetooth disabled, this will produce pseudo-random - numbers: noise from these radios are used to feed entropy in this - generator. diff --git a/drivers/random/Kconfig.stm32 b/drivers/random/Kconfig.stm32 deleted file mode 100644 index 72d0c61e902..00000000000 --- a/drivers/random/Kconfig.stm32 +++ /dev/null @@ -1,15 +0,0 @@ -# Kconfig.stm32 - STM32 random generator driver configuration -# -# Copyright (c) 2017 Erwin Rol -# -# SPDX-License-Identifier: Apache-2.0 - -menuconfig RANDOM_STM32_RNG - bool "STM32 RNG driver" - depends on RANDOM_GENERATOR - default n - select RANDOM_HAS_DRIVER - help - This option enables the RNG processor, which is a random number - generator, based on a continuous analog noise, that provides - a random 32-bit value to the host when read. diff --git a/drivers/random/Makefile b/drivers/random/Makefile deleted file mode 100644 index 4b533883d39..00000000000 --- a/drivers/random/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -obj-$(CONFIG_RANDOM_MCUX_RNGA) += random_mcux_rnga.o -obj-$(CONFIG_RANDOM_MCUX_TRNG) += random_mcux_trng.o -obj-$(CONFIG_RANDOM_STM32_RNG) += random_stm32_rng.o -obj-$(CONFIG_RANDOM_ESP32_RNG) += random_esp32.o - -obj-$(CONFIG_USERSPACE) += random_handlers.o diff --git a/drivers/random/random_handlers.c b/drivers/random/random_handlers.c deleted file mode 100644 index 215c0ea5c58..00000000000 --- a/drivers/random/random_handlers.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2017 Intel Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -_SYSCALL_HANDLER(random_get_entropy, dev, buffer, len) -{ - _SYSCALL_OBJ(dev, K_OBJ_DRIVER_RANDOM); - _SYSCALL_MEMORY_WRITE(buffer, len); - return _impl_random_get_entropy((struct device *)dev, (u8_t *)buffer, - len); -} diff --git a/ext/hal/nxp/mcux/drivers/Makefile b/ext/hal/nxp/mcux/drivers/Makefile index 41f764b8059..87f108b77a1 100644 --- a/ext/hal/nxp/mcux/drivers/Makefile +++ b/ext/hal/nxp/mcux/drivers/Makefile @@ -8,8 +8,8 @@ obj-$(CONFIG_ADC_MCUX_ADC16) += fsl_adc16.o obj-$(CONFIG_ETH_MCUX) += fsl_enet.o obj-$(CONFIG_I2C_MCUX) += fsl_i2c.o obj-$(CONFIG_PWM_MCUX_FTM) += fsl_ftm.o -obj-$(CONFIG_RANDOM_MCUX_RNGA) += fsl_rnga.o -obj-$(CONFIG_RANDOM_MCUX_TRNG) += fsl_trng.o +obj-$(CONFIG_ENTROPY_MCUX_RNGA) += fsl_rnga.o +obj-$(CONFIG_ENTROPY_MCUX_TRNG) += fsl_trng.o obj-$(CONFIG_SOC_FLASH_MCUX) += fsl_flash.o obj-$(CONFIG_SPI_MCUX_DSPI) += fsl_dspi.o obj-$(CONFIG_UART_MCUX) += fsl_uart.o diff --git a/ext/hal/st/stm32cube/Kbuild b/ext/hal/st/stm32cube/Kbuild index 70d9d365a1b..f8fdf8e7d18 100644 --- a/ext/hal/st/stm32cube/Kbuild +++ b/ext/hal/st/stm32cube/Kbuild @@ -34,7 +34,7 @@ obj-$(CONFIG_CLOCK_CONTROL_STM32_CUBE) += stm32f4xx/drivers/src/stm32f4xx_ll_uti obj-$(CONFIG_PWM) += stm32f4xx/drivers/src/stm32f4xx_hal_tim.o obj-$(CONFIG_I2C) += stm32f4xx/drivers/src/stm32f4xx_ll_i2c.o obj-$(CONFIG_SPI_STM32) += stm32f4xx/drivers/src/stm32f4xx_ll_spi.o -obj-$(CONFIG_RANDOM_STM32_RNG) += stm32f4xx/drivers/src/stm32f4xx_ll_rng.o +obj-$(CONFIG_ENTROPY_STM32_RNG) += stm32f4xx/drivers/src/stm32f4xx_ll_rng.o obj-$(CONFIG_ETH_STM32_HAL) += stm32f4xx/drivers/src/stm32f4xx_hal_eth.o obj-$(CONFIG_USB_DC_STM32) += stm32f4xx/drivers/src/stm32f4xx_ll_usb.o \ stm32f4xx/drivers/src/stm32f4xx_hal_pcd.o \ diff --git a/ext/lib/crypto/tinycrypt/Kconfig b/ext/lib/crypto/tinycrypt/Kconfig index 9919ea9fad6..59b95a97986 100644 --- a/ext/lib/crypto/tinycrypt/Kconfig +++ b/ext/lib/crypto/tinycrypt/Kconfig @@ -53,7 +53,7 @@ config TINYCRYPT_ECC_DH bool prompt "ECC_DH anonymous key agreement protocol" depends on TINYCRYPT - select RANDOM_GENERATOR + select ENTROPY_GENERATOR default n help This option enables support for the Elliptic curve @@ -66,7 +66,7 @@ config TINYCRYPT_ECC_DSA bool prompt "ECC_DSA digital signature algorithm" depends on TINYCRYPT - select RANDOM_GENERATOR + select ENTROPY_GENERATOR default n help This option enables support for the Elliptic Curve Digital diff --git a/include/entropy.h b/include/entropy.h new file mode 100644 index 00000000000..587e0968436 --- /dev/null +++ b/include/entropy.h @@ -0,0 +1,77 @@ +/** + * @file entropy.h + * + * @brief Public APIs for the entropy driver. + */ + +/* + * Copyright (c) 2016 ARM Ltd. + * Copyright (c) 2017 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef __ENTROPY_H__ +#define __ENTROPY_H__ + +/** + * @brief Entropy Interface + * @defgroup entropy_interface Entropy Interface + * @ingroup io_interfaces + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** + * @typedef entropy_get_entropy_t + * @brief Callback API to get entropy. + * + * See entropy_get_entropy() for argument description + */ +typedef int (*entropy_get_entropy_t)(struct device *dev, + u8_t *buffer, + u16_t length); + +struct entropy_driver_api { + entropy_get_entropy_t get_entropy; +}; + +/** + * @brief Fills a buffer with entropy. + * + * @param dev Pointer to the entropy device. + * @param buffer Buffer to fill with entropy. + * @param length Buffer length. + * @retval 0 on success. + * @retval -ERRNO errno code on error. + */ +__syscall int entropy_get_entropy(struct device *dev, + u8_t *buffer, + u16_t length); + +static inline int _impl_entropy_get_entropy(struct device *dev, + u8_t *buffer, + u16_t length) +{ + const struct entropy_driver_api *api = dev->driver_api; + + __ASSERT(api->get_entropy, "Callback pointer should not be NULL"); + return api->get_entropy(dev, buffer, length); +} + +#ifdef __cplusplus +} +#endif + +/** + * @} + */ + +#include + +#endif /* __ENTROPY_H__ */ diff --git a/include/kernel.h b/include/kernel.h index a5598e1cad1..3a2d9647926 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -156,7 +156,7 @@ enum k_objects { K_OBJ_DRIVER_IPM, K_OBJ_DRIVER_PINMUX, K_OBJ_DRIVER_PWM, - K_OBJ_DRIVER_RANDOM, + K_OBJ_DRIVER_ENTROPY, K_OBJ_DRIVER_RTC, K_OBJ_DRIVER_SENSOR, K_OBJ_DRIVER_SPI, diff --git a/include/random.h b/include/random.h deleted file mode 100644 index d78f9e1e64d..00000000000 --- a/include/random.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file random.h - * - * @brief Public APIs for the random driver. - */ - -/* - * Copyright (c) 2016 ARM Ltd. - * - * SPDX-License-Identifier: Apache-2.0 - */ -#ifndef __RANDOM_H__ -#define __RANDOM_H__ - -/** - * @brief Random Interface - * @defgroup random_interface Random Interface - * @ingroup io_interfaces - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -/** - * @typedef random_get_entropy_t - * @brief Callback API to get entropy. - * - * See random_get_entropy() for argument description - */ -typedef int (*random_get_entropy_t)(struct device *dev, - u8_t *buffer, - u16_t length); - -struct random_driver_api { - random_get_entropy_t get_entropy; -}; - -/** - * @brief Get entropy from the random driver. - * - * Fill a buffer with entropy from the random driver. - * - * @param dev Pointer to the random device. - * @param buffer Buffer to fill with entropy. - * @param length Buffer length. - * @retval 0 on success. - * @retval -ERRNO errno code on error. - */ -__syscall int random_get_entropy(struct device *dev, u8_t *buffer, - u16_t length); - -static inline int _impl_random_get_entropy(struct device *dev, - u8_t *buffer, - u16_t length) -{ - const struct random_driver_api *api = dev->driver_api; - - __ASSERT(api->get_entropy, "Callback pointer should not be NULL"); - return api->get_entropy(dev, buffer, length); -} - -#ifdef __cplusplus -} -#endif - -/** - * @} - */ - -#include - -#endif /* __RANDOM_H__ */ diff --git a/kernel/userspace.c b/kernel/userspace.c index a4bc5c318b0..8f333e65c32 100644 --- a/kernel/userspace.c +++ b/kernel/userspace.c @@ -67,8 +67,8 @@ const char *otype_to_str(enum k_objects otype) return "pinmux driver"; case K_OBJ_DRIVER_PWM: return "pwm driver"; - case K_OBJ_DRIVER_RANDOM: - return "random driver"; + case K_OBJ_DRIVER_ENTROPY: + return "entropy driver"; case K_OBJ_DRIVER_RTC: return "realtime clock driver"; case K_OBJ_DRIVER_SENSOR: diff --git a/samples/bluetooth/peripheral_csc/prj.conf b/samples/bluetooth/peripheral_csc/prj.conf index 4c954d3d269..70c94ab553a 100644 --- a/samples/bluetooth/peripheral_csc/prj.conf +++ b/samples/bluetooth/peripheral_csc/prj.conf @@ -1,4 +1,4 @@ -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_BT=y CONFIG_BT_PERIPHERAL=y diff --git a/samples/drivers/random/Makefile b/samples/drivers/entropy/Makefile similarity index 100% rename from samples/drivers/random/Makefile rename to samples/drivers/entropy/Makefile diff --git a/samples/drivers/random/README.txt b/samples/drivers/entropy/README.txt similarity index 77% rename from samples/drivers/random/README.txt rename to samples/drivers/entropy/README.txt index 2eb4890e77d..ebe2f0d1e14 100644 --- a/samples/drivers/random/README.txt +++ b/samples/drivers/entropy/README.txt @@ -1,8 +1,8 @@ -Title: Random +Title: Entropy Description: -A simple random number generation example +Sample for the entropy gathering driver -------------------------------------------------------------------------------- @@ -17,7 +17,7 @@ It can be built and executed on frdm_k64f as follows: Sample Output: -Random Example! arm -random device is 0x2000008c, name is RANDOM_0 +Entropy Example! arm +entropy device is 0x2000008c, name is ENTROPY_0 0xd7 0x42 0xb0 0x7b 0x56 0x3b 0xc3 0x43 0x8a 0xa3 0xfa 0xec 0xd8 0xc3 0x36 0xf8 0x7b 0x82 0x2b 0x39 diff --git a/samples/drivers/entropy/prj.conf b/samples/drivers/entropy/prj.conf new file mode 100644 index 00000000000..b28851c98f5 --- /dev/null +++ b/samples/drivers/entropy/prj.conf @@ -0,0 +1,2 @@ +CONFIG_ENTROPY_GENERATOR=y +CONFIG_STDOUT_CONSOLE=y diff --git a/samples/drivers/random/sample.yaml b/samples/drivers/entropy/sample.yaml similarity index 100% rename from samples/drivers/random/sample.yaml rename to samples/drivers/entropy/sample.yaml diff --git a/samples/drivers/random/src/Makefile b/samples/drivers/entropy/src/Makefile similarity index 100% rename from samples/drivers/random/src/Makefile rename to samples/drivers/entropy/src/Makefile diff --git a/samples/drivers/random/src/main.c b/samples/drivers/entropy/src/main.c similarity index 67% rename from samples/drivers/random/src/main.c rename to samples/drivers/entropy/src/main.c index 0f15204dedc..460f2abf844 100644 --- a/samples/drivers/random/src/main.c +++ b/samples/drivers/entropy/src/main.c @@ -5,22 +5,22 @@ */ #include -#include +#include #include void main(void) { struct device *dev; - printf("Random Example! %s\n", CONFIG_ARCH); + printf("Entropy Example! %s\n", CONFIG_ARCH); - dev = device_get_binding(CONFIG_RANDOM_NAME); + dev = device_get_binding(CONFIG_ENTROPY_NAME); if (!dev) { - printf("error: no random device\n"); + printf("error: no entropy device\n"); return; } - printf("random device is %p, name is %s\n", + printf("entropy device is %p, name is %s\n", dev, dev->config->name); while (1) { @@ -34,14 +34,14 @@ void main(void) * outside the passed buffer, and that should never * happen. */ - r = random_get_entropy(dev, buffer, BUFFER_LENGTH-1); + r = entropy_get_entropy(dev, buffer, BUFFER_LENGTH-1); if (r) { - printf("random_get_entropy failed: %d\n", r); + printf("entropy_get_entropy failed: %d\n", r); break; } if (buffer[BUFFER_LENGTH-1] != 0) { - printf("random_get_entropy buffer overflow\n"); + printf("entropy_get_entropy buffer overflow\n"); } for (int i = 0; i < BUFFER_LENGTH-1; i++) { diff --git a/samples/drivers/random/prj.conf b/samples/drivers/random/prj.conf deleted file mode 100644 index f9c66d0afea..00000000000 --- a/samples/drivers/random/prj.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_RANDOM_GENERATOR=y -CONFIG_STDOUT_CONSOLE=y diff --git a/samples/net/coap_client/prj.conf b/samples/net/coap_client/prj.conf index 6e6beaed77a..8afb4f24e16 100644 --- a/samples/net/coap_client/prj.conf +++ b/samples/net/coap_client/prj.conf @@ -4,7 +4,7 @@ CONFIG_NET_LOG=y CONFIG_NET_UDP=y CONFIG_SYS_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_COAP=y diff --git a/samples/net/coap_client/prj_bt.conf b/samples/net/coap_client/prj_bt.conf index ac7f224f1c8..72e81a0926d 100644 --- a/samples/net/coap_client/prj_bt.conf +++ b/samples/net/coap_client/prj_bt.conf @@ -4,7 +4,7 @@ CONFIG_NET_LOG=y CONFIG_NET_UDP=y CONFIG_SYS_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_COAP=y CONFIG_NET_L2_BT=y diff --git a/samples/net/coap_server/prj.conf b/samples/net/coap_server/prj.conf index d9c6f812851..be7e90b7069 100644 --- a/samples/net/coap_server/prj.conf +++ b/samples/net/coap_server/prj.conf @@ -4,7 +4,7 @@ CONFIG_NET_LOG=y CONFIG_NET_UDP=y CONFIG_SYS_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_COAP=y CONFIG_NET_APP_SETTINGS=y diff --git a/samples/net/coap_server/prj_bt.conf b/samples/net/coap_server/prj_bt.conf index 9aaf4e8819e..8a7858a3810 100644 --- a/samples/net/coap_server/prj_bt.conf +++ b/samples/net/coap_server/prj_bt.conf @@ -15,6 +15,6 @@ CONFIG_NET_DEBUG_L2_BT=y CONFIG_NET_APP_BT_NODE=y CONFIG_SYS_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_COAP=y diff --git a/samples/net/dns_resolve/prj.conf b/samples/net/dns_resolve/prj.conf index 83d325569c8..bd76f6dfc84 100644 --- a/samples/net/dns_resolve/prj.conf +++ b/samples/net/dns_resolve/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_UDP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_INIT_STACKS=y CONFIG_NET_PKT_RX_COUNT=10 diff --git a/samples/net/echo_server/prj_qemu_x86.conf b/samples/net/echo_server/prj_qemu_x86.conf index 6dbfef2b7ab..df73d92d473 100644 --- a/samples/net/echo_server/prj_qemu_x86.conf +++ b/samples/net/echo_server/prj_qemu_x86.conf @@ -5,7 +5,7 @@ CONFIG_NET_IPV6=y CONFIG_NET_IPV4=y #CONFIG_NET_DHCPV4=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_INIT_STACKS=y diff --git a/samples/net/http_client/prj.conf b/samples/net/http_client/prj.conf index 6bc82f1c3fc..2a9c88b5013 100644 --- a/samples/net/http_client/prj.conf +++ b/samples/net/http_client/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/http_client/prj_bt.conf b/samples/net/http_client/prj_bt.conf index 9e11e485528..5e622dee7e5 100644 --- a/samples/net/http_client/prj_bt.conf +++ b/samples/net/http_client/prj_bt.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/http_server/prj.conf b/samples/net/http_server/prj.conf index 62bf0ad14bb..d43116d05c4 100644 --- a/samples/net/http_server/prj.conf +++ b/samples/net/http_server/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/http_server/prj_bt.conf b/samples/net/http_server/prj_bt.conf index 7c5af5974ab..b834dc9d425 100644 --- a/samples/net/http_server/prj_bt.conf +++ b/samples/net/http_server/prj_bt.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/http_server/prj_netusb.conf b/samples/net/http_server/prj_netusb.conf index ef8756c1629..565131b4e1d 100644 --- a/samples/net/http_server/prj_netusb.conf +++ b/samples/net/http_server/prj_netusb.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/https_client/prj.conf b/samples/net/https_client/prj.conf index c6dc94676f3..85ad82f12ca 100644 --- a/samples/net/https_client/prj.conf +++ b/samples/net/https_client/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/https_client/prj_bt.conf b/samples/net/https_client/prj_bt.conf index 96fb76b1dab..6b66c941098 100644 --- a/samples/net/https_client/prj_bt.conf +++ b/samples/net/https_client/prj_bt.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/leds_demo/prj.conf b/samples/net/leds_demo/prj.conf index 708b60c2477..f8e785f5330 100644 --- a/samples/net/leds_demo/prj.conf +++ b/samples/net/leds_demo/prj.conf @@ -5,7 +5,7 @@ CONFIG_NET_LOG=y CONFIG_NET_UDP=y CONFIG_SYS_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_COAP=y CONFIG_NET_APP_SETTINGS=y diff --git a/samples/net/mdns_responder/prj.conf b/samples/net/mdns_responder/prj.conf index 7fd1aca4d3b..76a5645fe1b 100644 --- a/samples/net/mdns_responder/prj.conf +++ b/samples/net/mdns_responder/prj.conf @@ -11,7 +11,7 @@ CONFIG_NET_HOSTNAME="zephyr" CONFIG_MDNS_RESPONDER=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_INIT_STACKS=y diff --git a/samples/net/mqtt_publisher/prj_96b_nitrogen.conf b/samples/net/mqtt_publisher/prj_96b_nitrogen.conf index c21a3be981a..6ecfc4c0309 100644 --- a/samples/net/mqtt_publisher/prj_96b_nitrogen.conf +++ b/samples/net/mqtt_publisher/prj_96b_nitrogen.conf @@ -37,7 +37,7 @@ CONFIG_MQTT_LIB=y CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TIMER_RANDOM_GENERATOR=y diff --git a/samples/net/mqtt_publisher/prj_frdm_k64f.conf b/samples/net/mqtt_publisher/prj_frdm_k64f.conf index 39697433b2f..f3124e2aab9 100644 --- a/samples/net/mqtt_publisher/prj_frdm_k64f.conf +++ b/samples/net/mqtt_publisher/prj_frdm_k64f.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_NET_ARP=y CONFIG_NET_L2_ETHERNET=y CONFIG_NET_LOG=y diff --git a/samples/net/mqtt_publisher/prj_frdm_k64f_tls.conf b/samples/net/mqtt_publisher/prj_frdm_k64f_tls.conf index b76843f6d24..6b2e46ba9d9 100644 --- a/samples/net/mqtt_publisher/prj_frdm_k64f_tls.conf +++ b/samples/net/mqtt_publisher/prj_frdm_k64f_tls.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_NET_ARP=y CONFIG_NET_L2_ETHERNET=y CONFIG_NET_LOG=y diff --git a/samples/net/mqtt_publisher/prj_qemu_x86.conf b/samples/net/mqtt_publisher/prj_qemu_x86.conf index 85270372185..611fb60d677 100644 --- a/samples/net/mqtt_publisher/prj_qemu_x86.conf +++ b/samples/net/mqtt_publisher/prj_qemu_x86.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/samples/net/rpl-node/prj.conf b/samples/net/rpl-node/prj.conf index 02fde29c40b..7cf74350ddc 100644 --- a/samples/net/rpl-node/prj.conf +++ b/samples/net/rpl-node/prj.conf @@ -2,7 +2,7 @@ CONFIG_ARC_INIT=n CONFIG_NETWORKING=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_PKT_RX_COUNT=15 diff --git a/samples/net/wpan_serial/prj.conf b/samples/net/wpan_serial/prj.conf index 1ac02e017f1..2347e64d46f 100644 --- a/samples/net/wpan_serial/prj.conf +++ b/samples/net/wpan_serial/prj.conf @@ -22,5 +22,5 @@ CONFIG_SYS_LOG=y CONFIG_SYS_LOG_DEFAULT_LEVEL=3 CONFIG_SYS_LOG_IEEE802154_DRIVER_LEVEL=1 -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/scripts/gen_kobject_list.py b/scripts/gen_kobject_list.py index b0436f91caf..895ef25469d 100755 --- a/scripts/gen_kobject_list.py +++ b/scripts/gen_kobject_list.py @@ -45,7 +45,7 @@ subsystems = [ "ipm_driver_api", "pinmux_driver_api", "pwm_driver_api", - "random_driver_api", + "entropy_driver_api", "rtc_driver_api", "sensor_driver_api", "spi_driver_api", diff --git a/subsys/net/Kconfig b/subsys/net/Kconfig index 23162970339..dfb60ac1f0c 100644 --- a/subsys/net/Kconfig +++ b/subsys/net/Kconfig @@ -74,7 +74,7 @@ config NETWORKING bool "Link layer and IP networking support" select NET_BUF select POLL - select RANDOM_GENERATOR + select ENTROPY_GENERATOR default n help This option enabled generic link layer and IP networking support. diff --git a/subsys/random/Kconfig b/subsys/random/Kconfig index dacc90408f7..2157066cf55 100644 --- a/subsys/random/Kconfig +++ b/subsys/random/Kconfig @@ -8,7 +8,7 @@ config TEST_RANDOM_GENERATOR bool prompt "Non-random number generator" - depends on RANDOM_GENERATOR && ! RANDOM_HAS_DRIVER + depends on !ENTROPY_HAS_DRIVER default n help This option signifies that the kernel's random number APIs are diff --git a/tests/crypto/ecc_dh/prj.conf b/tests/crypto/ecc_dh/prj.conf index 7f122a3a0e2..538fd550049 100644 --- a/tests/crypto/ecc_dh/prj.conf +++ b/tests/crypto/ecc_dh/prj.conf @@ -1,4 +1,4 @@ -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TINYCRYPT=y diff --git a/tests/crypto/ecc_dsa/prj.conf b/tests/crypto/ecc_dsa/prj.conf index b190985e088..0e54feb6c00 100644 --- a/tests/crypto/ecc_dsa/prj.conf +++ b/tests/crypto/ecc_dsa/prj.conf @@ -1,4 +1,4 @@ -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TINYCRYPT=y diff --git a/tests/drivers/build_all/ethernet.conf b/tests/drivers/build_all/ethernet.conf index a60d04483ed..f0f38833e86 100644 --- a/tests/drivers/build_all/ethernet.conf +++ b/tests/drivers/build_all/ethernet.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_L2_ETHERNET=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y # No board will enable the generic SPI hosted enc28j60 driver by diff --git a/tests/drivers/enc28j60/prj.conf b/tests/drivers/enc28j60/prj.conf index eb50b1f6b4e..44cef663d75 100644 --- a/tests/drivers/enc28j60/prj.conf +++ b/tests/drivers/enc28j60/prj.conf @@ -6,5 +6,5 @@ CONFIG_ETH_ENC28J60_0=y CONFIG_ETH_ENC28J60_0_MAC2=0x02 CONFIG_ETH_ENC28J60_0_MAC3=0xde CONFIG_ETH_ENC28J60_0_MAC4=0xad -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/drivers/entropy/api/prj.conf b/tests/drivers/entropy/api/prj.conf index d17e8a30c2d..a33b10382d4 100644 --- a/tests/drivers/entropy/api/prj.conf +++ b/tests/drivers/entropy/api/prj.conf @@ -1,2 +1,2 @@ -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_ZTEST=y diff --git a/tests/drivers/entropy/api/src/main.c b/tests/drivers/entropy/api/src/main.c index 97186336e6c..35120a45e18 100644 --- a/tests/drivers/entropy/api/src/main.c +++ b/tests/drivers/entropy/api/src/main.c @@ -3,13 +3,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -#include +#include #include /* * @addtogroup t_entropy_api * @{ - * @defgroup t_random_get_entropy test_random_get_entropy + * @defgroup t_entropy_get_entropy test_entropy_get_entropy * @brief TestPurpose: verify Get entropy works * @details * - Test Steps @@ -37,13 +37,13 @@ static int random_entropy(struct device *dev, char *buffer, char num) * outside the passed buffer, and that should never * happen. */ - ret = random_get_entropy(dev, buffer, BUFFER_LENGTH - 1); + ret = entropy_get_entropy(dev, buffer, BUFFER_LENGTH - 1); if (ret) { - TC_PRINT("Error: random_get_entropy failed: %d\n", ret); + TC_PRINT("Error: entropy_get_entropy failed: %d\n", ret); return TC_FAIL; } if (buffer[BUFFER_LENGTH - 1] != num) { - TC_PRINT("Error: random_get_entropy buffer overflow\n"); + TC_PRINT("Error: entropy_get_entropy buffer overflow\n"); return TC_FAIL; } @@ -71,7 +71,7 @@ static int get_entropy(void) u8_t buffer[BUFFER_LENGTH] = { 0 }; int ret; - dev = device_get_binding(CONFIG_RANDOM_NAME); + dev = device_get_binding(CONFIG_ENTROPY_NAME); if (!dev) { TC_PRINT("error: no random device\n"); return TC_FAIL; @@ -98,7 +98,7 @@ static int get_entropy(void) return ret; } -static void test_random_get_entropy(void) +static void test_entropy_get_entropy(void) { zassert_true(get_entropy() == TC_PASS, NULL); } @@ -106,6 +106,6 @@ static void test_random_get_entropy(void) void test_main(void) { ztest_test_suite(entropy_api, - ztest_unit_test(test_random_get_entropy)); + ztest_unit_test(test_entropy_get_entropy)); ztest_run_test_suite(entropy_api); } diff --git a/tests/drivers/entropy/api/testcase.yaml b/tests/drivers/entropy/api/testcase.yaml index a9aed6e6b96..005e451a281 100644 --- a/tests/drivers/entropy/api/testcase.yaml +++ b/tests/drivers/entropy/api/testcase.yaml @@ -1,4 +1,4 @@ tests: - test_get_entropy: - filter: CONFIG_RANDOM_HAS_DRIVER + filter: CONFIG_ENTROPY_HAS_DRIVER tags: driver diff --git a/tests/drivers/gpio/gpio_basic_api/prj.conf b/tests/drivers/gpio/gpio_basic_api/prj.conf index af5eeabb13e..505646e5469 100644 --- a/tests/drivers/gpio/gpio_basic_api/prj.conf +++ b/tests/drivers/gpio/gpio_basic_api/prj.conf @@ -1,4 +1,4 @@ CONFIG_GPIO=y CONFIG_ZTEST=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/kernel/common/prj.conf b/tests/kernel/common/prj.conf index d7b0e86a0a6..41deccab77e 100644 --- a/tests/kernel/common/prj.conf +++ b/tests/kernel/common/prj.conf @@ -2,6 +2,6 @@ CONFIG_ZTEST=y CONFIG_RING_BUFFER=y CONFIG_PRINTK=y CONFIG_SYS_LOG=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_POLL=y diff --git a/tests/kernel/mem_protect/stackprot/prj.conf b/tests/kernel/mem_protect/stackprot/prj.conf index e1a8496f311..a3b47f0628f 100644 --- a/tests/kernel/mem_protect/stackprot/prj.conf +++ b/tests/kernel/mem_protect/stackprot/prj.conf @@ -1,4 +1,4 @@ CONFIG_STACK_CANARIES=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_MAIN_THREAD_PRIORITY=7 diff --git a/tests/net/6lo/prj.conf b/tests/net/6lo/prj.conf index 9b1cea7ace6..80a4182fd30 100644 --- a/tests/net/6lo/prj.conf +++ b/tests/net/6lo/prj.conf @@ -7,7 +7,7 @@ CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n CONFIG_NET_6LO=y CONFIG_NET_BUF=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_MAIN_STACK_SIZE=5048 CONFIG_NET_PKT_RX_COUNT=1 diff --git a/tests/net/all/prj.conf b/tests/net/all/prj.conf index 201fbb17518..91f1f2873dd 100644 --- a/tests/net/all/prj.conf +++ b/tests/net/all/prj.conf @@ -5,7 +5,7 @@ # Generic options that are useful to be active CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST=y diff --git a/tests/net/app/prj-no-ipv4.conf b/tests/net/app/prj-no-ipv4.conf index bd8b99ea613..ba2cba6cb3a 100644 --- a/tests/net/app/prj-no-ipv4.conf +++ b/tests/net/app/prj-no-ipv4.conf @@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n diff --git a/tests/net/app/prj-no-ipv6.conf b/tests/net/app/prj-no-ipv6.conf index a8db32f3d0c..c14a34640e2 100644 --- a/tests/net/app/prj-no-ipv6.conf +++ b/tests/net/app/prj-no-ipv6.conf @@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_PKT_TX_COUNT=10 CONFIG_NET_PKT_RX_COUNT=10 diff --git a/tests/net/app/prj-with-dns.conf b/tests/net/app/prj-with-dns.conf index 6e4eaaf8bb5..1809a8740a9 100644 --- a/tests/net/app/prj-with-dns.conf +++ b/tests/net/app/prj-with-dns.conf @@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n diff --git a/tests/net/app/prj.conf b/tests/net/app/prj.conf index f0f6d9cd6b4..3281b2a2c0a 100644 --- a/tests/net/app/prj.conf +++ b/tests/net/app/prj.conf @@ -9,7 +9,7 @@ CONFIG_NET_MAX_CONTEXTS=10 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n diff --git a/tests/net/arp/prj.conf b/tests/net/arp/prj.conf index 57ca6bcb375..2c5067436dd 100644 --- a/tests/net/arp/prj.conf +++ b/tests/net/arp/prj.conf @@ -11,7 +11,7 @@ CONFIG_NET_BUF_RX_COUNT=5 CONFIG_NET_BUF_TX_COUNT=5 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3 CONFIG_NET_DEBUG_ARP=y diff --git a/tests/net/context/prj.conf b/tests/net/context/prj.conf index 259bf4faba7..bdd5778ce8b 100644 --- a/tests/net/context/prj.conf +++ b/tests/net/context/prj.conf @@ -10,7 +10,7 @@ CONFIG_NET_CONTEXT_SYNC_RECV=y CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_DAD=n diff --git a/tests/net/dhcpv4/prj.conf b/tests/net/dhcpv4/prj.conf index 163ce6f5f0f..fd6edfc8375 100644 --- a/tests/net/dhcpv4/prj.conf +++ b/tests/net/dhcpv4/prj.conf @@ -10,7 +10,7 @@ CONFIG_NET_BUF_RX_COUNT=7 CONFIG_NET_BUF_TX_COUNT=7 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1 CONFIG_NET_DEBUG_IF=y diff --git a/tests/net/icmpv6/prj.conf b/tests/net/icmpv6/prj.conf index d0dba070db2..357268c8b13 100644 --- a/tests/net/icmpv6/prj.conf +++ b/tests/net/icmpv6/prj.conf @@ -10,6 +10,6 @@ CONFIG_NET_BUF_RX_COUNT=5 CONFIG_NET_BUF_TX_COUNT=5 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST=y diff --git a/tests/net/ieee802154/fragment/prj.conf b/tests/net/ieee802154/fragment/prj.conf index a97504e7eeb..cb7cdda9c3a 100644 --- a/tests/net/ieee802154/fragment/prj.conf +++ b/tests/net/ieee802154/fragment/prj.conf @@ -6,7 +6,7 @@ CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_DAD=n CONFIG_NET_L2_IEEE802154=y CONFIG_NET_BUF=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_MAIN_STACK_SIZE=8192 CONFIG_NET_PKT_RX_COUNT=2 diff --git a/tests/net/ieee802154/l2/prj.conf b/tests/net/ieee802154/l2/prj.conf index 2a5f604150f..566c849117c 100644 --- a/tests/net/ieee802154/l2/prj.conf +++ b/tests/net/ieee802154/l2/prj.conf @@ -14,7 +14,7 @@ CONFIG_NET_BUF_TX_COUNT=10 CONFIG_NET_LOG=y CONFIG_SYS_LOG_NET_LEVEL=1 CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_DEBUG_IPV6=y CONFIG_ZTEST=y diff --git a/tests/net/iface/prj.conf b/tests/net/iface/prj.conf index 06d4cfe9b4b..1c43e10f0c2 100644 --- a/tests/net/iface/prj.conf +++ b/tests/net/iface/prj.conf @@ -8,7 +8,7 @@ CONFIG_NET_MAX_CONTEXTS=4 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n diff --git a/tests/net/ip-addr/prj.conf b/tests/net/ip-addr/prj.conf index 653a2eb90f3..f635299e277 100644 --- a/tests/net/ip-addr/prj.conf +++ b/tests/net/ip-addr/prj.conf @@ -13,7 +13,7 @@ CONFIG_NET_BUF_RX_COUNT=5 CONFIG_NET_BUF_TX_COUNT=5 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3 CONFIG_NET_IF_MCAST_IPV4_ADDR_COUNT=3 diff --git a/tests/net/ipv6/prj.conf b/tests/net/ipv6/prj.conf index 831f4afc07a..d19a8dd743e 100644 --- a/tests/net/ipv6/prj.conf +++ b/tests/net/ipv6/prj.conf @@ -7,7 +7,7 @@ CONFIG_NET_IPV4=n CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_ND=y CONFIG_NET_IPV6_DAD=y diff --git a/tests/net/ipv6_fragment/prj.conf b/tests/net/ipv6_fragment/prj.conf index c84aeeb00cc..0842b5da36e 100644 --- a/tests/net/ipv6_fragment/prj.conf +++ b/tests/net/ipv6_fragment/prj.conf @@ -8,7 +8,7 @@ CONFIG_NET_MAX_CONTEXTS=4 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n diff --git a/tests/net/lib/coap/prj.conf b/tests/net/lib/coap/prj.conf index 21d11421395..4fe547cbe02 100644 --- a/tests/net/lib/coap/prj.conf +++ b/tests/net/lib/coap/prj.conf @@ -6,7 +6,7 @@ CONFIG_NET_TCP=n CONFIG_NET_IPV4=n CONFIG_NET_BUF_LOG=y CONFIG_SYS_LOG_NET_BUF_LEVEL=2 -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_COAP=y CONFIG_COAP_TEST_API_ENABLE=y diff --git a/tests/net/lib/dns_packet/prj.conf b/tests/net/lib/dns_packet/prj.conf index 88546884578..7f6fd074ee3 100644 --- a/tests/net/lib/dns_packet/prj.conf +++ b/tests/net/lib/dns_packet/prj.conf @@ -3,7 +3,7 @@ CONFIG_NETWORKING=y CONFIG_NET_TEST=y # native IP stack support -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_DNS_RESOLVER=y diff --git a/tests/net/lib/dns_resolve/prj-no-ipv6.conf b/tests/net/lib/dns_resolve/prj-no-ipv6.conf index e1d0e8ffd7d..10d4d6f9b6e 100644 --- a/tests/net/lib/dns_resolve/prj-no-ipv6.conf +++ b/tests/net/lib/dns_resolve/prj-no-ipv6.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TEST=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_L2_DUMMY=y diff --git a/tests/net/lib/dns_resolve/prj.conf b/tests/net/lib/dns_resolve/prj.conf index 7c0c58e2cb9..c39ca02bdca 100644 --- a/tests/net/lib/dns_resolve/prj.conf +++ b/tests/net/lib/dns_resolve/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TEST=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_L2_DUMMY=y diff --git a/tests/net/lib/http_header_fields/prj.conf b/tests/net/lib/http_header_fields/prj.conf index c641e81f3d4..3f43c94aa52 100644 --- a/tests/net/lib/http_header_fields/prj.conf +++ b/tests/net/lib/http_header_fields/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TEST=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST_STACKSIZE=320 CONFIG_HTTP_PARSER=y diff --git a/tests/net/lib/mqtt_packet/prj.conf b/tests/net/lib/mqtt_packet/prj.conf index d3205f1279a..3e675397bfa 100644 --- a/tests/net/lib/mqtt_packet/prj.conf +++ b/tests/net/lib/mqtt_packet/prj.conf @@ -3,7 +3,7 @@ CONFIG_NETWORKING=y CONFIG_NET_TEST=y # native IP stack support -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y # enable the MQTT lib diff --git a/tests/net/lib/mqtt_publisher/prj.conf b/tests/net/lib/mqtt_publisher/prj.conf index 4ba5fcb150d..d73e9cde464 100644 --- a/tests/net/lib/mqtt_publisher/prj.conf +++ b/tests/net/lib/mqtt_publisher/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/net/lib/mqtt_publisher/prj_tls.conf b/tests/net/lib/mqtt_publisher/prj_tls.conf index 6736a1fa777..95ada4710f9 100644 --- a/tests/net/lib/mqtt_publisher/prj_tls.conf +++ b/tests/net/lib/mqtt_publisher/prj_tls.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_NET_ARP=y CONFIG_NET_L2_ETHERNET=y CONFIG_NET_LOG=y diff --git a/tests/net/lib/mqtt_subscriber/prj.conf b/tests/net/lib/mqtt_subscriber/prj.conf index 47f83e75a9d..fb4a61e083c 100644 --- a/tests/net/lib/mqtt_subscriber/prj.conf +++ b/tests/net/lib/mqtt_subscriber/prj.conf @@ -1,6 +1,6 @@ CONFIG_NETWORKING=y CONFIG_NET_TCP=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_LOG=y CONFIG_INIT_STACKS=y diff --git a/tests/net/mgmt/prj.conf b/tests/net/mgmt/prj.conf index 4771f35b085..e42ef16ba4b 100644 --- a/tests/net/mgmt/prj.conf +++ b/tests/net/mgmt/prj.conf @@ -8,7 +8,7 @@ CONFIG_NET_BUF_RX_COUNT=5 CONFIG_NET_BUF_TX_COUNT=5 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_MGMT=y CONFIG_NET_MGMT_EVENT=y diff --git a/tests/net/mld/prj.conf b/tests/net/mld/prj.conf index cf279de4d6f..b9c416fe1bc 100644 --- a/tests/net/mld/prj.conf +++ b/tests/net/mld/prj.conf @@ -8,7 +8,7 @@ CONFIG_NET_IPV4=n CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_ND=y CONFIG_NET_IPV6_DAD=y diff --git a/tests/net/neighbor/prj.conf b/tests/net/neighbor/prj.conf index 62cd9fa0664..64665276272 100644 --- a/tests/net/neighbor/prj.conf +++ b/tests/net/neighbor/prj.conf @@ -10,7 +10,7 @@ CONFIG_NET_BUF_TX_COUNT=7 CONFIG_NET_BUF_DATA_SIZE=128 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3 CONFIG_NET_DEBUG_IF=y diff --git a/tests/net/net_pkt/prj.conf b/tests/net/net_pkt/prj.conf index 594eb5cb348..9ba7db38058 100644 --- a/tests/net/net_pkt/prj.conf +++ b/tests/net/net_pkt/prj.conf @@ -16,6 +16,6 @@ CONFIG_NET_LOG=y CONFIG_SYS_LOG_NET_LEVEL=1 CONFIG_SYS_LOG_SHOW_COLOR=y #CONFIG_NET_DEBUG_NET_PKT=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_ZTEST=y diff --git a/tests/net/route/prj.conf b/tests/net/route/prj.conf index fa1a9463490..35c88072448 100644 --- a/tests/net/route/prj.conf +++ b/tests/net/route/prj.conf @@ -8,7 +8,7 @@ CONFIG_NET_MAX_CONTEXTS=4 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_DAD=n CONFIG_NET_IPV6_MLD=n diff --git a/tests/net/rpl/prj.conf b/tests/net/rpl/prj.conf index 28dd3e7433d..964848c8a4f 100644 --- a/tests/net/rpl/prj.conf +++ b/tests/net/rpl/prj.conf @@ -8,7 +8,7 @@ CONFIG_NET_MAX_CONTEXTS=4 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_DAD=n diff --git a/tests/net/tcp/prj.conf b/tests/net/tcp/prj.conf index 278be2b0b2f..3eb2a29d8ac 100644 --- a/tests/net/tcp/prj.conf +++ b/tests/net/tcp/prj.conf @@ -15,7 +15,7 @@ CONFIG_NET_BUF_TX_COUNT=20 CONFIG_NET_MAX_CONTEXTS=20 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=5 CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=3 diff --git a/tests/net/trickle/prj.conf b/tests/net/trickle/prj.conf index f2635866d51..95ed7cb56b2 100644 --- a/tests/net/trickle/prj.conf +++ b/tests/net/trickle/prj.conf @@ -8,7 +8,7 @@ CONFIG_NET_MAX_CONTEXTS=1 CONFIG_NET_L2_DUMMY=y CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IPV6_ND=n CONFIG_NET_IPV6_DAD=n diff --git a/tests/net/udp/prj.conf b/tests/net/udp/prj.conf index a4058ef07ad..97da1b85b70 100644 --- a/tests/net/udp/prj.conf +++ b/tests/net/udp/prj.conf @@ -15,7 +15,7 @@ CONFIG_NET_BUF_RX_COUNT=10 CONFIG_NET_BUF_TX_COUNT=10 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=2 CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=2 diff --git a/tests/net/utils/prj.conf b/tests/net/utils/prj.conf index 161499349e0..ba7a4cf56fc 100644 --- a/tests/net/utils/prj.conf +++ b/tests/net/utils/prj.conf @@ -10,7 +10,7 @@ CONFIG_NET_BUF_RX_COUNT=7 CONFIG_NET_BUF_TX_COUNT=7 CONFIG_NET_LOG=y CONFIG_SYS_LOG_SHOW_COLOR=y -CONFIG_RANDOM_GENERATOR=y +CONFIG_ENTROPY_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=3 CONFIG_NET_DEBUG_UTILS=y