/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SYS_N2RNG_H
#define _SYS_N2RNG_H
/* skip following stuff when included in n2rng_hcall.s */
#ifndef _ASM
#endif /* !_ASM */
#ifdef __cplusplus
extern "C" {
#endif
#define CTL_STATE_UNCONFIGURED 0
#ifndef _ASM
typedef enum {
typedef union n2rngctl {
struct {
} fields;
} n2rng_ctl_t;
typedef struct {
#if defined(_KERNEL)
/*
* Our contiguous memory alignment requirement is
* only for 8 bytes, however contig mem allocation
* routines requirement minimum of 64.
*/
/*
* Returns 1 only if the address range of a variable of type type at
* ptr falls entirely on one page. Based on page size of 4K. May
* give some false negatives on larger page sizes.
*/
& PAGEMASK) == 0)
/*
* The RNG hardware can send certain internal analog signals to an
* external pin on the chip. Setting the rnc_anlg_sel bit to
* N2RNG_NOANALOGOUT deselects all analog signals (perhaps selects
* ground). Choosing any other value would aid an attacker with
* physical access to the chip.
*/
/*
* There can only be N2_RNG_FIPS_INSTANCES concurrent RNG requsts from
* the framework. Making this value large helps benchmarks. It
* should probably come from a conf file, but for now it is hard
* coded. The code computes i % N2RNG_FIPS_INSTANCES, which is more
* efficient when N2RNG_FIPS_INSTANCES is a power of 2.
*/
struct fipsrandomstruct {
};
typedef struct {
/*
* volatile, since it is not protected by a mutex. (That is
* okay since it is operated on and accessed via atomic ops.)
*/
volatile unsigned int fips_round_robin_j;
/*
* Device flags (n2rng_t.n_flags)
*/
#define DS_RNGBYTES 0
typedef struct {
typedef struct {
typedef struct {
} rng_entry_t;
typedef struct {
int n_num_rngs;
int n_num_rngs_online;
typedef struct n2rng {
char *n_binding_name;
} n2rng_t;
struct n2rng_stat {
};
#define RNG_MODE_DIAGNOSTIC 0
#if defined(DEBUG)
void n2rng_dprintf(n2rng_t *, int, const char *, ...);
void n2rng_dumphex(void *, int);
int n2rng_dflagset(int);
#else /* !defined(DEBUG) */
#endif /* !defined(DEBUG) */
/*
*/
int n2rng_herr2kerr(uint64_t);
int n2rng_logic_test(n2rng_t *, int);
int n2rng_noise_gen_test_set(void);
/*
*/
void n2rng_error(n2rng_t *, const char *, ...);
void n2rng_diperror(dev_info_t *, const char *, ...);
uint64_t hv_rng_get_diag_control(void);
/*
*/
int n2rng_fips_rng_post(void);
#endif /* _KERNEL */
#endif /* !_ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_N2RNG_H */