diff options
| author | Amos Kong <akong@redhat.com> | 2014-05-13 21:03:46 -0400 |
|---|---|---|
| committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-05-13 21:20:34 -0400 |
| commit | 08e53fbdb85c0f6f45c0f7c1ea3defc1752a95ce (patch) | |
| tree | aff27f2f0cc164159387e4566d9aaf182048cc95 /include/linux | |
| parent | e75279c4fb853f42004cbabb6dbf6b23188dc163 (diff) | |
virtio-rng: support multiple virtio-rng devices
Current hwrng core supports to register multiple hwrng devices,
and there is only one device really works in the same time.
QEMU alsu supports to have multiple virtio-rng backends.
This patch changes virtio-rng driver to support multiple
virtio-rng devices.
]# cat /sys/class/misc/hw_random/rng_available
virtio_rng.0 virtio_rng.1
]# cat /sys/class/misc/hw_random/rng_current
virtio_rng.0
]# echo -n virtio_rng.1 > /sys/class/misc/hw_random/rng_current
]# dd if=/dev/hwrng of=/dev/null
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hw_random.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index b4b0eef5fddf..02d9c87be54c 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | * @priv: Private data, for use by the RNG driver. | 31 | * @priv: Private data, for use by the RNG driver. |
| 32 | */ | 32 | */ |
| 33 | struct hwrng { | 33 | struct hwrng { |
| 34 | const char *name; | 34 | char *name; |
| 35 | int (*init)(struct hwrng *rng); | 35 | int (*init)(struct hwrng *rng); |
| 36 | void (*cleanup)(struct hwrng *rng); | 36 | void (*cleanup)(struct hwrng *rng); |
| 37 | int (*data_present)(struct hwrng *rng, int wait); | 37 | int (*data_present)(struct hwrng *rng, int wait); |
