Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hw_random.h
Go to the documentation of this file.
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 
33 struct hwrng {
34  const char *name;
35  int (*init)(struct hwrng *rng);
36  void (*cleanup)(struct hwrng *rng);
37  int (*data_present)(struct hwrng *rng, int wait);
38  int (*data_read)(struct hwrng *rng, u32 *data);
39  int (*read)(struct hwrng *rng, void *data, size_t max, bool wait);
40  unsigned long priv;
41 
42  /* internal. */
43  struct list_head list;
44 };
45 
47 extern int hwrng_register(struct hwrng *rng);
49 extern void hwrng_unregister(struct hwrng *rng);
50 
51 #endif /* LINUX_HWRANDOM_H_ */