Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

rng_internals.h File Reference


Detailed Description

This file contains definitions which are internal to the RNG driver.

This header file should only ever be needed by rng_driver.c

Compile-time flags minimally needed:

Definition in file rng_internals.h.

#include "portable_os.h"
#include "shw_driver.h"
#include "rng_driver.h"

Go to the source code of this file.

Defines

#define BYTES_TO_WORDS(byte_count)   (((byte_count)+sizeof(uint32_t)-1)/sizeof(uint32_t))
#define RNG_ADD_ENTROPY(value)
#define RNG_ADD_QUEUE_ENTRY(pool, entry)   SHW_ADD_QUEUE_ENTRY(pool, (shw_queue_entry_t*)entry)
#define RNG_AUTO_SEED()
#define RNG_BASE_ADDR   RNGC_BASE_ADDR
#define RNG_CHECK_READ   0
#define RNG_CHECK_SEED_ERR()   (RNG_READ_REGISTER(RNGC_ERROR) & RNGC_ERROR_STATUS_STAT_ERR)
#define RNG_CHECK_SELF_ERR()   (RNG_READ_REGISTER(RNGC_ERROR) & RNGC_ERROR_STATUS_ST_ERR)
#define RNG_CHECK_WRITE   1
#define RNG_CLEAR_ALL_STATUS()
#define RNG_CLEAR_ERR()
#define RNG_DRIVER_NAME   "rng"
#define RNG_GET_FIFO_SIZE()
#define RNG_GET_HIGH_ASSURANCE()
#define RNG_GET_RNG_TYPE()
#define RNG_GET_STATUS()   RNG_READ_REGISTER(RNGC_ERROR)
#define RNG_GET_WORDS_IN_FIFO()
#define RNG_GET_WORK_ENTRY()   (rng_work_entry_t*)SHW_POP_FIRST_ENTRY(&rng_work_queue)
#define RNG_GO()
#define RNG_HAS_BAD_KEY()   (RNG_READ_REGISTER(RNGC_ERROR) & RNGC_ERROR_STATUS_BAD_KEY)
#define RNG_HAS_ERROR()   (RNG_READ_REGISTER(RNGC_STATUS) & RNGC_STATUS_ERROR)
#define RNG_MASK_ALL_INTERRUPTS()
#define RNG_MAX_TRIES   100
#define RNG_NO_FORCE_HIGH_ASSURANCE
#define RNG_OSCILLATOR_FAILED()   (RNG_READ_REGISTER(RNGC_ERROR) & RNGC_ERROR_STATUS_OSC_ERR)
#define RNG_PUT_RNG_TO_SLEEP()
#define RNG_READ_FIFO()   RNG_READ_REGISTER(RNGC_FIFO)
#define RNG_READ_REGISTER(offset)   os_read32(rng_base+(offset))
#define RNG_REMOVE_QUEUE_ENTRY(pool, entry)   SHW_REMOVE_QUEUE_ENTRY(pool, (shw_queue_entry_t*)entry)
#define RNG_RESEED()   (RNG_READ_REGISTER(RNGC_STATUS) & RNGC_STATUS_RESEED)
#define RNG_SEED_DONE()   ((RNG_READ_REGISTER(RNGC_STATUS) & RNGC_STATUS_SEED_DONE) != 0)
#define RNG_SEED_GEN()
#define RNG_SELF_TEST()
#define RNG_SELF_TEST_DONE()   (RNG_READ_REGISTER(RNGC_STATUS) & RNGC_STATUS_ST_DONE)
#define RNG_SET_HIGH_ASSURANCE()
#define RNG_SLEEP()
#define RNG_UNMASK_ALL_INTERRUPTS()
#define RNG_VERIFY_TYPE(type)   ((type) == RNG_TYPE_RNGC)
#define RNG_WAKE()   1
#define RNG_WAKE_FROM_SLEEP()
#define RNG_WORKING()
#define RNG_WRITE_REGISTER(offset, value)   (void)os_write32(rng_base+(offset), value)

Typedefs

typedef enum rng_status rng_status_t

Enumerations

enum  rng_status {
  RNG_STATUS_INITIAL, RNG_STATUS_CHECKING, RNG_STATUS_UNIMPLEMENTED, RNG_STATUS_OK,
  RNG_STATUS_FAILED
}

Functions

 OS_DEV_INIT_DCL (rng_init)
 OS_DEV_ISR_DCL (rng_irq)
 OS_DEV_SHUTDOWN_DCL (rng_shutdown)
 OS_DEV_TASK_DCL (rng_entropy_task)
static void RNG_ADD_WORK_ENTRY (rng_work_entry_t *work)
static void rng_cleanup (void)
static fsl_shw_return_t rng_drain_fifo (uint32_t *random_p, int count_words)
static os_error_code rng_grab_config_values (void)
static os_error_code rng_map_RNG_memory (void)
static os_error_code rng_setup_interrupt_handling (void)

Variables

static shw_queue_t rng_work_queue


Generated by  Doxygen 1.6.0   Back to index