blob: 8ab1ddb54612b867446b92550b44b5dcc9e1dd4f [file] [log] [blame]
Nicholas Flintham1e3d3112013-04-10 10:48:38 +01001/*
2 Hardware Random Number Generator
3
4 Please read Documentation/hw_random.txt for details on use.
5
6 ----------------------------------------------------------
7 This software may be used and distributed according to the terms
8 of the GNU General Public License, incorporated herein by reference.
9
10 */
11
12#ifndef LINUX_HWRANDOM_H_
13#define LINUX_HWRANDOM_H_
14
15#include <linux/types.h>
16#include <linux/list.h>
17
18struct hwrng {
19 const char *name;
20 int (*init)(struct hwrng *rng);
21 void (*cleanup)(struct hwrng *rng);
22 int (*data_present)(struct hwrng *rng, int wait);
23 int (*data_read)(struct hwrng *rng, u32 *data);
24 int (*read)(struct hwrng *rng, void *data, size_t max, bool wait);
25 unsigned long priv;
26
27
28 struct list_head list;
29};
30
31extern int hwrng_register(struct hwrng *rng);
32extern void hwrng_unregister(struct hwrng *rng);
33
34#endif