Root/
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 | /** |
19 | * struct hwrng - Hardware Random Number Generator driver |
20 | * @name: Unique RNG name. |
21 | * @init: Initialization callback (can be NULL). |
22 | * @cleanup: Cleanup callback (can be NULL). |
23 | * @data_present: Callback to determine if data is available |
24 | * on the RNG. If NULL, it is assumed that |
25 | * there is always data available. *OBSOLETE* |
26 | * @data_read: Read data from the RNG device. |
27 | * Returns the number of lower random bytes in "data". |
28 | * Must not be NULL. *OSOLETE* |
29 | * @read: New API. drivers can fill up to max bytes of data |
30 | * into the buffer. The buffer is aligned for any type. |
31 | * @priv: Private data, for use by the RNG driver. |
32 | */ |
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 | |
46 | /** Register a new Hardware Random Number Generator driver. */ |
47 | extern int hwrng_register(struct hwrng *rng); |
48 | /** Unregister a Hardware Random Number Generator driver. */ |
49 | extern void hwrng_unregister(struct hwrng *rng); |
50 | |
51 | #endif /* LINUX_HWRANDOM_H_ */ |
52 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9