Commit d047266
Sven Van Asbroeck
bcm2835_rng_rust: add support for
To demonstrate device driver data in a non-trivial way, create
a `miscdev` for each discovered device. This `miscdev` can only be
opened and read. When read from userspace, it returns four zero bytes
at a time.
Note that `DrvData` consists of a `Pin<Box<miscdev::Registration>>`,
which is a pinned structure. This demonstrates that pinned or self-
referential structures may be used in `DrvData`.
Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>DrvData
1 parent 669248b commit d047266
1 file changed
+39
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| |||
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
23 | 51 | | |
24 | 52 | | |
25 | 53 | | |
26 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
27 | 57 | | |
28 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
29 | 61 | | |
30 | 62 | | |
31 | | - | |
| 63 | + | |
32 | 64 | | |
33 | 65 | | |
34 | 66 | | |
| |||
0 commit comments