Nicholas Flintham | 1e3d311 | 2013-04-10 10:48:38 +0100 | [diff] [blame^] | 1 | /* |
| 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 | |
| 18 | struct 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 | |
| 31 | extern int hwrng_register(struct hwrng *rng); |
| 32 | extern void hwrng_unregister(struct hwrng *rng); |
| 33 | |
| 34 | #endif |