mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
esp32c3_rng.c: Remove unused functions.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
committed by
Gustavo Henrique Nihei
parent
5c6a30c00b
commit
c811cefa2d
@@ -59,7 +59,6 @@
|
|||||||
static int esp32c3_rng_initialize(void);
|
static int esp32c3_rng_initialize(void);
|
||||||
static ssize_t esp32c3_rng_read(struct file *filep, char *buffer,
|
static ssize_t esp32c3_rng_read(struct file *filep, char *buffer,
|
||||||
size_t buflen);
|
size_t buflen);
|
||||||
static int esp32c3_rng_open(struct file *filep);
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
@@ -79,7 +78,6 @@ static struct rng_dev_s g_rngdev;
|
|||||||
|
|
||||||
static const struct file_operations g_rngops =
|
static const struct file_operations g_rngops =
|
||||||
{
|
{
|
||||||
.open = esp32c3_rng_open, /* open */
|
|
||||||
.read = esp32c3_rng_read, /* read */
|
.read = esp32c3_rng_read, /* read */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,24 +122,6 @@ uint32_t IRAM_ATTR esp_random(void)
|
|||||||
return result ^ getreg32(WDEV_RND_REG);
|
return result ^ getreg32(WDEV_RND_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: esp32c3_rng_start
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
static void esp32c3_rng_start(void)
|
|
||||||
{
|
|
||||||
/* Nothing to do, bootloader already did it */
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: esp32c3_rng_stop
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
static void esp32c3_rng_stop(void)
|
|
||||||
{
|
|
||||||
/* Nothing to do */
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: esp32c3_rng_initialize
|
* Name: esp32c3_rng_initialize
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -155,25 +135,6 @@ static int esp32c3_rng_initialize(void)
|
|||||||
nxsem_init(&g_rngdev.rd_sem, 0, 1);
|
nxsem_init(&g_rngdev.rd_sem, 0, 1);
|
||||||
nxsem_set_protocol(&g_rngdev.rd_sem, SEM_PRIO_NONE);
|
nxsem_set_protocol(&g_rngdev.rd_sem, SEM_PRIO_NONE);
|
||||||
|
|
||||||
esp32c3_rng_stop();
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: esp32c3_rng_open
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
static int esp32c3_rng_open(struct file *filep)
|
|
||||||
{
|
|
||||||
/* O_NONBLOCK is not supported */
|
|
||||||
|
|
||||||
if (filep->f_oflags & O_NONBLOCK)
|
|
||||||
{
|
|
||||||
_err("ESP32-C3 RNG doesn't support O_NONBLOCK mode.\n");
|
|
||||||
return -EPERM;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,11 +156,7 @@ static ssize_t esp32c3_rng_read(struct file *filep, char *buffer,
|
|||||||
|
|
||||||
read_len = buflen;
|
read_len = buflen;
|
||||||
|
|
||||||
/* start RNG and wait until the buffer is filled */
|
/* Wait until the buffer is filled */
|
||||||
|
|
||||||
esp32c3_rng_start();
|
|
||||||
|
|
||||||
/* Now, got data */
|
|
||||||
|
|
||||||
while (buflen > 0)
|
while (buflen > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user