random: add a Virtio RNG module
* The default module is replaced by the Virtio RNG module when found. * This can have the undesired effect of rendering /dev/urandom slow. * Tested with the following QEmu command line option: -device virtio-rng-pci,rng=rng0 -object rng-random,filename=/dev/random,id=rng0 * moved random.h to private/drivers headers.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Jérôme Duval, [email protected]
|
||||
*/
|
||||
#ifndef _RANDOM_H
|
||||
#define _RANDOM_H
|
||||
|
||||
|
||||
#include <device_manager.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
driver_module_info info;
|
||||
} random_for_controller_interface;
|
||||
|
||||
|
||||
#define RANDOM_FOR_CONTROLLER_MODULE_NAME "bus_managers/random/controller/driver_v1"
|
||||
|
||||
// Bus manager interface used by Random controller drivers.
|
||||
typedef struct random_module_info {
|
||||
driver_module_info info;
|
||||
|
||||
status_t (*read)(void* cookie, void *_buffer, size_t *_numBytes);
|
||||
status_t (*write)(void* cookie, const void *_buffer, size_t *_numBytes);
|
||||
} random_module_info;
|
||||
|
||||
|
||||
#endif /* _RANDOM_H */
|
||||
Reference in New Issue
Block a user